First-party data collection
To properly configure TraceDock's First-party data collection, you have to configure:
- Step 1: Cookie extension: Extend all first-party cookies for users using Safari
- Step 2: Forward client-side events: Configure the events that will be forwarded to Google Analytics for users with (ad blocking) tracking prevention
Step 1: Cookie extention
Extend all first-party cookies by adding them in the TraceDock user portal.
In the TraceDock user portal you can select all the cookies you want 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.
Open up Safari developer tools as per this instruction.
Navigate to the Storage tab (top menu) and open the Cookies tab (left menu).
Within the Cookies overview of your domain you will find all cookies, the_Expires_ column shows which date these cookies expire.
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:
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.
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.
Are you unsure if the tool you are using contains a cookie worth extending? Contact our support team on [email protected] and they will help you out.
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 Impressions, Detail and Purchase.
If this is not the case for your website(s), email us on [email protected] for help. We can assist in implementing (nearly) all dataLayer events that are required to measure your conversion.
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:
td.copyDataLayer(<idx>), and copy the code to the TraceDock portal.
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.
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 [email protected] and we can modify the name for your website.
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.