Google Analytics is an essential tool for tracking the performance of your website. It provides valuable insights on how users are interacting with your site and helps you make informed decisions about your online presence. In this post, we’ll go over how to install Google Analytics using Google Tag Manager (GTM).
1. Create a Google Analytics account
If you don’t already have a Google Analytics account, go to the Google Analytics homepage and click “Start for free.” You’ll be prompted to log in or create a new account.
Once you’re logged in, click on “Admin” in the bottom left corner. This is where you can create new accounts and properties. For this tutorial, we’ll create a new property for a Universal Analytics account and a GA4 account. To do this, click “Create Property” and then “Advanced Options.” Select “Create a Universal Analytics Property” and enter your website’s URL. Click “Next” and then “Create.”
2. Copy the Measurement ID
The Measurement ID is what connects your Google Analytics account to your website. You’ll need to copy it and paste it into GTM later. To find the Measurement ID, click on “Data Streams” in the left menu and then click on your website’s URL. The Measurement ID is listed under “Measurement ID.” Copy it and save it to a central location, like a document or spreadsheet.
3. Install GTM on your website
Now that you have your Measurement ID, it’s time to install GTM on your website. First, you’ll need to create a GTM container. Go to Google Tag Manager and click “Create Account.” Enter your account details and click “Continue.”
Next, you’ll need to install the GTM container on your website. To do this, click on the “Install Google Tag Manager” button and follow the instructions. You’ll need to copy and paste the GTM code into the header of your website.
4. Create a Google Analytics tag in GTM
Once GTM is installed on your website, it’s time to create a Google Analytics tag. Go to GTM and click on “Tags” in the left menu. Then click “New” and select “Google Analytics: Universal Analytics” as the tag type.
In the “Configuration” section, select your GA account and paste in the Measurement ID you copied earlier. You can also customize the tag by adding additional fields, like the event category, action, and label.
5. Set up a trigger
A trigger tells GTM when to fire the Google Analytics tag. In this case, we want the tag to fire on every page of our website. To set up the trigger, go to “Triggers” in the left menu and click “New.” Select “All Pages” as the trigger type and click “Save.”
6. Publish the changes
Once you have your Google Analytics tag and trigger set up, it’s time to publish the changes to your website. Click “Submit” and then “Publish” to push the changes live.
That’s it! You’ve successfully installed Google Analytics on your website using GTM. Now you can start tracking your website’s performance and get valuable insights on how users are interacting.