How to set up a Tag
Once you have a Google Tag Manager account, you can create your first tag. You can create unlimited configurations of tags in Google Tag Manager. Now, let’s check out how to set up a tag:
Step 1: Within your Google Tag Manager dashboard, go to Tags and click the “Add a New Tag” button
Step 2: Enter your tag title, and then click on “Tag Configuration” box to choose “Google Analytics - Universal Analytics”
Step 3: To your tag be tracked in Google Analytics, you will need to input your Web Property ID that found in your Google Analytics account. Then, select a “Track Type”, for example, “Page View”. In Google Analytics Settings Variable drop-down, choose New Variable
Step 4: Next, choose a trigger (a trigger means when you want the tag fired). You can choose “All Pages”. This means every time someone views any of your web pages, this tag recorded
Step 5: Once you have the information in the “Tag Configuration” and “Triggering” boxes, click the “Save” button, then click the “Submit” button
Step 6: After clicking “Submit”, you’ll be taken to this “Submission Configuration” page. There are two options: “Publish and Create Version” or “Create Version”, select one of two options and then click the “Publish” button in the top right.
Step 7: Finally, you can add a name and description for more details about tag in “Container Version Description”. Now, you’ve successfully created your first tag.
In summary, by completing these steps you’ve instructed Google Tag Manager:
- to track website visitors with GA (that’s a tag)
- to fire that tag on all pages (that’s a trigger)
- to send the data to a particular Google Analytics account
How to create a variable in Google Tag Manager
Variables act as a central location to configure sets of Google Analytics settings for using across multiple tags. Let’s check out how to create a variable below
Step 1: Click “Variables” on your Google Tag Manager homepage. Under “User-Defined Variables”, click “New”.
Step 2: Name your variable, then, click the “Variable Configuration” box. If you don’t want the ID to change for different tags, choose “Constant” as your variable type.
Step 3: Now, input your Google Analytics Tracking ID number into the “Value” box, and then select “Save” in the top right.
Testing with Preview and Debug mode
Google Tag Manager lets you test your tag to make sure that everything is configured properly via GTM Preview and Debug. Navigate to the site where the Google Tag Manager container code is implemented, you will see a debugger pane at the bottom of your browser screen. You can see detailed information about your tags, which tags fired and what data is being processed.
To enable Google Tag Manager Debug mode, click “Preview” button in the top right corner of your GTM interface
Note: This debug window will only appear on your screen as you preview the site, and is not visible to your other website visitors. So nobody is affected until you publish all the changes to the live site.
In addition, to see if your Google Analytics tag has successfully fired, you can click “Page View” event on the left side of the console. However, to make sure that Page View actually reached Google Analytics, you need to double-check in Google Analytics. The tag fired doesn’t mean that data was actually sent. In case you configure the tag incorrectly, it can send page views to the wrong GA account.
In Google Analytics, go to Real-time > Overview. Navigate through various pages of your website and see if all those page views are displayed in real-time reports.
Another useful tool you should try to check the status of tags is Google Tag Assistant. It is a Chrome extension which reports on various Google tracking scripts and checks if they are properly configured (like Google Ads, Google Analytics, Google Optimize, etc.)
Publishing the Container
After having finished configuring and testing tags/triggers/variables, click the “Submit” button. Once you hit the “Publish” button in the top right corner, your changes will go live and you will start tracking page views of visitors.
You have two options here:
- Publish all changes live to your website visitors (and automatically create a version)
- Or just create a version. Changes won’t go live to the website visitors but you will have a saved checkpoint to which you can later restore the container (if something bad happens).
Hope you find this post informative