Google Tag Manager Tutorial: How to Set Up Google Tags

Written by Coursera Staff • Updated on

Learn how to set up Google Tag Manager, a free, online tool for tracking online activity.

[Featured image] A person wearing a pink blazer sits at their desk, setting up their Google tags.

Key takeaways

Google Tag Manager helps you collect data you can use to determine what brings visitors to your website and the actions they take while visiting. 

  • After creating your Tag Manager account, install the container and configure your tags. Once you confirm that they work, you’ll be ready to click Publish.

  • Track what videos website visitors play, the links they click, and the files they download. 

  • You can use Google Tag Manager to create heat maps, a data visualization tool that helps make sense of the information. 

Learn how to set up your account to analyze Google products or various third-party services. Afterward, consider enrolling in the Google Digital Marketing and E-commerce Professional Certificate to continue honing your skills. This beginner-friendly eight-course series lets you learn at your own pace, giving you an opportunity to master the fundamentals of e-commerce and digital marketing. 

Google Tag Manager tutorial for beginners: What can you do with it?

Creating a Google Tag Manager account in Google Analytics can help you collect valuable information about your website. Using tags, you can track where people come to your site from and what they do once there. These tracking activities include scrolling, PDF file downloads, link clicks, and video plays. You can also generate heat maps or monitor form submissions. 

Google Tag Manager Tutorial: How to set it up

This quick summary outlines the steps you’ll take to set up Google Tag Manager:

  1. In Tag Manager, create a new account and container.

  2. Install the container.

  3. Configure your tags.

  4. Confirm your tags work.

  5. Publish your tags.

Let’s take a more detailed look at each of these steps to help you manage your tags.

Step 1: In Tag Manager, create a new account and container.

To begin, in Google Tag Manager (GTM), click on the Create Account button to create a new account and container.

First, you will set up the GTM account by naming it and selecting the country for the account from a drop-down menu.

At this point, you can also choose to share data anonymously with Google and others. If you check the box to allow sharing, your data, scrubbed of identifiers, gets added to Google’s benchmarking metrics.

Next, you enter a descriptive Container name to help you differentiate between this and other containers. Choose the target platform on which you will use your tags, which could be a website, Accelerated Mobile Page (AMP), Android or iOS app, or a server. 

Select your target platform, click Create to create the account and container, and agree to Google’s terms.

Note: To collect metrics from multiple platforms, you’ll need to create containers for each one.

Step 2: Install the container.

Your new container will load with a different dialog box according to the type of container you selected. If you are working with web and AMP, you’ll see the installation code for your website.

Paste the provided code snippets into your website or AMP. You’ll put the first code snippet, which reads <script>, as close to the opening <head> tag as you can. As long as it’s below any dataLayer declarations.

Put the second <noscript> code snippet after the <body> tag on your web pages.

Note: For iOS and Android, you get a link to the developer documentation. If you select the server platform, you can provision that automatically or manually. If you do not feel confident installing code on your own, consulting with a developer is a good idea.

Step 3: Configure your tags.

Clicking OK in the code snippet dialog box will take you to your GTM workspace. There, you can set up your tags. Click on Add a new tag.

On the next screen, you’ll name your tag. Then, you’ll be asked to configure the tag and set up triggers. Let’s start with Tag Configuration. Click on Choose a tag type to begin setup… to see a sidebar menu of tag options. These options include Google products and third-party tags.

You’ll need to enter information to configure your selected tag type. For example, for Google Analytics GA4 Configuration, you’ll provide your Google Analytics tracking code as the Measurement ID. You’ll be given the tracking code when you set up your Google Analytics account.

Some third-party tag options include:

  • AdRoll

  • Bizrate Insights

  • Crazy Egg

  • FoxMetrics

  • Hotjar

  • LinkedIn Insight Tag

  • Mouseflow

  • Quora Pixel

  • Shareaholic

  • Upsellit

  • Yieldify

Note: Not all tags are supported on all platforms. See Google’s list of supported tags and platform types. More experienced users could also create a custom HTML or image tag.

Triggering lets you define what happens when. Each tag requires at least one trigger to fire. 

For instance, you might set up a tag to fire when a certain page loads or when someone clicks a button.

Clicking on Choose a trigger to make this tag fire… takes you to a new page with options for that trigger. For example, a page view trigger might take you to a screen showing:

  • All Pages

  • Consent Initialization—All Pages

  • Initialization—All Pages

With All Pages, your tag triggers by default on all pages. Use Consent Initialization for tags that set or update your site's user consent settings. Meanwhile, Initialization—All Pages fires any tags that should fire before other triggers.

You’ll find many built-in variables for different trigger types. Plus, you can configure custom variables, too.

Click Save to add your tags.

Read more: E-commerce SEO: How to Drive More Traffic to Your Online Store

Step 4: Confirm your tags work.

Return to your workspace to test your changes. Start by clicking on Preview in the upper right of the dashboard.

Google Tag Assistant launches in a new tab. You’ll enter the URL for the website where you installed the GTM container. Click Connect.

Any errors? Use Tag Assistant to debug. Or you may need to edit a tag. You can click on that tag’s name to change its configurations. For example, you may want a tag to trigger after someone clicks a button instead of after a page loads.

Save any changes, then verify you solved any issues by launching Preview mode again.

Step 5: Publish your tags.

Once you have confirmed your tags work as you intended, you can publish them by clicking Submit at the top right of the screen (beside Preview).

On the Submit Changes screen, next, you can select Publish and Create a Version to push the changes to your site. Otherwise, you can Create a Version to only save changes and create a new version.

Enter a Version Name and provide a Version Description. The more detailed you are in the Version Description box, the more useful this information will be in the future for understanding your version changes.

Click Publish to complete your work on this GTM account, container, and its tags and triggers.

Explore more free digital marketing resources

Whether you’re launching your career or looking for advice for your next campaign, our Career Resources Hub can help connect you with the information you need. You might also consider the following:

With Coursera Plus, you can learn and earn credentials at your own pace from over 350 leading companies and universities. Whether you want to develop a new skill, get comfortable with an in-demand technology, or advance your abilities, keep growing with access to over 10,000 flexible courses. 

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.