Step-by-step guides
Adding Google Analytics to a Website Using Google Tag Manager
Jan 30, 2025
Step 1: Get Your Google Analytics 4 Measurement ID
Log in to your Google Analytics account.
Click Admin.

Ensure the correct property (your website) is selected, then click Data Streams.
Select your website from the list.

Copy the Measurement ID to your clipboard (you’ll need this later).
Step 2: Add Google Analytics 4 Using Google Tag Manager (GTM)
Go to Google Tag Manager and log in.

Select the container set up for your website.
Navigate to Tags in GTM.
Click New to create a new tag and give it a descriptive name (e.g., "GA_TrackingCode").





In the Tag Configuration section, select Google Analytics 4 Configuration.
Paste the Measurement ID you copied earlier.

Click on the Trigger icon and select All Pages to track all pages on your site.
Click Save to store your settings.



Step 3: Submit and Publish Your Tag
Go to Overview on the sidebar and review your GTM setup.
If everything looks correct, click Submit.


In the Submission Configuration panel, you can name and describe the changes. This step is optional but recommended for future reference.
Click Publish to apply the changes.

Step 4: Verify Your Setup with Google Tag Assistant
In GTM, click Preview.

A new tab will open asking for your website URL. Enter it and click Connect.


To verify the tag, install the Tag Assistant Companion extension.
After installing the extension, refresh GTM and click Preview again. A new tab will open showing the Tag Assistant Companion icon, indicating a successful connection.

Navigate through your website, and the Tag Assistant will show your page events on the left sidebar.
Step 5: Verify Your Setup in Google Analytics 4
Open Google Analytics 4.
In Admin, click Data Settings > Debug View to see if the tag is firing correctly.


Alternatively, you can check in Real-Time Reports under the "Reports" section.


Open your website in another browser tab and refresh the Google Analytics 4 page to see if the active user count reflects your visit.

Once you see at least 1 active user in Google Analytics, your setup is complete! Google Analytics 4 is now tracking your website's traffic via Google Tag Manager.