While we suggest using the prebuilt GTM Container for setting up all the tags, triggers, etc within your GTM container, this article provides details about what is in that container and how you could go about creating the items manually. This article does reference some items from the article for installing with the preconfigured template which can be found here.
Triggers
Triggers are the actions taken by the visitor that will fire the events. A trigger will need to be created for each event that you want to be raised to GTM. In addition to Ticketure, you may have other eCommerce or website actions that could leverage these triggers, so for this example, we are going to show how to define a trigger to ONLY execute when Ticketure fires the action.
To create a Trigger, within the GTM Console, click on Triggers from the left menu and click New. Click within the 'Trigger Configuration' section to bring up the list of Trigger Types. Scroll down and select the Custom Event trigger type. Create a Trigger for each of the events that you are wanting to trigger to GTM using the event name above as the Event Name for the trigger.
Trigger Type | Event Name | Trigger Fires On: Event contains |
Custom Event | view_item | view_item |
Custom Event | add_to_cart | add_to_cart |
Custom Event | remove_from_cart | remove_from_cart |
Custom Event | begin_checkout | begin_checkout |
Custom Event | purchase | purchase |
History Changed | N/A | Visitor views a page |
To have these events ONLY trigger for Ticketure events, add an additional parameter of Page Host Name contains tickets.myorg.com (replace with your site).
Example of add_to_cart Trigger with the event name and trigger Fires on details highlighted. Note the 'Use Regex Matching' is enabled (best practice).
Tags
Tags are where all the things above come together and control what GTM is communicating to Google Analytics, but also to any other marketing/tracking system, you may be using (ex: Facebook, Instagram, Hubspot, etc). Just as with the other configurations, we will be defining a tag for each Event (outlined above) that we want to have pushed to Google Analytics. Each tag is fired by a Trigger and sends any defined Variables on the tag to Google Analytics.
In addition to each Event we want to raise, we will also need to ensure that the GA4 configuration tag is sent first thing and tells Google Analytics the Measurement ID (noted from Google Analytics Data Stream setup) that we are wanting to post to.
GA4 Configuration Tag
To create the Configuration tag, within the GTM Console, click on Tags from the left menu and click New. Click within the 'Tag Configuration' section to bring up the list of Tag Types. Select the Google Analytics: GA4 Configuration tag type.
Enter the Measurement ID from the Web Data Stream, expand the Advanced Settings and set the tag firing priority to 10000 to ensure that this tag fires first when multiple tags are being fired.
Note the name of this Configuration Tag as it will be needed in the next step.
Ticketure Event Tags
Similar to the setup of the GA4 configuration tag, within the GTM Console, click on Tags from the left menu and click New. Click within the 'Tag Configuration' section to bring up the list of Tag Types. Select the Google Analytics: GA4 Event tag type.
Example of add_to_cart Tag
- Configuration Tag - The name of the Configuration Tag (defined in the step above)
- Measurement ID - This is the Analytics Stream ID (in this example we have it as a predefined variable - but you can paste your Stream ID directly if desired).
- Event Name - The name of the Event that is to be raised to Google Analytics (ex: add_to_cart)
- More Settings/Ecommerce - Send eCommerce Data (sends the item data to analytics)
- Triggering - The Trigger defined for this specific Event
Once you define the first tag, you can use the 'Copy' feature (located in the 3 dots near the Save button) to copy the tag. From there change the Event Name, and Trigger for each of the Events.
Comments
Article is closed for comments.