Get Your Tracker Script
To install the eMarketeer Web Tracker on your website, follow these steps:
- Retrieve your tracker script from your eMarketeer account (admin access required).
Go to
Settings → Plugins & Integrations → Website scripts - Place the script on your website so that it loads on every page.
- Ensure all pages on your site are encoded in
UTF-8
.
(Make sure your HTML includes:<meta charset="utf-8">
inside the<head>
)
Base Tracking Script
Paste the following script tag on all your pages:
<script type="application/javascript" src="https://app.emarketeer.com/public/scripts/t.js"></script>
Script Functions
After the base script has loaded, use the following functions to control tracking behavior. No tracking occurs until these functions are triggered — giving you full control for GDPR compliance.
emtv2.init(‘<unique id>’);
- Initializes local tracking by storing visited pages in
localStorage
. - Note: the unique id is automatically populated when you retrieve the script from the eMarketeer UI.
- At this stage, no data is sent to eMarketeer.
emtv2.start();
- Starts sending tracking data to eMarketeer.
- Should only be called after consent has been given by the visitor.
emtv2.stop();
- Revokes consent and stops tracking.
- Can be tied to a “Withdraw Consent” button or your cookie consent system.
Best Practice for GDPR
- Always load the base script on all pages.
- Integrate
init()
andstart()
with your cookie consent system. - If consent is granted, call both
emtv2.init()
andemtv2.start()
. - If consent is declined or revoked, call
emtv2.stop()
.
Example Integration with CookieInformation
Here’s an example using CookieInformation as your consent manager. This can be placed on your site or in Google Tag Manager:
<script type="application/javascript" src="https://app.emarketeer.com/public/scripts/t.js"></script> <script> var emtv2Initialized = false; function handleEmtv2Tracking() { if (typeof CookieInformation === 'undefined' || typeof emtv2 === 'undefined') { console.warn('Required libraries not available yet.'); return; } if (CookieInformation.getConsentGivenFor('cookie_cat_marketing')) { if (!emtv2Initialized) { emtv2.init('YOUR_UNIQUE_ID'); emtv2.start(); emtv2Initialized = true; console.log('emtv2 initialized and started.'); } else { console.log('emtv2 already initialized, skipping.'); } } else { if (emtv2Initialized) { emtv2.stop(); emtv2Initialized = false; console.log('emtv2 stopped.'); } else { console.log('Consent not given, emtv2 not initialized.'); } } } // Initial check handleEmtv2Tracking(); // Handle consent changes window.addEventListener('CookieInformationConsentGiven', function(event) { handleEmtv2Tracking(); }, false); </script>