Tag sequencing

Specify tags to fire immediately before or after a given tag on web containers.

Tag sequencing (also known as "setup and cleanup") enables you to specify tags to fire immediately before or after a given tag. This setting is available in web containers, and may be applied to any tag configuration from Advanced Settings → Tag Sequencing.

Setup

A setup tag fires before the main tag. To specify a setup tag, check the box "Fire a setup tag before tag B fires" and then select the tag you wish to use from the menu. Check the "Don't fire Tag B if Tag A fails" checkbox if you wish to have the main payload tag only fire when the setup tag fires successfully.

Developers must use google_tag_manager[{{Container ID}}].dataLayer.set() to change data layer values from the setup tag. You need to use .set() instead of .push() because the .push() won’t get recognized by Google Tag Manager until the following event. Using .set will allow the event to be captured by the current event.

Cleanup

A cleanup tag fires immediately after the primary tag has fired. To specify a cleanup tag, check the "Fire a cleanup tag when tag B is finished" checkbox and select the tag you wish to use from the menu. Check the "Don't fire Tag C if Tag B fails" checkbox if you wish to have the cleanup tag only fire when the main payload tag fires successfully.

Was this article helpful?
How can we improve it?