Skip to Content
LLM Decode learn.llmdecode.com
Back to all resources
SOP-009

Add Google Analytics 4 to a site

Perfectly add Google Analytics to a site to measure website data and gather visitor insights, using Google Tag Manager and verify that it is working properly

Type SOPs · PDF
Execution time 30 minutes
Last updated 26 April 2025
Who does this The person responsible for website management, or analytics
Length 15 pages

Goal

To add Google Analytics 4 to a site using Google Tag Manager and verify that it is working properly

Ideal outcome

Google Analytics 4 is properly added & configured without any technical issues

Why it matters

Google Analytics is the most popular tool to measure website data to gather visitor insights. With it, you will be able to know the amount of traffic you are getting, and how your visitors are behaving inside your website

Before you start

You need a Google Analytics 4 account created. If you haven’t created one yet then follow SOP 163 (web version). Also, you should have installed Google Tag Manager on your site. If you haven’t added Google Tag Manager to your site, you can check out our Google Tag Manager Installation SOPs for: • SOP 004 (web version) to Set up Google Tag Manager on WordPress • SOP 065 (web version) to Set up Google Tag Manager on Shopify • SOP 066 (web version) to Set up Google Tag Manager on Squarespace

Key steps 32 steps

What is inside 36 headings

1 Get the measurement ID from Google Analytics 4 6

  1. Login to your Google Analytics account.
  2. Click "Admin".
  3. Make sure you’ve selected the correct property (account) and select "Data Streams" under "Data collection and modification".
  4. Select your website that you want to implement Google Analytics 4.
  5. Click on the measurement ID to copy it on your clipboard.
  6. You can paste it in a text editor or notepad. You will need this later on.

2 Set up Google Tag Manager 13

  1. Go to Google Tag Manager and sign in with your account details.
  2. Select the container that is set up on your website.
  3. Go to "Tags".
  4. Click "New" and rename your tag. It is recommended that it contains a mention of Google Analytics 4 as it would make it easier in the future to locate the tags you are looking for.
  5. Click on the "Tag Configuration" icon and select "Google Tag".
  6. Paste the Measurement ID that you copied from Google Analytics 4 earlier.
  7. Next, scroll down and click on the trigger icon below to set up a trigger for this tag.
  8. Select "Initialization- All Pages". This is to fire the Google Analytics 4 on all pages on your website (recommended).
  9. You are now ready to save your settings by clicking "Save":
  10. Next, go to the "Overview" on the sidebar, this is how your Google Tag Manager overview dashboard should look like:
  11. If everything looks ok, you are now ready to hit "Submit".
  12. In the Submission Configuration panel, you will be given the chance to add a name and description to this version. After you have done so, hit "Publish".
  13. You will now be taken to see the summary of the changes you’ve just made. That's it!

3 Verify your set-up with a Tag Assistant Companion 7

  1. Select the container that you have already set up.
  2. Select "Preview".
  3. A new tab will appear to connect a Tag Assistant to your site. Key in your website URL and click "Connect".
  4. This will open a new window to verify your website with a debug parameter at the end of your website URL. We recommend closing this window and using an extension instead as explained below.
  5. Next, download the "Tag Assistant Companion" extension from this link here.
  6. Refresh the Google Tag Manager page and click "Preview" followed by "Connect" again.
  7. Next, navigate through the pages of your website. The Tag Assistant Companion will automatically load your page events as seen on the left:

4 Verify your setup inside Google Analytics 6

  1. Login to your Google Analytics 4 dashboard by heading over to Google Analytics
  2. Click "Admin" from the bottom left corner and select "DebugView".
  3. Alternatively, you may also verify through the real-time report under the "Report" icon on the sidebar.
  4. In another Google Chrome tab or window open up your website URL.
  5. Now go back to the Google Analytics 4 tab and wait a few seconds.
  6. You should see (at least) 1 active user on the website:

The document 15 pages

The file is locked

It comes with the SOP Library.

Bought from LLM Decode before? Sign in to pay ₹ 1,999.00.

Up next · SOP-010 Set up a Meta Ads Account Create a Business Manager account and Facebook Ad Account for your business, to start managing all your Facebook Assets and sharing them with your employees sec Unlock to read