Setting up Web Tracking
The difference between a generic tracker or a shop tracker lies in the parameters that are defined. For a generic tracker, you can define all parameters yourself but for a shop tracker these parameters are fixed. As a result you will have more structured reporting on a shop tracker.
Create the Engage Webtracker
The goal of creating the Engage webtracker is to ensure that an additional parameter is added to the URL of all domains that need to be tracked. This parameter contains data about the user and will be processed by a script and generate cookies.
To create a new tracker, see this dedicated topic.
The following fields can be configured:
- Name — Enter a unique name for the tracker.
- Domains — Enter all of the domains on which this tracker should be applied. By setting one or more domains here, the tracker will only be used for those domains. You can set more than one domain. Separate the different domains with a semicolon.
- Move parameters to the front — When this option is selected, parameters are placed at the beginning of the Query string. When using a tracker, Engage parameters are, by default, added at the end of the URL. But sometimes this results in very long URLs and not all CMS systems support them. With this option, you can ensure that the Engage parameters are always included in the URL.
Create a tracking script
The tracker script holds the information of what should be tracked on the website. When the script is created it can easily be placed on the website pages where the information is tracked on what has been purchased, how much, for what price or any other information you might need.
The parameters in the script will then be populated with the right values when a user lands on a page with that script and the data is returned to Engage where it provides insight.
To create a tracker script, check out the following topic.
Adding JavaScript code to external page
All landing pages must be tagged with the JavaScript code that is generated by the tracking script. There are two possible methods:
- Method 1 — first loads the JavaScript library, then calls the ma_track() function afterwards.
- Method 2 — is optimized and loads the JavaScript library asynchronously after the global variables are filled with trackdata.
Note: Both methods are supported but CANNOT be combined.
Without parameters:
Method 1:
<SCRIPT SRC="http://demo.emsecure.net/optiext/webtracker.dll"></SCRIPT>
<SCRIPT>ma_track();</SCRIPT>
Method 2:
<SCRIPT>
var trackdata = trackdata || [];
(function (d, s, id) {
var js, sjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//demo.emsecure.net/optiext/webtracker.dll";
sjs.parentNode.insertBefore(js, sjs);
}
(document, 'script', 'webtracker'));
</SCRIPT>
Parameters from the “ma_track” call have been removed because the cookie won’t be written if they were specified.
All pages that need to be tracked must contain the full JavaScript code (don’t forget to replace the parameters in the function call):
With parameters:
Method 1:
<SCRIPT SRC="http://demo.emsecure.net/optiext/webtracker.dll"></SCRIPT>
<SCRIPT>
ma_track('aOcqflias','Value for CUSTOMERNUMBER','Value for SHOPPINGBASKET','Value for TOTALSALE');
</SCRIPT>
Method 2:
<SCRIPT>
var trackdata = trackdata || [];
trackdata.push('aOcqflias');
trackdata.push('Value for CUSTOMERNUMBER');
trackdata.push('Value for SHOPPINGBASKET');
trackdata.push('Value for TOTALSALE');
(function (d, s, id) {
var js, sjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//demo.emsecure.net/optiext/webtracker.dll";
sjs.parentNode.insertBefore(js, sjs);
}
(document, 'script', 'webtracker'));
</SCRIPT>
Example script to push multiple products :
<SCRIPT>
var trackdata = [];
// Product A
// -----------------------------
trackdata.push('aOcufliaw');
trackdata.push('00000001');
trackdata.push('1.0');
trackdata.push('0.95');
trackdata.push('');
trackdata.push('');
trackdata.push('500831506');
trackdata.push('');
// push to server...
ma_track.apply(null, trackdata);
// Product B
// -----------------------------
trackdata = [];
trackdata.push('aOcufliaw');
trackdata.push('00000002');
trackdata.push('2.0');
trackdata.push('4.05');
trackdata.push('');
trackdata.push('');
trackdata.push('500831508');
trackdata.push('');
// push to server...
ma_track.apply(null, trackdata);
(function (d, s, id) {
var js, sjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//demo.emsecure.net/optiext/webtracker.dll";
sjs.parentNode.insertBefore(js, sjs);
}
(document, 'script', 'webtracker'));
</SCRIPT>
Note: When parameters
are sent, thanks to the JavaScript, all values are considered as text.
This means that, for instance, when a price value of 25,00 is communicated,
the system will convert this according to the regional settings. If regional
settings define a comma to separate thousands and a dot to indicate decimals,
the 25,00 value will be converted into 25.00.
To avoid wrong conversion, data should transferred in a format according
to the database regional settings.
Note that it is possible to add a callback function once the webtracker script is loaded. To be able to use this callback function, the following global function name must be used: webtrackerCallback
Example:
Function webtrackerCallback()
{
//some javascript code that will be processed when the webtracker is loaded
}
This function can be placed anywhere.
Important Note: The following configuration must be executed in Marigold Engage Configuration.
Verifying configuration
- Check if the webtracker.dll is installed on the Engage Environment.
- Check if the external pages have the correct JavaScript code by checking their source code.
- Clean cookies off the browser, then send a test email and test the entire journey.
- Afterwards, check if an entry into the “Webtrack” table has been inserted.
If all those checks are valid, the Engage web tracking configuration is complete.