How to set up the Analytics Pageview tag

Creating an account and a container

To deploy a tag in Google Tag Manager, you’ll first have to create an account and container, deploy the tag, and then test it to ensure that it’s working properly. To create an account in Tag Manager, we’ll go to “tagmanager.google.com” and log in using a Google account. Click “Sign in” now.

Every Google Tag Manager login must have at least one account. When you first log in to Google Tag Manager, you’ll be prompted to create one. First, we’ll type in an account name. Then click “Next.”

Now you’ll set up your container. We’ll name the container after the website we’re tagging. Since The Great Outdoors Travel Adventures is a website, under “Where to Use Container” select Web Pages. You can add a domain and a time zone if you wish, but we’ll leave these as the default for now. Now click “Create Account and Container.” To agree to the “Terms of Service,” click “I Accept.”

Notice that Tag Manager provides you with the container code that is ready to be copied and pasted. 

Once your account and container have been created, you’ll see the Container Dashboard. The Container Dashboard lets you choose new tags, shows which tags you’re currently editing, and which containers you’ve already published. You can also add notes about your container and view a history of recent changes. You can use the left-hand navigation to create or edit tags, set up triggers, and set up built-in or user-defined variables.

The Accounts tab will display a list of all of the accounts you have access to, as well as the list of containers within each account, the type, and their ID. To set up a new account, click “Create Account.” We’ll name the account “The Great Outdoors.”

Creating an Analytics tag

Since The Great Outdoors wants to use Analytics to help them better understand user behavior, the first tag we’ll add is the standard Analytics “Page View” tag. To add a tag to your website, you can select “Tags” in the navigation and then “New,” or you can just select “New Tag.” Select “New Tag” now.

To name the tag, click on “Untitled Tag.” To organize your tags, we’ll use the naming convention: tag type, followed by the name of the website, followed by the tag location.

Next, choose “Analytics.” We’ll select the tag type “Universal Analytics.” Now go ahead and click “Continue.”

We can add the Analytics tracking ID by going into Analytics under “Admin.” Then “Property.” Then “Property Settings.” You can also find this ID by clicking “Home” and then expanding the “Account” folder.

In order to take advantage of remarketing and get Analytics’ Customer Demographics data, select “Display Advertising Features.” Then select the Track Type “Page View.” Now click “Continue.”

Since we want this tag to fire on every page of the website in order to track page views, select the trigger “All Pages.” Notice the trigger confirmation below. Then select “Create Tag.” You can see that our Analytics “Page View” tracking tag now appears in our list of tags.

Publishing your Analytics tag

We’ve created our first tag, but we still have to publish the tag. Click “Publish.” A dialog box will appear with the total number of changes you’re about to publish.

To inspect your container changes before they go live, click “Preview.” A banner at the top will indicate which version of the tag you are previewing.

Let’s open a new tab in our browser and navigate to the Travel Adventures website. Notice that while in “Preview Mode,” a Debug Panel opens at the bottom of the web browser, showing you a summary of the tags that fired.

You can see that the tracking tag fired in “Preview Mode” when we visited the site. Once we’ve verified that the tag is firing properly, we can return to Tag Manager and click “Publish.” In the confirmation dialog window, click “Publish Now.”

You’ll receive a confirmation message telling you that the changes to your container are now live.

To exit preview mode, click “Leave Preview Mode.”

We can also verify that the tag is live by opening up Analytics’ Real-Time Reporting and making sure active users and page views are being recorded. How cool is that?

If you need to make changes, Tag Manager offers version control for each tag that you publish on the “Versions” tab. You can roll back your tag to a previous version or even save versions of your container without making the changes public.

Those are the basic steps to publish a tag to your website using Google Tag Manager.

Was this helpful?

How can we improve it?
true
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Search
Clear search
Close search
Main menu
13012297047382175200
true
Search Help Center
true
true
true
true
true
69256
false
false