Notification

G Suite is now Google Workspace: everything your business needs to get work done.

Best practices for trigger configuration

Sometimes triggers, when configured improperly, can yield unexpected results in Google Tag Manager. When you configure triggers, consider the following best practices:

  1. Test your triggers with preview mode: It is important to test form and link triggers before they are published. These triggers can break if another JavaScript event interrupts the process. A common culprit is that another script returns false before the form or link trigger is reached, and the trigger code is skipped. Use Tag Manager's preview mode to test if a tag fires properly or if form data is sent properly.

  2. Test in older web browsers: Older web browsers can have problems with tag behavior. These issues are far less common in modern web browsers. If your product requires support for older browsers, test thoroughly with preview mode before deployment.

  3. Limit the scope of form and link triggers to tested pages: Testing every page on your site can be time consuming. Be judicious in how you configure triggers, and be especially careful with triggers that listen for form submissions or link clicks. Use filters to ensure that your trigger will only fire when specified conditions are met (e.g. "Page Path equals /my/tested/form/page".)

  4. Use Consent Initialization triggers for consent functions only: For tags that aren't specifically used to manage consent settings, use the Initialization trigger instead. The Consent Initialization trigger is designed to help you ensure consent settings are available on your page before any other triggers fire, including any Initialization triggers. Learn more about consent settings.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
16969955474363094362
true
Search Help Center
true
true
true
true
true
102259
false
false