Web Tracker

Installing the web tracker script on your website

18 views March 26, 2025 March 26, 2025 robert 0

Get your tracker script

To install the tracker script on your website you need to:

  1. Get your tracker script from your eMarketeer account (admin required).
    You will find it under Settings – Plugins & Integrations – Website scripts
  2. Place the code on your website so that it loads on every page

The base script to load looks like this

<script type="application/javascript" src="https://develop.emarketeer.com/public/scripts/t.js"></script>

Script functions

Once the base script is loaded on the website you need to control the tracking using these functions.
Before these functions are run, no tracking will occur.

emtv2.init(‘1234’);

This function starts saving the visited pages in local storage. Still the data will not be sent to eMarketeer.

emtv2.start();

The start function tells eMarketeer we have consent for sending data to eMarketeer. Once this function is called data will be sent when the visitor is identified.

emtv2.stop();

Use this function to revoke consent and stop tracking the visitor. It can be triggered by a separate button or in conjunction with your cookie banner when consent is withdrawn.

Best practice for GDPR

You can load the base script on all pages of your site. However the init() and start() functions should be integrated with your cookie consent system. Run the functions if consent exists on entry or of consent is given.
If a visitor declines the consent or revokes existing consent the function stop() should be run.

Code example

Here’s a code example which can be used on your site directly or with Google Tag Manager. This example uses Cookieinformation consent system. Make sure the cookie consent system is loaded before the eMarketeer Web Tracker.

<script type="application/javascript" src="https://develop.emarketeer.com/public/scripts/t.js"></script>

<script>

function handleEmtv2Tracking() {

   if (CookieInformation.getConsentGivenFor('cookie_cat_marketing')) {
      emtv2.init('1234');
      emtv2.start();
   } else {
      emtv2.stop();
   }

}

handleEmtv2Tracking();

window.addEventListener('CookieInformationConsentGiven', function(event) {
   handleEmtv2Tracking();
}, false);

</script>

 

Was this helpful?