Before You Begin
GTM Account and Container setup
These instructions assume that you have already set up a GTM account and container. For more information, please visit https://support.google.com/tagmanager/answer/6103696?hl=en
Let’s Get Started
The first step in tracking GTM is to set up your triggers. Triggers come from the website and are identified by name. The “Next” button click on every page will trigger an event for GTM to capture. Each page will expose a trigger by name. In order to track a particular slide, you will have to get the class name from the HTML within that page. You can use Developer Tools within most browsers to find the class.
Note: This may require some basic HTML knowledge.
- Open the Roofing Ruler.
- Open Developer Tools.
- From the HTML, click on the element selector.
- Click on the Next Button.
- The HTML element that will be highlighted will look something like this:
- The class you’re looking for (highlighted here in red as an example) is the class you will need to track that particular page.
Each page will have a class unique to that slide. Take note of this class, as you will use it in the following sections.
* The one exception is the first slide, which will either be “lite-wizard” or “full-wizard.” This is to differentiate between which path is selected. Any other slide will only have one class that describes that slide.
Google Tag Manager (GTM)
You can choose to track any or all of the pages individually. For example, you may want to know how many steps the user has completed before quitting. You may also choose to milestone events, such as when the user enters their address and uploads a bill.
For any given tracking scenario, the steps are the same.
Creating Triggers in GTM
Steps to create a new Trigger:
- From your Triggers left-hand navigation, click New in the upper right corner.
- Click on Trigger Configuration.
- From the Choose Trigger Type menu, choose All Elements.
- Click on Some Clicks.
- In the Conditions dropdown, choose “Click Classes” and “Contains.”
- For the condition, enter the Trigger Name associated with the screen you wish to capture. For example, I would like to track anyone who invokes the Quick Path. In this case, I will enter “lite-wizard” as the condition.
- Name your trigger any name that you feel would be useful (for example, Quick Path Click).
Now that you have created triggers, you can send those events to any tagging system. GTM will not only support Google Analytics, Criteo, Quantcast, Facebook Pixel, Nextdoor, and Adroll Smart Pixel, as well as many more standard tags, but you can implement your own custom HTML for proprietary integrations. We will discuss here how to implement Google Analytics.
Creating Tags in GTM
Google Universal Analytics
For Google Universal Analytics, you will have to set up a configuration tag to connect to your UA property. Then you will set up a conversion event for each of the events you would like to track. The process is the same for each conversion tag.
Tag Creation
To send events to UA, you will have to create a tag for each trigger. Each tag must use a defined set of 4 fields that in combination represent your conversion. These 4 fields are matched to your UA property in order to create the conversion.
UA Event Tag
To create a UA event tag from the Tags page
- Click New.
- Give your Tag a Name.
- Click Tag Configuration.
- Choose a Tag Type – Click on Google Analytics: Universal Analytics.
- In the Track Type dropdown, select Event.
- The following set of fields is completely up to you. These fields MUST match the same set of fields when you set up the UA conversion. The only requirement is that the combination of the 4 is unique to the conversion. For Roofing Ruler, we advise setting all the same for each conversion except the Label that identifies the specific conversion. Below are some guidance and examples of what values to set:
- Category: Set a category to group these conversions together (e.g., Roofing Ruler)
- Action: The action performed on the site to trigger the conversion (e.g., Button Click)
- Label: The specific name of the conversion (e.g., lite-wizard)
- Value: A conversion value (e.g., 1)
- In the Google Analytics Setting textbox, input the UA tracking ID associated with the GA property.
- In the Triggers section, select the previously created trigger that correlates to this conversion (using the same example, it would be the trigger associated with “lite-wizard”).
- Click Save.
Google Analytics 4
For Google Analytics 4, you will have to set up a configuration tag to connect to your GA4 property. Then, you will set up a conversion event for each of the events you would like to track. The process is the same for each conversion tag.
Tag Creation
To send events to GA4, you will have to create a tag for each trigger. There are 2 components; one is the GA4 configuration tag and the other is the GA4 Event tag. The configuration tag specifies your instance of the GA4 property. This must be created once and can be reused for each event tag.
GA4 Configuration
To create the GA4 configuration tag from the Tags page
- Click New.
- Give your Tag a Name.
- Click Tag Configuration.
- Choose a Tag Type – Click on Google Analytics: GA4 Configuration.
- Name the tag.
- Enter the GA4 Measurement ID.
- Click Triggers.
- Choose All Pages.
GA4 Event Tag
To create a GA4 event tag from the Tags page
- Click New.
- Give your Tag a Name.
- Click Tag Configuration.
- Choose a Tag Type – Click on Google Analytics: GA4 Event.
- In the Select Configuration Tag dropdown, select the previously created GA4 Configuration Tag.
- In the Event Name textbox, give the event a unique name that identifies this conversion. In our previous example, we were tracking when the user selected Quick Path. Continuing this example, we can name this event “Quick Path” (although it can be any name you choose that’s recognizable to you and fits your strategy).
- In the Triggers section, select the previously created trigger that correlates to this conversion (using the same example, it would be the trigger associated with “lite-wizard”).
- Click Save.
Creating Conversions
Now that you have created your tags, the next step is to create conversions. Conversions are created differently in Google Analytics 4 and Google Universal Analytics.
This section assumes you have already created a Google Property.
Google Analytics 4
To create your conversions in Google Analytics 4, you must create a conversion for each event tag created in GTM. The name of the event specified in GTM must match the name of the conversion event in GA4.
From your GA4 property:
- Click Conversions on the left-hand navigation.
- Click the New Conversion Event Button.
- Specify the same name of the event that was specified for the correlating tag in GTM.
Google Universal Analytics
For UA events, you will create Goals to track your conversions. There is a maximum of 20 goals you can create per property. The values for the event goals will be the same correlating values you entered into Tag Manager (Category, Action, Label, Value).
From your Universal Analytics property:
- Click Admin from the left-hand navigation.
- Under View, click Goals.
- Click New Goal.
- Under Goal Setup, click Custom.
- Click Continue.
- Under Goal Description, Name your Goal.
- Choose the Event type.
- Click Continue.
- Under Goal Details, enter the same values for the correlating GTM tag that specified the conversion (Category, Action, Label, Value).
- Click Save.
Testing and Debugging
In order to verify that your conversion will work, you can run a test in Google Analytics. Open both Google Analytics and Google Tag Manager in separate tabs.
Tag Manager debugging
- From Tag Manager, go to your container and click Preview in the upper right corner.
- Put the URL of the solar calculator and click Connect.
- Click through your Roofing Ruler. For each conversion that correlates to a page, you will see that conversion under the Tags Fired section.
Now that you’ve seen that your tags will be fired, the next step is to check Google Analytics to verify that your conversion is recorded correctly.
Google Analytics 4 debugging
- From Google Analytics, click on Debug View.
- Check the Debug View pane for your conversion. If the conversion is recorded properly, the event will be Green.
Google Universal Analytics
For Google Universal Analytics, you will have to set up a configuration tag to connect to your UA property. Then, you will set up a conversion event for each of the events you would like to track. The process is the same for each conversion tag.
The following instructions allow you to set up conversions for the Roofing Ruler. It assumes you already have UA set up.
- From the left-hand navigation, click on Realtime, then click Conversions.
- In the main window, you should see the conversions that have been triggered from Tag Manager within the last 30 minutes.