51视频

Everything you need to sell online

Set up an online store in minutes to sell on a website, social media, or marketplaces.

How To Use Google Tag Manager: Analysing Data, Adding Tags, and Avoiding Mistakes

15 min read

(GTM) is a free tag management system that lets you create and add tags to your website while coordinating with your team. If you鈥檙e not using GTM, starting an account is a great way to improve your website and enhance your marketing through data. Here are the basics of how to use Google Tag Manager.

How to sell online
Tips from e-commerce experts for small business owners and aspiring entrepreneurs.
Please enter a valid email address

What Does Google Tag Manager Do?

GTM is a tag management system. The platform is designed to be the hub of your tag management — helping teams manage existing tags and create new ones. If you鈥檙e not familiar with GTM at all, check out our guide to what GTM is and why you should use it.

Before moving on to actually using GTM, let鈥檚 do a quick refresher of a few important terms.

  • Tags — Tracking codes that compile data based on user interactions.
  • Triggers — User interactions that make tags fire.
  • Containers — Collections of tags, triggers, and other configurations installed on your website or mobile app.

How to Setup Google Tag Manager

With the basics of GTM out of the way, let鈥檚 get into actually using the platform.

Before you do anything else, you鈥檒l need a few accounts ready to go.

Google accounts and a GTM account

The personal or work Google account you probably already own is required to use GTM, but you鈥檒l also need a separate GTM account. You鈥檒l connect your account and the accounts of your team with your new GTM account so you can manage tags all in one place.

  1. Make a standard/personal Google account
  2. Make a GTM account
  3. Connect your standard account to GTM

Google allows up to 360 users to be added to a single GTM account. Account administrators can add, remove, and manage users under the Admin page. Adding new users is as simple as entering their email addresses and following the on-screen instructions to set account permissions. Then just click Invite and the users will get an email letting them join the GTM account. If you need multiple administrators on a single GTM account, you can select admin permissions when you invite a new user.

Setting up your GTM account

Making a GTM account is easy. First, go to  and click Create Account in the upper right corner of your screen.

Google Tag Manager

Create a new Google Tag Manager account

Next, you鈥檒l be asked to enter some basic info:

  • Account name
  • Country
  • Container name
  • Target platform

Unlike your personal Google account, your GTM account name should usually be your business or website name. Next, enter the country you鈥檙e based in, then create a name for your first container. This will be the first container your account has, but you can create up to 500 in total. Finally, enter your target platform. GTM supports websites, iOS and Android, and AMP.

(Note: we鈥檒l just be referring to “websites” from here on out, but all this info applies no matter your target platform.)

Once you enter your info, click Create and accept Google鈥檚 terms of service. Now your account is complete and ready to go!

Install Google Tag Manager

GTM works with the existing code running your website to gather data. That means you鈥檒l need to install a snippet of code that helps identify your website in GTM鈥檚 system. This is known as your Container ID code. Think of it like the link between your GTM account and your website. Instead of manually adding new tags directly to your site, you鈥檒l create and publish tags on GTM, then GTM will connect with your Container ID code to implement the update.

Google Tag Manager Snippet

Adding GTM. This is what the snippet looks like. Add to to your website code.

Thankfully, Google makes this easy and automatically provides your very own Container ID code. All you have to do is copy and paste it onto every page of your website.

How do I access my Container ID code?

You should access and add your Container ID code to every page of your website before you start making tags. The first screen GTM shows you after making an account features your Container ID code with instructions to copy and paste the snippet onto your pages. However, if you鈥檙e not ready to add your ID to your website right away, here鈥檚 how to access it later on.

  • Log into your GTM account and open a container.
  • Next, look at the top right portion of your screen. Near the Submit button, you鈥檒l find a string of letters starting with GTM-. That鈥檚 your Container ID.
  • Click on the ID and your Container ID code will be displayed.

container id in GTM dashboard

