Menu Icon

How Do I Create a GTag and Connect GTM and GA4?

How Do I Create A GTag and Connect GTM and GA4

Share Article

Tracking analytics plays a large role in ensuring your marketing strategy is effective, but I’m sure we all know that by now. The tough part at times is making sure that what we use to track our analytics is set up correctly. With the many different analytical platforms, it can be tough to know which one works best and, more importantly, if the platform is working properly.

Here at SocialSurge, we utilize Google Analytics (GA4) to track our client’s website traffic, engagement from those users, and ultimately form submissions/KPIs that we are focusing on. Creating a Google Analytics GTag (Global Site Tag) for your website is essential for tracking user activity, gathering data, and gaining insights into your site’s performance. In this guide, we will walk you through the process of setting up this GTag step by step.

Create a Gtag and GA4 Account

Step 1 Sign in to Google Analytics & Set up a New Account

First, you’ll want to go to the Google Analytics website and sign in with your Google account or create one if you don’t have one already. After that, you’ll be prompted with the “Welcome” screen you see below.

Once you click the “Start measuring” button, you’ll be prompted to enter what you want for your Google Analytics account name. We suggest that you name this with your business name (for example: SocialSurge or SocialSurge Analytics).

When looking at the sharing settings, we recommend you read through these to see which you feel comfortable selecting. The “Google Products & Services” will be unchecked to start. This is more of a personal decision but we do normally have this sharing setting checked as it allows for enhanced demographic & interests reporting that could be helpful later on in your reporting. Click next to continue.

Step 2 Set Up a New Property

You’ll then move on to creating a property. The difference between a Google Analytics account and a property is that you’ll be able to have multiple sites for tracking analytics under one property. For example, if SocialSurge also had a merchandise website where we exclusively sell clothes but also have our main website for the marketing services we provide, we’d create two different properties under one account.

Like before, we suggest that you name these properties accordingly (Example: SocialSurge Main & SocialSurge Merch).

After this, continue to fill out the different information needed (seen below) that is accurate with your business. If you can not find an industry category that is exactly what you provide, select one as close as possible or select “Other Business Activity”.

After choosing what your business objectives are, you’ll be prompted to read over the Google Analytics Terms of Service Agreement. As much as you might want to skip over this, there is some helpful information and definitions. Once you have done so (and we mean it, it’s a good idea to read over all of this to make sure you understand what is shared on your behalf and what the “rules” are), click “I Accept”.

To finish this step up, finally, choose what platform you want to start collecting data on. If I can guess correctly, most of you will likely choose the “Web” option but if you do have an Android or IOS app, select which one suits you. You will then want to type in your website URL and pick a “Stream name”. The rest you can keep as is.

Step 3 Get the GTag Tracking Code

Once you’ve gone through all of the “fun” of setting up your account and inputting all your business information, a screen will appear with installation instructions.

If this prompt does not come up, click the “View tag instructions” button at the bottom of the Web stream details page and you’ll see the installation instructions there.

We recommend that you install this code manually and it will look something like the code you see in the image above. It is best practice to place this code just after the website’s opening tag but if you’re having trouble, here is a resource that might help with this.

Step 4 Verify the Installation

After adding the GTag code to your website, you should verify that it’s working correctly. Here’s how:

Go back to your Google Analytics account and in the “Property” column, click on “Realtime.” Open your website in a new browser tab or window.

In the Realtime report, you should see active users on your website. This confirms that the GTag tracking code is properly installed.

Step 5 Start Tracking Data

Once your GTag is set up and verified, Google Analytics will start collecting data about your website’s traffic, user behavior, and more. You can access this data through your Google Analytics account.

Remember to regularly review your analytics data to gain insights into your website’s performance and make informed decisions for improvements.

That’s it! You’ve successfully created and installed a Google Analytics GTag for your website, allowing you to track and analyze visitor activity.

Connecting GTag to Google Tag Manager

Connecting your Google Analytics GTag to Google Tag Manager (GTM) allows you to manage and deploy various tracking tags and scripts on your website more efficiently. Here’s a step-by-step guide on how to do it:

Step 1 Sign in to Google Tag Manager

Go to the Google Tag Manager website and sign in with the same Google account you used to set up Google Analytics and create the GTag.

Step 2 Create a New Google Tag Manager Container

After signing in, you’ll be in the Google Tag Manager dashboard. Click on the “Create Account” button on the top right side of the screen.

Similar to when setting up your Google Analytics account, fill in the Account Name, and Container Name, and select your target platform (Web for most of you). Go over the Google Tag Manager Terms of Service Agreement, accept it (if you please), and click “Yes” in the top right.

Step 3 Link Google Tag Manager to Your Website

After creating the container, Google Tag Manager will provide you with two code snippets: one for your website’s section and one for the section. Copy both of these code snippets and go to your website’s HTML code.

In the section of your site (just like where you placed the GTag code earlier), paste the code snippet provided by Google Tag Manager. Also, in the section, paste the second code snippet provided by Google Tag Manager just after the opening tag.

Save your HTML file(s) and upload them to your web server if necessary.

Step 4 Create a Google Analytics Tag in Google Tag Manager

Once you finish putting the code in, you’ll want to create a tag to connect your Google Analytics account to your Google Tag Manager.

In the left-hand menu, click “Tags.” Click the “+ New” button to create a new tag. Give your tag a descriptive name, like GA4 Web Tag. Under “Tag Configuration,” go to Google Analytics and select Google Tag.

In the “Measurement ID” field, enter your Google Analytics Measurement ID (the same one used in your GTag code). You can also find this in Google Analytics under settings, data streams, then click on your stream, and it will be listed in the stream details (see below).

Under “Triggering,” click to choose a trigger for your tag. Typically, you’d want to track the tag on “All Pages” to capture data across your entire website. You can also create custom triggers as needed.

Click “Save” to create the tag.

Step 5 Publish Your Changes

After creating the tag, click the “Submit” button in the upper-right corner of the Google Tag Manager interface. Provide a Version Name and, optionally, a Description for this version of your container. Normally for these, we will put the date (Example: 09/27/2023) for the Version Name and in the description we will put what we added/changed for this new version.

Click “Publish” to make your changes live.

Step 6 Verify the Setup

To ensure everything is working correctly, visit your website.

Use the Google Tag Assistant browser extension or Google Analytics’ Realtime report to confirm that the Google Analytics tag deployed via Google Tag Manager and is tracking data as expected.

That’s it! You’ve successfully connected your Google Analytics GTag to Google Tag Manager, allowing you to manage and deploy various tracking tags and scripts more efficiently. Remember to use Google Tag Manager for any additional tracking or scripts you want to implement on your website, making it easier to maintain and update your analytics and marketing tags.

Table of Contents

We use cookies to give you the best online experience. By using this website you agree with our cookie policy.