Tag sequencing enables you to specify tags to fire immediately before or after a given "primary" tag is fired. This setting is available in web containers, and may be applied to any tag configuration from Advanced Settings Tag Sequencing.
Setup: Load a tag before your tag fires
A setup tag fires before the primary tag. To configure a setup tag:
- Select the "Fire a setup tag before <this tag> fires" checkbox. Note: "<this tag>" will be replaced by the title of the current tag.
- Select the tag you wish to use from the menu.
- Optional: Select the "Don't fire <this tag> if <setup tag> fails" checkbox if you wish to have the main payload tag only fire when the setup tag fires successfully. " Note: "<setup tag>" will be replaced by the name of the tag selected in step 2.
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: Load a tag after your tag fires
A cleanup tag fires immediately after the primary tag. To configure a cleanup tag:
- Select the "Fire a cleanup tag when <this tag> is finished" checkbox. Note: "<this tag>" will be replaced by the title of the current tag.
- Select the tag you wish to use from the menu.
- Optional: Select "Don't fire <cleanup tag> if <this tag> fails" if you wish to have the cleanup tag only fire when the primary tag fires successfully. Note: "<cleanup tag>" will be replaced by the name of the tag selected in step 2.