{"id":967,"date":"2022-05-19T17:38:27","date_gmt":"2022-05-19T16:38:27","guid":{"rendered":"https:\/\/organicdigital.co\/blog\/?p=967"},"modified":"2026-05-15T06:01:21","modified_gmt":"2026-05-15T05:01:21","slug":"how-to-setup-google-analytics-4","status":"publish","type":"post","link":"https:\/\/daveashworth.co\/blog\/how-to-setup-google-analytics-4\/","title":{"rendered":"How To:\u00a0 Setup Google Analytics 4"},"content":{"rendered":"\n<p>As an experience <a href=\"https:\/\/daveashworth.co\/skills\/analytics-and-ad-tracking-consultant\/google-analytics-4\/\">Google Analytics consultant<\/a>, it would be remiss of me at this time not to write an article about GA4.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/daveashworth.co\/blog\/how-to-setup-google-analytics-4\/#What_Is_Google_Analytics_4_GA4\" >What Is Google Analytics 4 (GA4)?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/daveashworth.co\/blog\/how-to-setup-google-analytics-4\/#What_Is_The_Univeral_Analytics_Google_Analytics_4_Deadline\" >What Is The Univeral Analytics \/ Google Analytics 4 Deadline?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/daveashworth.co\/blog\/how-to-setup-google-analytics-4\/#How_To_Create_a_GA4_Account\" >How To Create a GA4 Account<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/daveashworth.co\/blog\/how-to-setup-google-analytics-4\/#How_To_Implement_GA4_Page_View_Tracking_On_Your_Website\" >How To Implement GA4 Page View Tracking On Your Website<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/daveashworth.co\/blog\/how-to-setup-google-analytics-4\/#How_To_Configure_GA4_and_Set_Up_Page_View_Tracking_Using_Google_Tag_Manager\" >How To Configure GA4 and Set Up Page View Tracking Using Google Tag Manager<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"what\"><span class=\"ez-toc-section\" id=\"What_Is_Google_Analytics_4_GA4\"><\/span><strong>What Is Google Analytics 4 (GA4)?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Google Analytics 4 is the new reporting tool set to replace the Universal Analytics we all know and begrudgingly love.<\/p>\n\n\n\n<p>You may or may not know, but if you\u2019re reading this, I assume you do know, that Google are phasing out Universal Analytics to push everyone over to GA4 moving forward.<\/p>\n\n\n\n<p>Here is the official announcement:<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.google\/products\/marketingplatform\/analytics\/prepare-for-future-with-google-analytics-4\/\" target=\"_blank\" rel=\"noopener\">https:\/\/blog.google\/products\/marketingplatform\/analytics\/prepare-for-future-with-google-analytics-4\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_The_Univeral_Analytics_Google_Analytics_4_Deadline\"><\/span>What Is The Univeral Analytics \/ Google Analytics 4 Deadline?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As of July 2023, Universal Analytics will no longer be collecting data.&nbsp; You will still have access to your historical data for a further 6 months or so, then it will be gone.&nbsp; Forever. &nbsp;<\/p>\n\n\n\n<p>(Well not quite forever I can offer solutions that will store historical data indefinitely for reference, get in touch if this is of interest).<\/p>\n\n\n\n<p>In any case, now is the time to get set up on GA4 so that when the deadline does come, you will have at least 12 months or so data to look back on for those year-on-year comparisons.<\/p>\n\n\n\n<p>This guide assumes you already have a universal account setup.<\/p>\n\n\n\n<p>It is the first instalment of several guides I will be producing to help you get set up on GA4 and <a href=\"https:\/\/daveashworth.co\/skills\/analytics-and-ad-tracking-consultant\/\">configure your tracking<\/a> \u2013 down the line there will be guides on <a href=\"https:\/\/daveashworth.co\/blog\/how-to-configure-events-and-conversions-for-google-analytics-4\/\">events, conversions<\/a>, ecommerce tracking, and all the other UA features you have got used to over the years.<\/p>\n\n\n\n<p>This is part 1 \u2013 how to get configured and get basic page view tracking in place.  If you\u2019re managing separate <a href=\"https:\/\/daveashworth.co\/blog\/how-to-set-up-google-analytics-and-ga4-on-multiple-environments\/\">staging and live websites,<\/a> it\u2019s also important to ensure your development data doesn\u2019t dilute your reporting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how\"><span class=\"ez-toc-section\" id=\"How_To_Create_a_GA4_Account\"><\/span><strong>How To Create a GA4 Account<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li> In your existing Universal Analytics account, select the property you wish to get set up on GA4 and select &#8220;GA4 Setup Assistant&#8221;: <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"640\" height=\"397\" class=\"wp-image-968\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-setup-assistant.jpg\" alt=\"GA4 Setup Assistant\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-setup-assistant.jpg 640w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-setup-assistant-300x186.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-setup-assistant-150x93.jpg 150w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure> <\/li>\n\n\n\n<li> Click &#8220;Get Started&#8221;: <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"703\" height=\"386\" class=\"wp-image-969\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/get-started.jpg\" alt=\"Get Started\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/get-started.jpg 703w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/get-started-300x165.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/get-started-150x82.jpg 150w\" sizes=\"(max-width: 703px) 100vw, 703px\" \/><\/figure> <\/li>\n\n\n\n<li> Tick the box for &#8220;Enable data collection using your existing tags&#8221; and then &#8220;Create Property&#8221;. To be honest, at this stage, I\u2019m not sure what happens whether this box is unticked or not. If you click &#8220;no thanks&#8221;, this guide has come to a premature end. Good luck. <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"662\" height=\"451\" class=\"wp-image-970\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/create-property.jpg\" alt=\"Create a bew Google Analytics 4 property\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/create-property.jpg 662w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/create-property-300x204.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/create-property-150x102.jpg 150w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/><\/figure> <\/li>\n\n\n\n<li> Upon creation you will see the following screen. Click &#8220;See your GA4 Property&#8221; to get to the setup assistant. <br> Note: The property ID displayed here IS NOT used for tracking purposes <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"787\" height=\"499\" class=\"wp-image-971\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/property-setup.jpg\" alt=\"Google Analytics 4 Property Setup Assistant\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/property-setup.jpg 787w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/property-setup-300x190.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/property-setup-150x95.jpg 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/property-setup-768x487.jpg 768w\" sizes=\"(max-width: 787px) 100vw, 787px\" \/><\/figure> <\/li>\n\n\n\n<li> From the Setup Assistant, click through to &#8220;Tag Installation&#8221;: <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"789\" height=\"553\" class=\"wp-image-972\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/tag-installation.jpg\" alt=\"Setup Assistant\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/tag-installation.jpg 789w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/tag-installation-300x210.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/tag-installation-150x105.jpg 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/tag-installation-768x538.jpg 768w\" sizes=\"(max-width: 789px) 100vw, 789px\" \/><\/figure> <\/li>\n\n\n\n<li> Select your newly created &#8220;Data Stream&#8221; from the list: <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"807\" height=\"159\" class=\"wp-image-973\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/data-streams.jpg\" alt=\"Data Streams\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/data-streams.jpg 807w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/data-streams-300x59.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/data-streams-150x30.jpg 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/data-streams-768x151.jpg 768w\" sizes=\"(max-width: 807px) 100vw, 807px\" \/><\/figure> <\/li>\n\n\n\n<li> Make A Note of Your Measurement ID: <br><br> <figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"896\" height=\"401\" class=\"wp-image-974\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/web-stream-details.jpg\" alt=\"Web Stream Details\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/web-stream-details.jpg 896w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/web-stream-details-300x134.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/web-stream-details-150x67.jpg 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/web-stream-details-768x344.jpg 768w\" sizes=\"(max-width: 896px) 100vw, 896px\" \/><\/figure> <\/li>\n<\/ol>\n\n\n\n<p>By default, your tag will track:<\/p>\n\n\n\n<p>a. Page views<br>b. Scrolls<br>c. Outbound clicks<br>d. Site search<br>e. Video engagement<br>f. File downloads<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"implement\"><span class=\"ez-toc-section\" id=\"How_To_Implement_GA4_Page_View_Tracking_On_Your_Website\"><\/span><strong>How To Implement GA4 Page View Tracking On Your Website<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you wish to add the tracking code directly into your site\u2019s template, click on:<br>&#8220;Tagging Instructions&#8221;-&gt; &#8220;Add new on-page tag&#8221; -&gt; Global Site Tag (gtag.js)<br>This will give you the code you need to copy and paste into your site, and is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- Global site tag (gtag.js) - Google Analytics --&gt;\n&lt;script async src=\"https:\/\/www.googletagmanager.com\/gtag\/js?id=G-XXXXXXXXXX\"&gt;&lt;\/script&gt;\n&lt;script&gt;\n  window.dataLayer = window.dataLayer || &#91;];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n\n  gtag('config', 'G-XXXXXXXXXX');\n&lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<p><br>Add this into the &lt;head&gt; section of the site and away you go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"config\"><span class=\"ez-toc-section\" id=\"How_To_Configure_GA4_and_Set_Up_Page_View_Tracking_Using_Google_Tag_Manager\"><\/span><strong>How To Configure GA4 and Set Up Page View Tracking Using Google Tag Manager<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If, like me, you are a <a href=\"https:\/\/daveashworth.co\/skills\/google-tag-manager-consultant\/\">Google Tag Manager<\/a> Fanboy, you will want to set up your tracking using tags and triggers.<\/p>\n\n\n\n<p>Again, this assumes you have a GTM account already set up on your site, and if you\u2019ve got this far into this guide, then surely you have.<\/p>\n\n\n\n<p>Create a new tag of type \u201cGoogle Analytics: GA4 Configuration\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"482\" height=\"279\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/choose-tag-type.jpg\" alt=\"Choose Tag Type\" class=\"wp-image-975\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/choose-tag-type.jpg 482w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/choose-tag-type-300x174.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/choose-tag-type-150x87.jpg 150w\" sizes=\"(max-width: 482px) 100vw, 482px\" \/><\/figure>\n\n\n\n<p><br>Here, you have 2 choices, you can add your measurement ID as a custom variable, or, enter it manually.&nbsp; Either way, enter this into the \u201cMeasurement ID\u201d box and tick \u201cSend a page view event when this configuration loads\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"853\" height=\"392\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-tag.jpg\" alt=\"Config Tag\" class=\"wp-image-976\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-tag.jpg 853w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-tag-300x138.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-tag-150x69.jpg 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-tag-768x353.jpg 768w\" sizes=\"(max-width: 853px) 100vw, 853px\" \/><\/figure>\n\n\n\n<p>Then add a trigger for this to applied on \u201call pages\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"731\" height=\"338\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-trigger.jpg\" alt=\"Trigger\" class=\"wp-image-977\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-trigger.jpg 731w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-trigger-300x139.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/config-trigger-150x69.jpg 150w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><\/figure>\n\n\n\n<p>And that\u2019s it, submit your changes and you are good to go.<\/p>\n\n\n\n<p>Once your account has collected some data, you have a whole new range of reports and configurations to get your head around:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"970\" height=\"697\" src=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-report.jpg\" alt=\"GA4 Report\n\" class=\"wp-image-978\" srcset=\"https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-report.jpg 970w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-report-300x216.jpg 300w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-report-150x108.jpg 150w, https:\/\/daveashworth.co\/blog\/wp-content\/uploads\/2022\/05\/ga4-report-768x552.jpg 768w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/figure>\n\n\n\n<p>The next step is usually <a href=\"https:\/\/daveashworth.co\/blog\/how-to-configure-events-and-conversions-for-google-analytics-4\/\">configuring custom events and conversions<\/a> so you can properly measure enquiries, purchases and other important actions<\/p>\n\n\n\n<p>Stay tuned for more GA4 setup, tracking and debugging guides, and if you need help configuring your analytics setup, take a look at my <a href=\"https:\/\/daveashworth.co\/skills\/analytics-and-ad-tracking-consultant\/\">analytics and tracking consultancy services<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Universal Analytics being deprecated in July 2023, now is the time to get set up on GA4.  This is a quick guide to setting up GA4 on your site and configuring page view tags.<\/p>\n","protected":false},"author":1,"featured_media":952,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics"],"_links":{"self":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts\/967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/comments?post=967"}],"version-history":[{"count":2,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts\/967\/revisions"}],"predecessor-version":[{"id":2086,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/posts\/967\/revisions\/2086"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/media\/952"}],"wp:attachment":[{"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/media?parent=967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/categories?post=967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daveashworth.co\/blog\/wp-json\/wp\/v2\/tags?post=967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}