How to upgrade to Distil tracking code version 2.0

  • Updated

On 17 June 2026, Distil released tracking code version 2.0, which  introduces an updated tracking configuration with two parts:

  1. Session-persistent attribution tracking
  2. Cookie-dependent event tracking

This article explains what changes in version 2.0 and how to update an existing Distil tracking code installation.

Distil Tracking 1.0 still active

The existing Distil tracking code will continue to work if no update is made.

No immediate action is required to keep existing Distil Tracking active. 

Existing implementations will continue to send tracking data to Distil, however, updating to version 2.0 is recommended to support the latest tracking configuration and maximise visibility of user activity.

What changes in version 2.0

Version 2.0 separates Distil Tracking into two parts.

Step 1 - Session-persistent attribution tracking

The first part of the tracking code is stored in the browser’s local storage and is session-persistent.

This part does not capture personally identifiable information. It captures the first referrer URL, which allows Distil to retain marketing source information, such as the channel or platform that first referred the visitor.

If the visitor later accepts tracking cookies, this stored marketing information can be connected to subsequent tracked activity.

Step 2 - Cookie-dependent event tracking

The second part of the tracking code is deployed after cookie acceptance, and is the same as Distil 1.0. No changes have been made to this part of the tracking code. 

This part captures configured tracking events, such as page views, customer identification, product views, content views, orders, and custom events.

Cookie consent should be respected when deploying Distil Tracking. Visitors should have the option to decline tracking.

How to update

The update process depends on how Distil Tracking is currently installed.

Distil Tracking may be installed through:

  • Google Tag Manager
  • Direct website or app installation
  • Another tag management or consent management platform

Where to find Distil Tracking 2.0 Script

To complete the update, install step 1 from the Distil Tracking 2.0 code.

Go to: Settings > Tracking > Bespoke JS in your Distil account.

The version 2.0 tracking code contains two parts. Both parts must be added for the latest tracking configuration to work as expected. If you already have Distil tracking installed, you can skip part 2. 

Step 1 should load before cookie acceptance (new script)

Step 2 should load only after tracking cookies have been accepted (current script).

If Tracking is installed through Google Tag Manager

If Distil Tracking is installed through Google Tag Manager, add the new step 1 script to your GTM container.

For full setup guidance, see Tracking Setup: Google Tag Manager.

If Tracking is installed directly on a website or app

If Distil Tracking is installed directly in the website or app codebase, add the new step 1 script to your platform, ensuring it is the first line of code in the header. 

The existing Distil event calls should continue to work. These may include:

  • distil.trackPage()
  • distil.identifyCustomer()
  • distil.trackProduct()
  • distil.trackContent()
  • distil.trackOrder()
  • distil.trackEvent()

Do not remove existing event calls unless the tracking implementation is also being changed.

For full setup guidance, see Tracking Setup: Distil Tracking Code.

Test the update

After the version 2.0 tracking code has been added, test that:

  • the website or app loads without JavaScript errors
  • the first part of the tracking code loads before cookie acceptance
  • the second part of the tracking code loads only after tracking cookies have been accepted
  • existing tracked events continue to send data to Distil
  • tracking data appears in Distil after new activity has been recorded

Navigate to Settings < Tracking in your Distil account, and the right hand panel you will see the feedback from Distil.

What happens if no update is made

Existing Distil tracking code will continue to work if no update is made.

Tracking data will continue to be sent to Distil from the existing implementation.

However, the installation will not use the latest version 2.0 tracking configuration. This means session-persistent attribution tracking may not be available in the same way as the updated version.

Updating to version 2.0 is recommended when development or tag management changes can be scheduled.

Was this article helpful?

Comments

0 comments

Article is closed for comments.

Still have questions?

Contact us