Link Google Analytics 4 with Google Tag Manager
How to link Google Analytics and Google Tag Manager.
Link your Google Analytics 4 with Google Tag Manager?
Google Analytics is the tracking tool, while Google Tag Manager is the mediator between your website and the tracking tool.
In other words, Google Analytics collects, stores, and analyses data. Google Tag Manager sends the data from your website to Google Analytics (or other tools) in the form of Tags.
So do you need them both? The answer is: It depends.
If Google Analytics is your only tracking tool, installing the code directly onto your website makes perfect sense. This is because you only need to interact with one tool. But suppose you're using multiple tracking tools or want to use more complicated tracking events. In that case, you can also install Google Tag Manager on your website, then connect your Google Tag Manager account to your Google Analytics account.
Here is how you can link them together.
Create Google Analytics 4 Property.
Go to your Google Analytics account.
Go to your Admin section.
You will need to create a new account if you don't have an account.
Click Create Account. Enter your account name and set your Account data Sharing Settings. Click the Next button.
Enter your GA property name and select the time zone and currency. Then click the Next button. Under the advanced options, you will have the option to create a Universal Analytics property, which is the old version and will be retired by 1/July/2023.
Fill in information about your business. And click the Create button. Next, you must read through and accept the Google analytic T&C.
Now we need to set up a new data stream for our property. One of the new features of GA4 is users can collect data from different data platforms and present it in a unified view. In this example, we will use Web.
Enter the Website URL and Stream name. Then, we can select the events we want to track under the Enhanced measurement section.
On the next page, we can see the details about our data stream. Save the Measurement Id.
Now we need to set up our Google Tag Manager (GTM). Click the Create Account button to start the create account wizard. Enter the required information. Using the website URL as the container name, as Google suggests, might be a good idea.
Accept the T&C.
Now we should be able to see a popup with code that you can add it your website.
Next, we need to add a new Tag.
Click the Tag Configuration to open the Tag type selection window. Next, select Google Analytics: GA4 Configuration. Next, enter the measure Id we just created.
Click the Triggering. And select the trigger type.
Then click the Submit button to publish the changes.