Knowledge Center next icon Configuration - First party data collection
Nov 01, 2022
5 minutes read

Configuration - First party data collection

Product

  • Mobile Marketing Cloud

    • TraceDock

Resolution

First-party data collection

To properly configure TraceDock's First-party data collection, you have to configure:


Step 1: Cookie extention

Extend all first-party cookies by adding them in the TraceDock user portal.

All cookies of users using Safari's Intelligent Tracking Prevention (ITP) will be extended to the expiration date as set by your cookie policy, or up to 180 days. This means that if a user consents to place cookies, they can return to the website for up to this period (or a maximum of 180 days) for TraceDock to recognize their visit.

In the TraceDock user portal you can select all the cookies you want to extend:

blob

In the TraceDock user portal you select which cookies to extend

By default, the cookie _ga has been added to the implementation. This cookie contains the persistent clientID on which Google Analytics runs.

You can add any cookie, as long as the value in the cookie is designed to contain a persistent id.

What are cookies with Persistent IDs?

It is only useful to extend cookies containing Persistent IDs. These are cookies that have a client or user identifier that is used to track a user. It realizes this by sending over the value of this cookie with each pageview of event. With this technique the server knows which pageviews and events came from the same client and can attribute the events properly.

How to identify which cookies to extend

Determining which cookies to extend and protect against the consequences of ITP is important in deciding which cookies to add to the TraceDock configuration.

Checking which cookies to protect can be done in the Storage Tab of the Developer tools.

  1. Open up Safari developer tools as per this instruction.

  2. Navigate to the Storage tab (top menu) and open the Cookies tab (left menu).

  3. Within the Cookies overview of your domain you will find all cookies, the_Expires_ column shows which date these cookies expire.

blob

Storage Tab in Safari: See which cookies you can extend

You will notice that the Expires date is set either 24 hours or 7 days depending on if the session is deemed "commercial". More information on this topic can be found in the Deep Dive: How does TraceDock extend the cookie lifetime to 180 days?.

Which cookies you should not extend

Note that not all cookies should be extended. There are two examples:

  1. Cookies that are designed to only last 24 hours. For example the Google's _gid cookie contains data around page speed calculations. In order for Google to properly manage this service, you should not extend the lifetime of this cookie.

  2. Some cookies contain state information. Such as Criteo's cto_bundle is designed to contain session-specific state information. Extending this cookie will lead to reduced attribution by Criteo.


Step 2: Forward client-side events

Adding client side events can be done in the TraceDock user portal.

All configured client side events will be forwarded in case the user has tracking prevention that blocks Google Analytics from working. This can either be an ad blocker or a browser such as Firefox or Microsoft Edge.

Add your Google Analytics Property ID

First, add your Google Analytics Property ID. This ID can be found in the admin section of your Google Analytics and starts with "UA-".

Adding Ecommerce events

TraceDock works with Enhanced Ecommerce through DataLayer out of the box.

To add a new event, click on the button “new event” and choose one of the pre-composed templates. We advise to add the ImpressionsDetail and Purchase.

blob

Add new events in the TraceDock user portal

Adding a custom dataLayer event

You can also configure your own custom dataLayer event. Add a "new event" and choose Other dataLayer.

Conceptually, TraceDock listens to the window.dataLayer in a similar fashion as Google's TagManager. If an object fulfils certain conditions this information is mapped into a format that Google Analytics understands and forwarded if the user has employed tracking prevention.

The following steps can be done to implement client-side events:

  1. Copy an example Raw data event from the dataLayer. The dataLayer object is an array, consisting of multiple data layer events. Select the index which you are interested in using the javaScript code td.copyDataLayer(<idx>), and copy the code to the TraceDock portal.

  2. Determine the conditions. These are the triggers based on the object you just copied. Make sure they are generic and will fire correctly on each page with this event.

  3. Determine the outbound data to Google Analytics. Select a predefined (ecommerce) template, and map out all the fields to the specification set by Google Analytics. You can do this visually in the editor.
    Use the preview mode to verify if you are happy with your matched data.

To test if your new event is coming through: click on the three dots icon ••• to check if that event becomes visible in the Live events page of the TraceDock user portal.

Alternative dataLayer name?

By default the dataLayer is attached to the window.dataLayer object. Some website have an alternative name, such as when they implemented Taelium. If this is the case for you, contact us and we can modify the name for your website.

Publishing changes

After you save a client-side event, you will notice that you can publish your changes. The TraceDock user portal keeps track of all updates that you perform. Only after you publish, the changes will be built into a new plugin for your website.

blob

Where to publish your changes in the user portal

group icon
Get support

Can’t find the answer you are looking for?
Ask for the help of our chatbot, or get in touch with our support team.

Contact Support
Is this region a better fit for you?
Go
close icon