Skip to main content

Add the Dotdigital Tag to your website

Seamlessly integrate Dotdigital scripts with your site.

Laura Russell avatar
Written by Laura Russell
Updated over 2 weeks ago

The Dotdigital Tag streamlines the process of connecting your website activity and data to our platforms.

You can use a single implementation of the Dotdigital Tag to track:

  • Website views

  • User identification

  • Products browsed

  • Cart updates

  • Purchase completions

  • Custom events, as defined by you
    Custom events in Dotdigital are only available on our CXDP package.

You can also use the Tag to enable Dotdigital Chat.

Learn more about Chat.

For joint customers of Dotdigital and Fresh Relevance, you can use the Dotdigital Tag to make your tracking data available across both platforms.


Before you start

Things you need to know:

  • Abandoned cart and browse functionality requires some additional customisation.

  • You must first create and activate your abandoned cart and browse programs to be able to select them when configuring the Tag.

  • If you are currently using our legacy tracking methods, you can update your site to use the Dotdigital Tag.


Create your Dotdigital Tag

  1. In Dotdigital, go to Connect, then select Connect website.

  2. Select NEW CONNECTION.

  3. Enter your website name for this connection.

  4. In the Domains field, enter each domain that you want to track on a new line.
    Don’t include https:// or www..

  5. Select SAVE.

Tracking subdomains

Subdomains of a specified parent domain are automatically tracked, so you don’t need to specify them separately; a single session can include activity on the parent and subdomains. For example, if you add example.com, the tag automatically tracks blog.example.com and shop.example.com.

If you want to track activity for a specific subdomain only, list it without the parent domain.

For example, if you only want to track blog.example.com and not the entire example.com domain, you can list blog.example.com directly.


Dotdigital Tag connection settings

  1. Set Enable Web behaviour tracking to YES to track your site visitors’ browsing behaviour.
    To enable abandoned cart and browse, you must make some customisations to the Tag. Learn how in Extend the Dotdigital Tag for abandoned cart and browse.

  2. Set Enable Chat to Yes to embed the Chat widget on your site.
    This feature allows you to offer one-to-one customer support through a two-way chat on your site. Learn more in Get started with Chat.

  3. If you want to make tracked data available in Fresh Relevance, set Enable Fresh Relevance to Yes.
    This is only available when you have a live Fresh Relevance account connection. If you’re interested in beginning to use Fresh Relevance functionality, contact your Customer Success representative.

  4. To enable one-click publishing and automatic updates to Surveys, pages, and forms popups, set Enable popup publishing to Yes.
    Learn more in Add a popup to your site.

Abandoned cart

Before you start

  • The settings below apply only if the cartInsight script on your site doesn’t already include ProgramID and CartDelay. If those values are present, they take priority, and the abandoned cart settings configured within Dotdigital are ignored.

  1. Expand the Enrol abandoned carts to drop-down menu and select your abandoned cart program.

  2. Expand the Enrol abandoned carts after drop-down menu and select the delay period.
    This is the length of time between the cart being abandoned and the contact being enrolled on the program.

Testing and live delay recommendation

If you choose No delay, we try to enrol the contact as soon as an active cart is received. This can be useful when testing the abandoned cart automation. However, in an active program, we recommend adding a minimum delay of 30 minutes.

Abandoned browse

The abandoned browse trigger lets you enrol contacts directly after they visit your website. It works for regular page visits, as well as product detail pages.

A session is considered abandoned or expired after 35 minutes of inactivity. If you don’t select any delay, the system enrols the contact 35 minutes after the last page load. It's important to keep this in mind when testing the automation.

If you want to focus only on contacts who visited product details pages, you can create a segment to identify those contacts where the pages browsed include data for the field product_name, and then add a decision node to your abandoned browse program to exit contacts not in the segment.

  1. Expand the Enrol abandoned sessions to drop-down menu and select your abandoned browse program.

  2. Expand the Enrol abandoned sessions after drop-down menu and select the delay period.
    This is the length of time between the browsing session being abandoned and the contact being enrolled on the program.

Advanced settings

  1. Set Require cookie consent to Yes to ensure cookies are only stored on a visitor’s browser after consent is given.

    You can use the following methods to integrate this feature with your existing cookie management system:

    • To deny consent: ddg.setCookiesConsent(false);

    • To grant consent: ddg.setCookiesConsent(true);

  2. Set Enable guest carts to Yes to create a contact in Dotdigital for visitors who abandon a cart but are not yet contacts in your account.
    You must ensure you have collected the necessary consent before sending any marketing communications to these contacts.

  3. Set Track order insights from purchaseComplete events to Yes to create an order Insight record for each purchaseComplete event tracked by the Tag.

    This is only recommended if you aren’t already syncing your order data to Dotdigital through another method.

  4. Select SAVE to confirm your configuration.

Regulatory settings for guest carts

We strongly recommend leaving your Regulatory settings on Enforce double opt-in for signups from signup forms and some API methods only (default). If you enforce double opt-in for all signups, then we don't recommend using abandoned cart emails for guests, as the process won't work correctly.

Implement custom values

You can enhance your data collection by including more than the default information. This allows you to gather additional details that can be used in segments or automations.

To achieve this, you can submit custom page values with each page request.


Deploy and test

  1. Select VIEW CODE to see the Tag that has been generated for your account.

  2. Select COPY TO CLIPBOARD.

  3. Paste your Connection code onto each page of your website, before the closing </body> tag.

You can install the Dotdigital Tag through a tag manager if you want to.

Test the installation

  1. Select TEST to check the installation of the Dotdigital Tag, and enter a URL to test.

  2. Select TEST again to check that the Tag is correctly installed on the specified page.

If there are any issues with the installation, you see a message with information about the error and the steps to take to fix it.

After you have saved your connection and added the Dotdigital Tag to your site, it may take some time before you start seeing traffic data in WebInsights. You can expect to see data populate within about an hour, depending on the amount of web traffic your site receives. This built-in delay ensures that the data is accurately captured and processed.

If you don’t see any data after a few hours, check that the Tag has been correctly added to your website and that it’s not being blocked or affected by any other scripts running on your site.

For further assistance, contact our Support team.


Edit the tag

To make any changes to the configuration of the Dotdigital Tag:

  1. Go to Connect > Connect website.

  2. Select the Edit icon for the Tag you want to make changes to.

  3. Make the desired changes, then select SAVE.

These changes are automatically pushed to the published Tag on the domains specified.

Did this answer your question?