Table of Contents

Installing AnalyticsJS (CaliberMind snippet)

Nolan Garrido Updated by Nolan Garrido

Installing AnalyticsJS

Installing AnalyticsJS on your site is the first step towards tracking page views and other actions on your website. This is the first step towards doing advanced attribution such as Return-on-ad-spend (ROAS) or Chain-based machine learning models.

The Web Tracker snippet can be found under Settings/Web Tracker

CaliberMind Web Tracker Snippet

There are two snippets typically used are: page and identify. These working together allows us to match user behavior to their identity when they provide it via a login or form submission (e.g. downloading an e-book.

Step 1 - Install "Page" snippet:

In the <head> of your site, place the below code on every page (replace the {YOUR_WRITE_KEY} with your unique tracking script id provided - which can be found within your CaliberMind environment).

<script type="text/javascript" charset="UTF-8"> !(function() { var analytics = (window.analytics = window.analytics || []); if (!analytics.initialize) { if (analytics.invoked) { window.console && console.error && console.error('MetaRouter snippet included twice.') } else { analytics.invoked = !0; analytics.methods = [ 'trackSubmit', 'trackClick', 'trackLink', 'trackForm', 'pageview', 'identify', 'reset', 'group', 'track', 'ready', 'alias', 'debug', 'page', 'once', 'off', 'on', 'addSourceMiddleware', 'addIntegrationMiddleware', 'setAnonymousId', 'addDestinationMiddleware', ]; analytics.factory = function (e) { return function () { var t = Array.prototype.slice.call(arguments); t.unshift(e); analytics.push(t); return analytics } }; for (var e = 0; e < analytics.methods.length; e++) { var key = analytics.methods[e]; analytics[key] = analytics.factory(key) } analytics.load = function (src, o) { analytics._loadOptions = o; var t = document.createElement('script'); t.type = 'text/javascript'; t.async = !0; t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.calibermind.com/"+ src + ".js"; var n = document.getElementsByTagName('script')[0]; n.parentNode.insertBefore(t, n); }; analytics.SNIPPET_VERSION = '4.13.1'; analytics.load('a', { writeKey: '{YOUR_WRITE_KEY}'}); analytics.page(); }}})(); </script>

This snippet is also available in CaliberMind at https://my.calibermind.com/settings/tracking once you're logged in.

The snippet will load AnalyticsJS onto the page asynchronously, so it won’t affect the page load speed of your site. As soon as the snippet is running on your site, website data will start flowing into your CaliberMind tables.

Step 2 - Install "Identify" snippet:

Basic HTML forms

For basic HTML forms, prepend the snippet below before the </body> tag on the page containing the form you'd like to track.

<script type="text/javascript" src="https://cdn.calibermind.com/js/identifyEmail.latest.js"></script>

HubSpot Websites

For standard HubSpot websites that do not use embedded forms, prepend the snippet below in Settings >> Websites >> Pages >> Templates >> HTML >> Site footer HTML section.

*Tip: If you would like this JS file included in all of your HubSpot domains and each domain follows the same header/footer includes, select "Default settings for all domains" from the "Choose a domain to edit its settings" drop down at the very top of the page. Then paste the code string below into the Site footer HTML section. Otherwise, or if specific domains have custom headers/footers, select any of the specific domains that have a custom footer section which should include this code string.

<script type="text/javascript" src="https://cdn.calibermind.com/js/identifyEmail_hubspot.latest.js"></script>

**Please note it can take up to 12 hours once a snippet is successfully setup to propagate into CaliberMind.

For HubSpot embedded forms, please see this article on how to attach the identify call.

For Marketo embedded forms, please see this article on how to attach the identify call.

For information on how to set up automatic identification through email forms, check out our knowledgebase article on the topic.

Step 3 - Verify Setup:

To verify that the setup is complete, please see this article which explains how to confirm that the "Page" and "Identify" calls are initiating correctly on page load and form submission.

How did we do?

Web Tracker and Installation Settings - Start Here!

Two ways to identify prospects that submit a form containing email address using AnalyticsJS

Contact