{"id":52189,"date":"2023-05-23T07:11:50","date_gmt":"2023-05-23T07:11:50","guid":{"rendered":"https:\/\/devrims.com\/?p=52189"},"modified":"2025-01-24T16:42:14","modified_gmt":"2025-01-24T11:42:14","slug":"google-analytics-4-magento","status":"publish","type":"post","link":"https:\/\/devrims.com\/blog\/google-analytics-4-magento\/","title":{"rendered":"How to Connect Google Analytics 4 With Your Magento Store"},"content":{"rendered":"<p>Google Analytics 4 is the newest iteration of Google\u2019s web analytics product. It is a powerful analytical tool that gives you insights about web performance, customer engagement and most importantly your sales.<\/p>\n<p>Recently Google Analytics 4 will replace Universal Analytics. Over the years, the internet has evolved into a multi-functional world of touchpoints. Customers rarely interact with a single medium of sale. Gone are the days when people bought only from a website.<\/p>\n<p>Google Analytics 4 unifies the web and mobile application analysis as your customers play with multiple platforms throughout their journey.<\/p>\n<h2 id='why-google-analytics-4'  id=\"boomdevs_1\">Why Google Analytics 4?<\/h2>\n<p>Google Analytics 4 measures every single detail regarding your buyers and their behavior. It has the capability of tracking and analyzing different aspects about your website and gives a detailed report on audience analysis and behavior, which includes engagement rates, conversion rates, real-time monitoring of visitors and their geographic locations, customized integration with Google Ads to analyze performance of paid campaigns as well. In short, it gives the tracking details about your visitors from acquiring to retaining them to your website.<\/p>\n<p>It&#8217;s time to move to Google Analytics 4 as you will need this tool to understand the performance of your Magento store.<\/p>\n<h2 id='step-by-step-guide-to-connect-ga-4-with-magento-store'  id=\"boomdevs_2\">Step-by-Step Guide To Connect GA 4 With Magento Store<\/h2>\n<p>The aim of this post is to explain how you can connect your new Google Analytics 4 account to your new Magento store. If you are already using Universal Analytics (pre-GA4 version)\u00a0 with your existing Magento store, we recommend that you follow the setup wizard by Google for converting your Universal Analytics to GA 4.<\/p>\n<p>To set up GA 4 on your Magento store, you will have to complete two-steps<\/p>\n<ol>\n<li>Integrating Google Tag with Magento<\/li>\n<li>Integrating Measurement ID with Magento<\/li>\n<\/ol>\n<p>For starters, you have to create an account and the relevant Data Streams on Google Analytics. You will then receive a Google Tag code for your first step and after integrating the code, it will finally give you a Measurement ID for the second step. This is the complete holistic approach for implementing GA 4.<\/p>\n<h2 id='setting-up-a-google-analytics-4-account'  id=\"boomdevs_3\">Setting up a Google Analytics 4 Account<\/h2>\n<p>First thing first, visit <a href=\"https:\/\/analytics.google.com\/\" target=\"_blank\" rel=\"noopener\">analytics.google.com<\/a> and sign into your Google Account.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture1.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"501\"><\/p>\n<p>Hover to the left panel, and click on the \u2018<em>Admin<\/em>\u2019 tab and then click on the blue colored \u2018<em>Create Account\u2019 <\/em>button. It will open a form for you to fill out.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture2.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"505\"><\/p>\n<p>On next screen, it will see 3 sections related to:<\/p>\n<ul>\n<li>Account Setup<\/li>\n<li>Property Setup<\/li>\n<li>About Your Business<\/li>\n<\/ul>\n<p><strong>Account Name<\/strong><\/p>\n<p>Write the Account Name and proceed with the <em>NEXT<\/em> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture3a.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"752\"><\/p>\n<p><strong>Property Setup<\/strong><\/p>\n<p>Write Property Name as per your choice and click the<em> NEXT <\/em>button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture4a.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"749\"><\/p>\n<p><strong>About your Business<\/strong><\/p>\n<p>Pick Industry from the options available, Company size and the parameters you want to use GA 4 for. After detailing, tap the <em>CREATE<\/em> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture5a.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"747\"><\/p>\n<p>Checkmark the Data Processing Terms field. Then, proceed with the<em> I ACCEPT<\/em> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture6.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"501\"><\/p>\n<h2 id='step-01-connecting-google-tag-with-magento'  id=\"boomdevs_4\">STEP 01: Connecting Google Tag With Magento<\/h2>\n<p>Once done with Account settings, it will take you to the dashboard and will ask about <em>START COLLECTING DATA<\/em>. Pick the platform you are going to use, <em>WEB <\/em>is recommended for the better results.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture7.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"502\"><\/p>\n<p>Next, write the Data Stream details about your website, from where GA4 will fetch the information. Note: Copy the website URL without HTTP\/HTTPS and a backslash. Then click the <em>CREATE STREAM<\/em> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture8.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"502\"><\/p>\n<p>It will automatically give you \u2018Google Tag Code\u2019 to add on to your Magento Admin Panel. Simply copy the code by clicking on the small copy icon located in the top right corner of it.\u00a0 The code will be copied to the clipboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture9.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"501\"><\/p>\n<p>Now open the Magento Admin panel in a new tab, and enter the credentials to sign in.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture10.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"505\"><\/p>\n<p>Move to the left navigation panel, Click Content &gt; Configuration and Click the <em>Edit<\/em> button on the website link you to track with GA4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture11.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"502\"><\/p>\n<p>Scroll down to the HTML Head And click the drop-down icon. Paste the code from the clipboard in the <em>Scripts and Style Sheets <\/em>section box and hit the <em>Save Configuration<\/em> button placed on the right top corner. For the convenience you can reference the screenshot below.\u00a0 Once done with saving it will prompt a message on top regarding the changes that you just made.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture12.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"502\"><\/p>\n<p>Now again go to the left Navigation Bar, click System &gt; Cache Management<br \/>\nSelect all and hit the <em>Submit <\/em>button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture13.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"507\"><\/p>\n<h2 id='step-02-integrating-measurement-id-with-magento'  id=\"boomdevs_5\">STEP 02: Integrating Measurement ID With Magento<\/h2>\n<p>Coming back to Google Analytics, close the installation instruction. Under the <em>Admin<\/em> tab, you will find the Data Stream section, click on it. Open the Data stream details of your website by clicking on it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture14.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"501\"><\/p>\n<p>Click on the <em>Copy<\/em> icon to note the Measurement ID and you will need to paste it on Magento Admin.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture15.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"502\"><\/p>\n<p>Move back to your Magento Admin and navigate to Stores &gt; Configuration.<\/p>\n<p>From the Configurations, move to Sales &gt; Google API appearing on the left side.<\/p>\n<p>Your screen will prompt you with Google Analytics, Google AdWords and Google Gtag.<\/p>\n<p>Go to the Google tag, It contains the Google Analytics4 detail.<\/p>\n<ul>\n<li>Select \u2018Yes\u2019 from the Enable dropdown.<\/li>\n<li>Paste the \u2018Measurement ID\u2019 in the required field.<\/li>\n<li>Press the \u2018<em>Save Config<\/em>\u2019 button.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture16.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"506\"><\/p>\n<p>That is it! Have a look at your Google Analytics dashboard and it would\u2019ve started to record your data from your website.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2023\/05\/picture17.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" alt=\"\" width=\"1024\" height=\"500\"><\/p>\n<h2 id='conclusion'  id=\"boomdevs_6\">Conclusion<\/h2>\n<p>This is the default method of implementing Google Analytics on Magento Ecommerce. Leveraging the power of GA4 will enable you to gain deep insights into user behavior, optimize marketing efforts, and enhance user experiences. Stay ahead of the competition by harnessing the full potential of GA4 on your Magento store and make data-driven decisions that drive your eCommerce business to new heights. And if you want to enhance your store analytics game, we suggest <a href=\"https:\/\/devrims.com\/blog\/setup-microsoft-clarity-wordpress-magento-php\/\" target=\"_blank\" rel=\"noopener\">connecting Microsoft Clarity with your Magento store<\/a> as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Analytics 4 is the newest iteration of Google\u2019s web analytics product. It is a powerful analytical tool that gives you insights about web performance, customer engagement and most importantly your sales. Recently Google Analytics 4 will replace Universal Analytics. Over the years, the internet has evolved into a multi-functional world of touchpoints. Customers rarely [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":52242,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[47],"ad-banner":[84],"blog-popup":[],"cta-banner":[],"class_list":["post-52189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento","tag-magento-development","ad-banner-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts\/52189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/comments?post=52189"}],"version-history":[{"count":1,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts\/52189\/revisions"}],"predecessor-version":[{"id":64559,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts\/52189\/revisions\/64559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/media\/52242"}],"wp:attachment":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/media?parent=52189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/categories?post=52189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/tags?post=52189"},{"taxonomy":"ad-banner","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/ad-banner?post=52189"},{"taxonomy":"blog-popup","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/blog-popup?post=52189"},{"taxonomy":"cta-banner","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/cta-banner?post=52189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}