Technical guide: How to insert the tracking script into your store

To use OnSite Marketing, On-Site Behavior Automations and Push Notifications, you need to install the tracking script on your website. There are three ways to do it. The easiest is through an integration, because in most cases the script is installed automatically. You can also use Google Tag Manager or install it manually. We walk you through each option step by step.

Option 1: Through integrations

If your Doppler account is integrated with Shopify, Adobe Commerce, Easycommerce, PrestaShop or WooCommerce, the script is installed automatically when you integrate your store. You don’t need to do anything else.

If you use Tiendanube: first integrate your store with Doppler, then follow the steps in Option 2 to install the script with Google Tag Manager.

Haven’t integrated your store yet? Here’s how:

Option 2: With Google Tag Manager

If you don’t know HTML, Google Tag Manager lets you insert the script without editing your website’s code. If your store runs on Tiendanube, this is the option you need. We show you how, step by step.

Important: these instructions assume you’ve already set up Google Tag Manager on your website. Learn how to do it if you haven’t yet.

1. Go to Google Tag Manager and sign in to your account.

2. Create a trigger to use later in your tag. In Workspace, select Triggers and click New.

Google Tag Manager Triggers section with the New button

3. A pop-up opens to set up the trigger. Add a title and click the gray circle to choose the trigger type.

Trigger configuration with the title field and the gray circle

4. In the new pop-up, choose the DOM Ready trigger type.

List of trigger types with the DOM Ready option

5. Click Save to create the trigger.

Configured trigger with the Save button

This is how it looks in the Triggers section:

New trigger in the list of triggers

6. Now create a tag. Select Tags in the left menu and click New.

Google Tag Manager Tags section with the New button

7. Another pop-up opens. Add a title to your tag and click the gray circle to set it up.

Tag configuration with the title field and the gray circle

8. In the menu on the right, select Custom HTML.

Menu of tag types with the Custom HTML option

9. Insert the Doppler tracking script:

Doppler tracking script

This is how it looks once you add it:

Custom HTML tag with the tracking script inserted

10. On the same screen, set up triggering at the bottom. Click the gray circle, choose the trigger you created earlier and click Save.

Tag triggering section with the trigger selected

11. When you’re done, you see your tag created and set up.

New tag in the list of tags

12. To publish your changes, click Submit.

Submit button in the Google Tag Manager workspace

13. In Publish and Create Version, enter a name for the version and click Publish.

Publish and Create Version pop-up with the version name and the Publish button

If you use Tiendanube, complete these steps

1. Copy your container’s GTM-ID. You’ll find it at the top of your workspace, in the format GTM-XXXXXXX.

GTM-ID at the top of the Google Tag Manager workspace

2. In your Tiendanube admin, go to Configuración and open Códigos externos.

Códigos externos section in the Tiendanube admin settings

3. Paste your GTM-ID and click Guardar.

Google Tag Manager field with the GTM-ID pasted and the Save button

4. In Doppler, go to Integrations > Tiendanube.

5. Turn on the Tracking script set up switch and click Save.

Tiendanube integration in Doppler with the Tracking script set up switch turned on

That’s it, tracking with Google Tag Manager is now active.

Option 3: Insert the script in your website’s HTML code

We recommend this option if you have programming knowledge, because it requires editing your website’s HTML code.

1. Add this code in the <head> section:

Code for the head section

2. Add this code before the closing </body> tag:

Code to insert before the closing body tag

You can also include the code in a JS file (for example, footer.js) like this:

Code included in a JS file

Important: make sure the DOM is ready before the code loads. Include it on every page where you want to track your visitors’ activity. To avoid conflicts, make sure the script doesn’t include third-party libraries (for example, jQuery).

Now that your script is installed, learn how to create an On-Site Behavior Automation.

Any questions? Write to us at [email protected] and we’re happy to help. 💛


Was this article helpful?
Help us improve our assistance by rating it

Leave a Reply

Your email address will not be published. Required fields are marked *

Your comment was successfully sent!



Doppler informs you that the personal data that you provide to us when completing this form will be treated by Doppler LLC as responsible for this web.

Purpose: To allow you to make comments in our help center.

Legitimation: Consent of the applicant.

Recipients: Your data will be saved by Doppler and Digital Ocean as hosting company.

Additional information: In the Doppler Privacy Policy you’ll find additional information about the collection and use of your personal information by Doppler, including information on access, conservation, rectification, deletion, security, cross-border data transfers and other issues.