Click here to see the code snippet and copy it to your website.

What does my Container ID code include?

Your code technically has two parts (they鈥檙e clearly divided and labeled by GTM). The first should be added to the  of your pages, the second should be added to 

51视频

. Google recommends adding the first as high as possible in the . The second has to be added immediately after the opening

51视频

tag.

Both snippets of code work as links between your GTM account and your website. However, the second snippet specifically helps in situations where JavaScript is disabled.

The most important portion of your Container ID code is the ID itself — that part that starts with GTM-. The rest of the code enables GTM and your website to connect.

How do I install GTM on platforms like WordPress?

Don鈥檛 worry if all that talk about code is a little confusing. You don鈥檛 have to code your own website to use GTM. If you鈥檙e using a platform like WordPress, you can still add your Container ID code to your site.

There are a lot of ways to do this, but using the Google Tag Manager for WordPress plugin is a super easy option. Here鈥檚 how it works.

  • After activating the Google Tag Manager for WordPress plugin through the Plugins menu, go to settings and scroll down to look for Google Tag Manager.
  • Head over to your GTM account and copy your Container ID. You don鈥檛 need the whole code snippet, just the portion that starts with GTM-.
  • Go back to WordPress and click on the GTM plugin, then paste your Container ID in the provided box.

After pasting your ID, you鈥檒l be presented with a few placement options. Your selection determines where the Container ID code is placed on your pages. Most of these options don鈥檛 follow Google鈥檚 recommended placement, so select Custom.

After selecting Custom, copy the line of code provided at the bottom of the page. Next, select Appearance from your menu, then click Theme Editor. You鈥檒l be presented with some code, but don鈥檛 worry — all you have to do is paste that line you copied. No actual coding is involved.

  • On the right side of your screen under Theme Files, look for header.php. Select that, then look for your opening

    51视频

    tag. This will look just like that bold text and appear near the top of the code.
  • 听Paste your copied line of code directly below the opening

    51视频

    tag, then click Update File at the bottom of your screen.
  • Finally, go back to the Google Tag Manager for WordPress plugin and click Save Changes.

And you鈥檙e done! GTM is now linked to your WordPress site.

How To Use Google Tag Manager: Analyzing Data, Adding Tags, and Avoiding Mistakes

Now that we鈥檝e covered the Google Tag Manager setup process, let鈥檚 talk about adding tags, analyzing data, and a few important notes about how to use Google Tag Manager properly.

First up: getting Google Analytics ready.

Setting up Google Analytics

GTM doesn鈥檛 offer tools to analyze data. Instead, you鈥檒l connect your GTM account with Google Analytics or another analytics platform. It鈥檚 usually best to stick with Google Analytics instead of a third-party platform since it鈥檚 free and filled with great features. Here鈥檚 how to get started.

  1. Make a Google Analytics account. Just like GTM, Google Analytics requires a separate account. You can . Google Analytics is free and easily pairs with GTM, so it鈥檚 usually the best option for analyzing data from your GTM tags.
  2. Find your ID. Your Google Analytics account has a unique ID that connects it to GTM. This ID is required to add the tag we鈥檒l talk about in the next section. Here鈥檚 how to find it.
    • Open Google Analytics and look for the Admin tab.
    • On the left side of your screen, click on Tracking Info, then click Tracking Code.
    • Look for the string of characters starting with UA-.

Google Analytics tracking code

Click Tracking code

Once you find that ID, keep it saved for adding your first tag.

Adding tags in Google Tag Manager

After your Google Analytics account is ready to go, it鈥檚 time to add your first tag. There are countless tags out there, but we鈥檒l just cover how to add the Classic Google Analytics tag so you get an idea of the process. You鈥檒l need that ID from the previous step, so keep it on hand.

