Background
Proper implementation is essential for the clickstream tracking service to work. After choosing the pages on your website you want to track the traffic for, implement Clickstream by inserting several lines of JavaScript code on those specific pages.
Links in emails sent through your account will contain unique identifiers for the email recipient and tied to the specific campaign. The JavaScript embedded on your pages reads these identifiers when a recipient clicks a tracked link, then sets a cookie from your domain on the user’s web browser. Thereafter, each visit by the email recipient to a page on your site with this JavaScript will cause the cookie to be read and information about the page visit sent back to our server where it is saved on the contact record.
Identify all of the web pages you wish to track
JavaScript needs to be placed on any landing pages (i.e., the destination URL of the link or links included in the email), conversion/checkout pages (any page which confirms a purchase), and any other page in between that you would like to track.
** Note: The JavaScript is different for checkout (i.e., purchase) pages versus any other pages to be tracked.
Add the clickstream JavaScript Code
For best results, insert your JavaScript just before the </body> tag on all web pages that need to be tracked. The format of the JavaScript is:
<script>
(function(d,s,i){
function init() {
if(!i) {
i = true;
DlvTracking.init({
listName: 'dvmktg2022',
autoTrackPageview: true,
/* optional init properties */
});
/* additional tracking functions */
}
}
var f=d.getElementsByTagName(s)[0],j=d.createElement(s);
j.async=true;
j.src='https://integration.delivra.com/tracking/cs/v3/dltr.js';
j.onload=init;
f.parentNode.insertBefore(j,f);
})(document,'script');
</script>
All available properties for init:
Parameter | Type | Default | Description |
---|---|---|---|
listName* | String | (Required) Your account name, shown above. | |
autoTrackPageview | Bool | true | If true (default), a page view is automatically tracked for the current URL when a visitor loads the page. If false, a page view will not automatically be tracked and manual page view tracking must be used (see below). |
metaTagsName | String | keywords | Specify which html <meta> tag to use for automatic page view tagging. If a custom meta tag is available for this purpose, specify its name. |
persist | Array | If clickstream should be tracked across domains, the other domains must be whitelisted. Setting this property will cause the tracking script to rewrite all links on included pages to persist any tracking variables. Note: the originating domain does not need to be listed.
example syntax:
persist: ['www.google.com', 'www.yahoo.com']
|
Manually track a page view
The automatic tracking method described above may not be useful in certain scenarios. For example, if new content is displayed without re-loading the page in the user’s browser, the above method will not register a page view event for the new content.
Manually tracking page views also allows more control over the tracked URL and tags.
If you are planning to manually track page views, set autoTrackPageview to false in the init function, and add the function below.
DlvTracking.track('pageview', {
url: '/example/path.html',
tags: ['example', 'test']
});
All available properties for pageview:
Parameter | Type | Default | Description |
---|---|---|---|
url | String | The current page URL | The page URL to show in reporting. |
tags | Array/String | All tags found in the metaTagsName meta tag. | An array or comma separated string of tags to apply to the page view. If tags are specified this way, automatic tagging will not be used. |
Track a purchase
To track purchase data, add the function below only on the order confirmation page.
DlvTracking.track('purchase', {
orderId: '1234567890',
totalItemQuantity: 3,
totalRevenue: 39.99
});
All available properties for purchase:
Parameter | Type | Default | Description |
---|---|---|---|
orderId* | String | (Required) The unique order ID for this purchase. Purchases are automatically deduped by order ID. | |
totalItemQuantity | Integer | 1 | The total number of items in the tracked purchase. |
totalRevenue | Decimal | 0.00 | The total value of the tracked purchase. |
Manage tracking cookies
To suppress tracking cookies for the current user, add the function below.
** Note: This does not affect the email tracking authorization for the contact. Only clickstream tracking will be disabled.
DlvTracking.track('disable');
To re-enable tracking cookies for the current user, add the function below. If the user already has tracking cookies enabled, this tag has no effect.
DlvTracking.track('enable');
Test your clickstream tracking service
It is important to test page visit tracking and purchase tracking (if applicable) after the clickstream JavaScript is added to your pages. If issues arise, our customer support team can be contacted for assistance.
Tips for testing clickstream tracking
- Create a campaign that includes hyperlinks to web pages that contain the clickstream JavaScript.
- Send to a segment of internal email addresses who will test the campaign.
- Click hyperlinks in test campaign received.
- Navigate to other pages on your site to collect activity.
- Review reports within your account to verify that clickstream data has been tracked.
- For purchase tracking testing, a purchase MUST be completed.
Updating Your Cookie Notice After Implementing Clickstream
Tracking is made possible by dropping a cookie on the subscriber's browser. After implementing the Clickstream javascript on your website you may want to consider updating your general privacy and cookie notices. To assist in that, we've provided the following:
- The "name" of the cookie
- A brief description of the cookie's functionality or the functionality it enables.
- The retention period of the cookie
Clickstream Cookie Information
- dlv-emuid - email contact id GUID - retention period is 1 year
- mid - email contact id INTEGER (legacy) - retention period is 1 year
- dlv-smuid - sms contact id GUID - retention period is 1 year
- dlv-auid - anonymous user contact id GUID - retention period is 1 year
- dlv-issms - whether the contact is for email or sms (legacy) - retention period is 1 year
- dlv-mlid - mailing id INTEGER - retention period is 1 browser session
- ml - mailing id INTEGER (legacy) - retention period is 1 browser session
- dlv-suid - session id GUID - retention period is 1 browser session
Comments
0 comments
Article is closed for comments.