collector.js is a JavaScript snippet which records how users interact with your website or app. When your page loads in the user’s browser, the Collector will send usage data back to the Prodlytic servers to generate your analytics. There are three ways of installing this code.


1. JS Collector Quickstart

You need to ensure that the JS Collector is loaded into every page of your website or app. There are two ways to do this.

Tip: the best place to add this code is immediately before the closing </body> tag in your HTML.

Use this code snippet (but change 'EXAMPLE' to your own 'PID')

<script src="https://collector.prodlytic.com/collector.js" charset="utf-8" data-pid="EXAMPLE"></script>

Note that the ‘data-pid’ attribute is set to EXAMPLE here. You’ll need to use your own 'PID' value as supplied in your Prodlytic account.


2. Google Tag Manager

If your site uses Google Tag Manager (GTM) you can easily add a new Tag for Prodlytic.

Add a new "Custom HTML" Tag to Google Tag Manager and paste the Prodlytic JS Collector snippet into the HTML text area.

google tag manager screenshot

Important: You must check the “Support document.write” checkbox or the collector will not load.


3. Wordpress

We have a Prodlytic Wordpress plugin available which will automatically add the Prodlytic JS Collector into your Wordpress site or blog. Install the plugin, then add your product ID (PID) code and you're all set.


Excluding elements

Exclude elements from being collected by Prodlytic by adding the CSS class

prodlytic_ignore
to the element


Content Security Policy

Content Security Policy (CSP) is a security standard supported by modern web browsers which aims to prevent cross-site scripting (XSS), clickjacking and other code injection exploits.

If your Product uses a CSP, you must add the Prodlytic domain before we can collect any data for you.

By adding *.prodlytic.com to your CSP you allow your user's web browser to load resources from the Prodlytic servers.

Content-Security-Policy: default-src 'self' *.prodlytic.com

Support

Please head over to our Support section for any further questions.

Contact us to get started with Prodlytic

Get Started