How to integrate Batch's snippet using Google Tag Manager?

You can integrate Batch web push using GTM.

1. Create a tag

Click on "New tag" and select "Custom HTML" as your tag configuration

Two tag creation options are available: the first one is Custom HTML Tag, and the second one is Custom Image Tag.

Paste your Batch snippet in the HTML textbox:

This is the configuration screen for the new Custom HTML Tag. A section named 'HTML' is available for inserting the JavaScript tag code.

2. Define a trigger

The snippet should be triggered on all your website's pages (Select "All pages" as a firing trigger) unless there are subdomains you want to exclude, in which case you should add exceptions.

To add an exception to your tag triggers, you should create a new trigger that will be used as an exclusion trigger.

If you want to exclude all subdomains, use the following condition:

This is the trigger configuration screen for the HTML Tag, where you can choose the trigger type in this case, it's a Page View.

If you want to exclude a list of subdomains, use the following conditions:

Still on the same trigger configuration screen for the HTML Tag, we want the tag to fire on specific pages of the website. We’ve selected only three pages.

Once your exclusion trigger has been created, add it to your tag's trigger settings as an exception:

We're back on the main tag configuration screen, which provides a summary of the defined settings.

That’s it, when you are all set, release the new tag in staging or in production. Make sure you test your integration correctly by following the steps described here: Testing my web push integration.

Last updated

Was this helpful?