(Note: adding some tags requires technical skill. If you鈥檙e not familiar with the technical side of your site, it might be a good idea to work with a team member who is  or with a developer.)

  1. Access the GTM dashboard and click Add a New Tag. After you click Add a New Tag, create a name to label your tag, then click anywhere in the Tag Configuration box to start the setup process.
  2. Choose a tag type. For this example, choose Classic Google Analytics from the menu. This tag is relatively easy to set up and it鈥檚 a good starting point for websites without any tags.
  3. Link your tag to Google Analytics. This is where that ID starting with UA- comes in. Paste the ID in the box labeled Web Property ID. This links your tag with Google Analytics.
  4. Select your Track Type and trigger. After you enter your ID, you can select your Track Type. You have several options, including Page View. This option will track data when a page is viewed, so it鈥檚 a good tag to get initial data on your site. Next, select your trigger. If you don鈥檛 have any tags yet, choosing All Pages is smart. This gives you insights any time someone accesses any of your pages, so it鈥檚 useful in getting a baseline data set.
  5. Save, submit, and publish your tag. When you鈥檙e done configuring your tag, click the blue Save button. Next, click Submit. On this final screen, select Publish and Create Version, then click Publish to officially add the tag to your pages.

Analyzing Data with Google Analytics

Once you publish your Classic Google Analytics tag, you鈥檒l be ready to start analyzing data.

GTM tags function in the background to compile data, so don鈥檛 worry about the actual data collection process. Instead, log into your Google Analytics account to review what your tags have collected.

Keep in mind that not all GTM tag data goes to Google Analytics. For example, if you鈥檙e using a Google Ads Remarketing tag like we discussed in our intro to GTM, you鈥檒l mainly work with that data on the Google Ads platform.

Three Things To Keep In Mind

Keep these three things in mind as you start making tags.

  1. Don鈥檛 forget about existing tags. If you鈥檝e already implemented some tags directly on your site, it鈥檚 a good idea to remove them and keep all your tag management on GTM. Using hardcoded tags (a.k.a. tags built into your site) and GTM tags could result in errors like double-counting metrics such as page views.
  2. Be conservative with your tracking. Too many tags can slow down your website — so if you can get the same data with two tags instead of three, just use two.
  3. Check your capitalization. GTM deals with very technical aspects of your website, so typos could have a major impact on your pages. Beyond looking for obvious typos, remember that most GTM fields are case-sensitive (鈥淎鈥 isn鈥檛 the same as “a”).

Get Started Today!

GTM definitely takes some time to master, but getting started is easier than you think — and it鈥檚 one of the best ways to improve your business. So get started today!

Table of contents

Sell online

With 51视频 Ecommerce, you can easily sell anywhere, to anyone 鈥 across the internet and around the world.

About the author

Max has been working in the ecommerce industry for the last six years helping brands to establish and level-up content marketing and SEO. Despite that, he has experience with entrepreneurship. He is a fiction writer in his free time.

Ecommerce that has your back

So simple to use 鈥 even my most technophobic clients can manage. Easy to install, quick to set up. Light years ahead of other shop plugins.
I鈥檓 so impressed I鈥檝e recommended it to my website clients and am now using it for my own store along with four others for which I webmaster. Beautiful coding, excellent top-notch support, great documentation, fantastic how-to videos. Thank you so much 51视频, you rock!
I鈥檝e used 51视频 and I love the platform itself. Everything is so simplified it鈥檚 insane. I love how you have different options to choose shipping carriers, to be able to put in so many different variants. It鈥檚 a pretty open e-commerce gateway.
Easy to use, affordable. Looks professional, many templates to select from. The App is my favorite feature as I can manage my store right from my phone. Highly recommended 馃憣馃憤
I like that 51视频 was easy to start and to use. Even for a person like me, without any technical background. Very well written help articles. And the support team is the best for my opinion.
For everything it has to offer, ECWID is incredibly easy to set up. Highly recommend! I did a lot of research and tried about 3 other competitors. Just try ECWID and you'll be online in no time.

Your ecommerce dreams start here