{"slug":"sop-009-add-google-analytics-4-to-a-site","title":"Add Google Analytics 4 to a site","tags":["source:clickminded","type:sop","server:clickminded-sop","google","analytics","site"],"agent_summary":"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.","trigger_phrases":["add google analytics 4 to a site","how to add google analytics 4 to a site"],"runnable":false,"markdown":"\r\nSOP 009: Add Google Analytics 4 to a site\r\n\r\nPerfectly 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.\r\n\r\n__Last Updated / Reviewed:__ 04/26/2025\r\n\r\n__Execution Time:__ 30 minutes\r\n\r\n__🚀 Goal:__ To add Google Analytics 4 to a site using Google Tag Manager and verify that it is working properly.\r\n\r\n__🤞 Ideal Outcome:__ Google Analytics 4 is properly added &amp; configured without any technical issues. \r\n\r\n__🤔 Why this is important:__ 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.\r\n\r\n__🧐 Where this is done__ In Google Tag Manager and Google Analytics.\r\n\r\n__🗓️ When this is done:__ Only once, the first time you install Google Analytics.\r\n\r\n__👨 Who does this:__ The person responsible for website management, or analytics.\r\n\r\n__⚠️Prerequisites or requirements: __\r\n\r\nYou need a Google Analytics 4 account created. If you haven’t created one yet then follow SOP 163 ([web version](https://members.clickminded.com/sop/163/)).  Also, you should have installed Google Tag Manager on your site.\r\n\r\nIf you haven’t added Google Tag Manager to your site, you can check out our Google Tag Manager Installation SOPs for:\r\n\r\n• SOP 004 ([web version](https://members.clickminded.com/sop/004/)) to Set up Google Tag Manager on WordPress\r\n\r\n• SOP 065 ([web version](https://members.clickminded.com/sop/065/)) to Set up Google Tag Manager on Shopify\r\n\r\n• SOP 066 ([web version](https://members.clickminded.com/sop/066/)) to Set up Google Tag Manager on Squarespace\r\n\r\n[__Click here to get the most up-to-date version of this SOP__](https://members.clickminded.com/sop/009)\r\n\r\n## Get the measurement ID from Google Analytics 4\r\n\r\n### 01▸ Login to your [Google Analytics account](https://analytics.google.com/).\r\n\r\n### 02▸ Click \"Admin\".\r\n\r\n### \r\n\r\n### 03▸ Make sure you’ve selected the correct property (account) and select \"Data Streams\" under \"Data collection and modification\".\r\n\r\n\r\n### 04▸ Select your website that you want to implement Google Analytics 4.\r\n\r\n\r\n### 05▸ Click on the measurement ID to copy it on your clipboard. \r\n\r\n### 06▸ You can paste it in a text editor or notepad. You will need this later on.\r\n\r\n## Set up Google Tag Manager\r\n\r\n__Note__: If you haven’t added Google Tag Manager to your site, you can check out our Google Tag Manager Installation SOPs for WordPress (SOP 004, [web version](https://members.clickminded.com/sop/004/)), Shopify (SOP 065, [web version](https://members.clickminded.com/sop/065/)) , or Squarespace (SOP 066, [web version](https://members.clickminded.com/sop/066/)).\r\n\r\n### 01▸ Go to [http://tagmanager.google.com ](http://tagmanager.google.com/)and sign in with your account details.\r\n\r\n### 02▸ Select the container that is set up on your website.\r\n\r\n\r\n### 03▸ Go to \"Tags\".\r\n\r\n\r\n### 04▸ 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.\r\n\r\n\r\n__Note:__ When creating new tags it’s recommended to define a naming convention from the beginning, this keeps your Google Tag Manager set up neatly organized and easy to maintain for many years to come. [Abbreviated Name Of Tool]_[Use for this tag] is a good start. e.g: \"GA_TrackingCode\"\r\n\r\n\r\n### 05▸ Click on the \"Tag Configuration\" icon and select \"Google Tag\".\r\n\r\n\r\n__Note:__ In early September 2023, the new Google tag has now replaced the Google Analytics 4: GA4 Configuration tag with two settings variables. Read more [here.](https://support.google.com/tagmanager/answer/13543899)\r\n\r\n### 06▸ Paste the Measurement ID that you copied from [Google Analytics 4 earlier.](https://docs.google.com/document/d/1bwc3eU6d0ojFOW97aCAgTQY-3WJrGOZMdt0Fi8F8xug/edit#heading=h.l3u0y4me0vaj)\r\n\r\n____\r\n\r\n__Note:__ if you would like to set up the configuration settings and event settings, please find the valid parameters here:\r\n\r\n- [Parameters for configuration settings](https://support.google.com/tagmanager/answer/13438166)\r\n- [Parameters for event settings](https://support.google.com/tagmanager/answer/13438771)\r\n\r\n### 07▸ Next, scroll down and click on the trigger icon below to set up a trigger for this tag.\r\n\r\n\r\n### 08▸ Select \"Initialization- All Pages\". This is to fire the Google Analytics 4 on all pages on your website (recommended).\r\n\r\n\r\n### 09▸ You are now ready to save your settings by clicking \"Save\":\r\n\r\n\r\n### 10▸ Next, go to the \"Overview\" on the sidebar, this is how your Google Tag Manager overview dashboard should look like:\r\n\r\n\r\n### 11▸ If everything looks ok, you are now ready to hit \"Submit\".\r\n\r\n\r\n### 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\".\r\n\r\n__Note:__ Adding a name and description is optional but recommended. You should enter the information here that will make it easy to know what changes are being made.\r\n\r\n\r\n### 13▸ You will now be taken to see the summary of the changes you’ve just made. That's it!\r\n\r\n\r\n## Verify your set-up with a Tag Assistant Companion\r\n\r\n### 01▸ Select the container that you have already set up.\r\n\r\n\r\n### 02▸ Select \"Preview\".\r\n\r\n\r\n### 03▸ A new tab will appear to connect a Tag Assistant to your site. Key in your website URL and click \"Connect\".\r\n\r\n\r\n### 04▸ 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.\r\n\r\n\r\n### 05▸ Next, download the \"Tag Assistant Companion\" extension from [this link here](https://chrome.google.com/webstore/detail/tag-assistant-companion/jmekfmbnaedfebfnmakmokmlfpblbfdm).\r\n\r\n### 06▸ Refresh the Google Tag Manager page and click \"Preview\" followed by \"Connect\" again.\r\n\r\nThis time, a new tab will appear instead of a new window with the installed Tag Assistant Companion. The Tag Assistant Companion icon should appear in the tab as shown below, which means it is now connected:\r\n\r\n\r\n### 07▸ Next, navigate through the pages of your website. The Tag Assistant Companion will automatically load your page events as seen on the left:\r\n\r\n\r\nRefer to [this link here ](https://support.google.com/tagmanager/answer/7679319?hl=en#:~:text=Window%20Loaded%3A%20Fires%20after%20the,such%20as%20images%20and%20scripts.)for the definition of each page view trigger.\r\n\r\nEach page on your website is represented by a shaped icon on the left. For more tag details messages such as blue, red, yellow, or green icons, please refer to [this link here.](https://support.google.com/tagassistant/answer/6277313?hl=en#zippy=%2Cin-this-article)\r\n\r\nTo troubleshoot any issues encountered in the Tag Assistant Companion, you may refer to [this link here.](https://support.google.com/tagassistant/answer/10039345?hl=en#zippy=%2Cin-this-article)\r\n\r\n## Verify your setup inside Google Analytics\r\n\r\n### 01▸ Login to your Google Analytics 4 dashboard by heading over to[ https://analytics.google.com](https://analytics.google.com)\r\n\r\n### 02▸ Click \"Admin\" from the bottom left corner and select \"DebugView\".\r\n\r\n\r\nIf your GA4 setup is done correctly,  you should be able to see some test engagement events you did prior.\r\n\r\n\r\n### 03▸ Alternatively, you may also verify through the real-time report under the \"Report\" icon on the sidebar.\r\n\r\n\r\n### 04▸ In another Google Chrome tab or window open up your website URL.\r\n\r\n### 05▸ Now go back to the Google Analytics 4 tab and wait a few seconds.\r\n\r\n### 06▸ You should see (at least) 1 active user on the website:","html":"<p>SOP 009: Add Google Analytics 4 to a site</p>\n<p>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.</p>\n<p><strong>Last Updated / Reviewed:</strong> 04/26/2025</p>\n<p><strong>Execution Time:</strong> 30 minutes</p>\n<p><strong>🚀 Goal:</strong> To add Google Analytics 4 to a site using Google Tag Manager and verify that it is working properly.</p>\n<p><strong>🤞 Ideal Outcome:</strong> Google Analytics 4 is properly added &#x26; configured without any technical issues.</p>\n<p><strong>🤔 Why this is important:</strong> 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.</p>\n<p><strong>🧐 Where this is done</strong> In Google Tag Manager and Google Analytics.</p>\n<p><strong>🗓️ When this is done:</strong> Only once, the first time you install Google Analytics.</p>\n<p><strong>👨 Who does this:</strong> The person responsible for website management, or analytics.</p>\n<p>__⚠️Prerequisites or requirements: __</p>\n<p>You need a Google Analytics 4 account created. If you haven’t created one yet then follow SOP 163 (<a href=\"https://members.clickminded.com/sop/163/\">web version</a>).  Also, you should have installed Google Tag Manager on your site.</p>\n<p>If you haven’t added Google Tag Manager to your site, you can check out our Google Tag Manager Installation SOPs for:</p>\n<p>• SOP 004 (<a href=\"https://members.clickminded.com/sop/004/\">web version</a>) to Set up Google Tag Manager on WordPress</p>\n<p>• SOP 065 (<a href=\"https://members.clickminded.com/sop/065/\">web version</a>) to Set up Google Tag Manager on Shopify</p>\n<p>• SOP 066 (<a href=\"https://members.clickminded.com/sop/066/\">web version</a>) to Set up Google Tag Manager on Squarespace</p>\n<p><a href=\"https://members.clickminded.com/sop/009\"><strong>Click here to get the most up-to-date version of this SOP</strong></a></p>\n<h2>Get the measurement ID from Google Analytics 4</h2>\n<h3>01▸ Login to your <a href=\"https://analytics.google.com/\">Google Analytics account</a>.</h3>\n<h3>02▸ Click \"Admin\".</h3>\n<h3></h3>\n<h3>03▸ Make sure you’ve selected the correct property (account) and select \"Data Streams\" under \"Data collection and modification\".</h3>\n<h3>04▸ Select your website that you want to implement Google Analytics 4.</h3>\n<h3>05▸ Click on the measurement ID to copy it on your clipboard.</h3>\n<h3>06▸ You can paste it in a text editor or notepad. You will need this later on.</h3>\n<h2>Set up Google Tag Manager</h2>\n<p><strong>Note</strong>: If you haven’t added Google Tag Manager to your site, you can check out our Google Tag Manager Installation SOPs for WordPress (SOP 004, <a href=\"https://members.clickminded.com/sop/004/\">web version</a>), Shopify (SOP 065, <a href=\"https://members.clickminded.com/sop/065/\">web version</a>) , or Squarespace (SOP 066, <a href=\"https://members.clickminded.com/sop/066/\">web version</a>).</p>\n<h3>01▸ Go to <a href=\"http://tagmanager.google.com/\">http://tagmanager.google.com </a>and sign in with your account details.</h3>\n<h3>02▸ Select the container that is set up on your website.</h3>\n<h3>03▸ Go to \"Tags\".</h3>\n<h3>04▸ 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.</h3>\n<p><strong>Note:</strong> When creating new tags it’s recommended to define a naming convention from the beginning, this keeps your Google Tag Manager set up neatly organized and easy to maintain for many years to come. [Abbreviated Name Of Tool]_[Use for this tag] is a good start. e.g: \"GA_TrackingCode\"</p>\n<h3>05▸ Click on the \"Tag Configuration\" icon and select \"Google Tag\".</h3>\n<p><strong>Note:</strong> In early September 2023, the new Google tag has now replaced the Google Analytics 4: GA4 Configuration tag with two settings variables. Read more <a href=\"https://support.google.com/tagmanager/answer/13543899\">here.</a></p>\n<h3>06▸ Paste the Measurement ID that you copied from <a href=\"https://docs.google.com/document/d/1bwc3eU6d0ojFOW97aCAgTQY-3WJrGOZMdt0Fi8F8xug/edit#heading=h.l3u0y4me0vaj\">Google Analytics 4 earlier.</a></h3>\n<hr>\n<p><strong>Note:</strong> if you would like to set up the configuration settings and event settings, please find the valid parameters here:</p>\n<ul>\n<li><a href=\"https://support.google.com/tagmanager/answer/13438166\">Parameters for configuration settings</a></li>\n<li><a href=\"https://support.google.com/tagmanager/answer/13438771\">Parameters for event settings</a></li>\n</ul>\n<h3>07▸ Next, scroll down and click on the trigger icon below to set up a trigger for this tag.</h3>\n<h3>08▸ Select \"Initialization- All Pages\". This is to fire the Google Analytics 4 on all pages on your website (recommended).</h3>\n<h3>09▸ You are now ready to save your settings by clicking \"Save\":</h3>\n<h3>10▸ Next, go to the \"Overview\" on the sidebar, this is how your Google Tag Manager overview dashboard should look like:</h3>\n<h3>11▸ If everything looks ok, you are now ready to hit \"Submit\".</h3>\n<h3>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\".</h3>\n<p><strong>Note:</strong> Adding a name and description is optional but recommended. You should enter the information here that will make it easy to know what changes are being made.</p>\n<h3>13▸ You will now be taken to see the summary of the changes you’ve just made. That's it!</h3>\n<h2>Verify your set-up with a Tag Assistant Companion</h2>\n<h3>01▸ Select the container that you have already set up.</h3>\n<h3>02▸ Select \"Preview\".</h3>\n<h3>03▸ A new tab will appear to connect a Tag Assistant to your site. Key in your website URL and click \"Connect\".</h3>\n<h3>04▸ 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.</h3>\n<h3>05▸ Next, download the \"Tag Assistant Companion\" extension from <a href=\"https://chrome.google.com/webstore/detail/tag-assistant-companion/jmekfmbnaedfebfnmakmokmlfpblbfdm\">this link here</a>.</h3>\n<h3>06▸ Refresh the Google Tag Manager page and click \"Preview\" followed by \"Connect\" again.</h3>\n<p>This time, a new tab will appear instead of a new window with the installed Tag Assistant Companion. The Tag Assistant Companion icon should appear in the tab as shown below, which means it is now connected:</p>\n<h3>07▸ Next, navigate through the pages of your website. The Tag Assistant Companion will automatically load your page events as seen on the left:</h3>\n<p>Refer to <a href=\"https://support.google.com/tagmanager/answer/7679319?hl=en#:~:text=Window%20Loaded%3A%20Fires%20after%20the,such%20as%20images%20and%20scripts.\">this link here </a>for the definition of each page view trigger.</p>\n<p>Each page on your website is represented by a shaped icon on the left. For more tag details messages such as blue, red, yellow, or green icons, please refer to <a href=\"https://support.google.com/tagassistant/answer/6277313?hl=en#zippy=%2Cin-this-article\">this link here.</a></p>\n<p>To troubleshoot any issues encountered in the Tag Assistant Companion, you may refer to <a href=\"https://support.google.com/tagassistant/answer/10039345?hl=en#zippy=%2Cin-this-article\">this link here.</a></p>\n<h2>Verify your setup inside Google Analytics</h2>\n<h3>01▸ Login to your Google Analytics 4 dashboard by heading over to<a href=\"https://analytics.google.com\"> https://analytics.google.com</a></h3>\n<h3>02▸ Click \"Admin\" from the bottom left corner and select \"DebugView\".</h3>\n<p>If your GA4 setup is done correctly,  you should be able to see some test engagement events you did prior.</p>\n<h3>03▸ Alternatively, you may also verify through the real-time report under the \"Report\" icon on the sidebar.</h3>\n<h3>04▸ In another Google Chrome tab or window open up your website URL.</h3>\n<h3>05▸ Now go back to the Google Analytics 4 tab and wait a few seconds.</h3>\n<h3>06▸ You should see (at least) 1 active user on the website:</h3>\n"}