Add snippet script code to Google Tag Manager

In this video, we’ll show you where to find your Retention snippet script code and how to add it to your Google Tag Manager.

Where to find your Retention snippet script

1. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>. You’ll see a green box in the top right-hand corner telling you the code was copied to your clipboard.

Copy Collection

Remember: You can’t check multiple boxes for scripts or you will get an error message. You can only copy one at a time.

3. Once you’ve added the script to your domain, go back to Code Script and click the edit icon next to Authorized Domains.

4. Paste the domain/URL in the text box where you added the script, and click Save Changes.

It will be highlighted in green if the script is properly installed—and in orange if the script is not properly added.

How to add snippet script:

1. Log in to Google Tag Manager. Click New Tag.

2. You can give the tag a title at the top. Click the pencil image in the Tag Configuration section.

3. Click Custom HTML under Custom.

4. Paste your Retention script into the HTML box.

5. You will need to choose a trigger at the bottom to make the tag fire. Click the pencil icon in the Triggering section.

6. Choose a trigger, such as page views on all pages.

Note for SPA/React sites: You should set your Triggers for All Pages as seen above, as well as All History Events:

7. Once you have chosen a trigger, click Save in the top right.

8. From your Retention dashboard, click On next to Script Status to turn your script on. You will have access to this once you finish the onboarding process.