{"id":42653,"date":"2023-02-25T15:00:05","date_gmt":"2023-02-25T14:00:05","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=42653"},"modified":"2023-02-22T23:35:35","modified_gmt":"2023-02-22T22:35:35","slug":"how-to-switch-to-google-analytics-4-wordpress","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/how-to-switch-to-google-analytics-4-wordpress\/","title":{"rendered":"How to Safely Switch to Google Analytics 4 in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]It\u2019s been a while since Google introduced Google Analytics 4, its latest iteration of website measurement and analytics product. People had more than two years to get used to it before the company announced, in March 2022, that the previous version of the product, Universal Analytics, would stop processing new hits on July 1, 2023, or October 1, 2023, in the case of Universal Analytics 360 properties.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you\u2019re just <a href=\"https:\/\/qodeinteractive.com\/magazine\/getting-started-with-google-analytics\/\">starting with Google Analytics<\/a>, you have nothing to worry about \u2013 the account creation process is geared towards Google Analytics 4. You need to take a few extra steps to get Universal Analytics. It might not be available at all when you\u2019re reading the article.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]But if you\u2019ve been using Universal Analytics, you don\u2019t have much time before the tracking stops. So the sooner you set up Google Analytics 4 for your website, the better. So let\u2019s see if we can help you out. In this article, we\u2019ll show you about:<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#getting-familiar-with-google-analytics-4\">Getting Familiar with Google Analytics 4<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-set-up-google-analytics-4\">How to Set Up Google Analytics 4<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#how-to-install-google-tag-for-your-ga4-property\">How to Install a Google Tag for your GA4 Property<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-seo-banner&#8221;][vc_empty_space height=&#8221;80px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"getting-familiar-with-google-analytics-4\"><\/a>Getting Familiar with Google Analytics 4<\/h2>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;21px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"389\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/Getting-Familiar-with-Google-Analytics-4.jpg\" class=\"attachment-full size-full\" alt=\"Getting Familiar with Google Analytics 4\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/Getting-Familiar-with-Google-Analytics-4.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/Getting-Familiar-with-Google-Analytics-4-300x120.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/Getting-Familiar-with-Google-Analytics-4-768x308.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/Getting-Familiar-with-Google-Analytics-4-620x249.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]In the Universal Analytics <a href=\"https:\/\/blog.google\/products\/marketingplatform\/analytics\/prepare-for-future-with-google-analytics-4\/\" target=\"_blank\" rel=\"noopener\">termination date announcement<\/a>, Google described UA\u2019s core proposition as something attuned to the demands of an era characterized by sessions, cookies, and desktop-first experience. As that era changed, Google created a new tool to better suit users\u2019 needs.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>The new benefits of Google Analytics 4 as compared to Universal Analytics include:<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">The ability to track websites as well as mobile apps. <\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">More and better event-based measurements.<\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">A better and more accurate insight into the buyer journey.<\/span>        <\/div>\n            <\/li>\n<\/ul><ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">Improved user privacy control options.<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;28px&#8221;][vc_column_text]While you have little choice in switching to GA4 if you want to continue using Google\u2019s analytics tools, the change comes with plenty of benefits many in its user base will welcome.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>The best way to get familiar with Google Analytics 4 before connecting it to your website is by examining the GA4 demo account.<\/strong> You can choose between a property with web data only and one that combines app and web data. Between the two, you\u2019re bound to learn a lot about Google Analytics 4.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-set-up-google-analytics-4\"><\/a>How to Set Up Google Analytics 4<\/h2>\n<p>[\/vc_column_text][vc_column_text]If you already have Google Analytics set up for your website and you\u2019re wondering how to switch from the soon-to-be-deprecated Universal Analytics to Google Analytics 4, <strong>the good news is that you don\u2019t actually have to switch<\/strong>. Before the tracking for Universal Analytics stops,<strong> you can run both in parallel and access them for data<\/strong>. Because GA4 only uses the data it collects from when you start using it, you\u2019ll also need to go back to your UA property for past data.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Luckily for everyone, Google has included a very useful tool called the GA4 Setup Assistant that will guide you through the process of creating a GA4 property for your app or your website. <strong>First, you must navigate to Google Analytics and find the appropriate account and UA property that links to your website.<\/strong> After accessing them, click on the Admin options in the lower left-hand side corner, and click on GA4 Setup Assistant.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Setup.jpg\" class=\"attachment-full size-full\" alt=\"GA4 Setup\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Setup.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Setup-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Setup-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Setup-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]In the next step, you\u2019ll be asked to choose between connecting an existing Google Analytics 4 property and creating a new one. Because you\u2019re making a new one, that\u2019s the option you need to choose. <strong>Press the <em>Get Started<\/em> button, and the setup assistant will inform you of the next steps in the process.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"555\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Get-Started.jpg\" class=\"attachment-full size-full\" alt=\"GA4 Get Started\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Get-Started.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Get-Started-300x172.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Get-Started-768x440.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Get-Started-620x355.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]As you can see, the assistant will copy the settings from your UA tag and do some other things for you. It will, however, refer back to you for setting up a website tag.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>If you already have a tag installed on your website and the assistant recognizes it, you can use the tag found on your site.<\/strong> You won\u2019t have to change the code to your site, and the users on the GA4 property will be added to the users on the tag. That\u2019s the road Google recommends you take.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You can also reuse a Google tag you have access to or create and install a new tag.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"how-to-install-google-tag-for-your-ga4-property\"><\/a>How to Install a Google Tag for your GA4 Property<\/h2>\n<p>[\/vc_column_text][vc_column_text]The setup assistant will give you access to your Google tag during the setup process. Depending on your chosen installation method, you might not need it at all. <strong>Just know that if you create the property without setting up the tag correctly, you\u2019ll be able to find it later.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You\u2019ll have two options for installing the tag to your website \u2013 manual installation and using a plugin. Installing a tag manually involves copying and including the code in your theme\u2019s header.php file.<strong> That method is only recommended if you know exactly what you\u2019re doing, however, and should include the use of a child theme.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]A more novice-friendly option involves using a plugin. As part of the GA4 setup process, the assistant will provide instructions on connecting your site with GA4 using the <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-set-up-site-kit-by-google-in-wordpress\/\">Site Kit<\/a> or MonsterInsights plugins.<strong> For instructions on how to do it using another plugin, or if you want to learn to do it manually, you can check out our<\/strong> <a href=\"https:\/\/qodeinteractive.com\/magazine\/add-header-and-footer-code-in-wordpress\/\">guide on adding code to the WordPress header and footer<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you\u2019re unsure where to find the tag, navigate to your new GA4 property, and bring up the Admin panel. <strong>There, you\u2019ll find the Data Streams option.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"518\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Data-Streams.jpg\" class=\"attachment-full size-full\" alt=\"GA4 Data Streams\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Data-Streams.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Data-Streams-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Data-Streams-768x411.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-Data-Streams-620x331.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Choosing that option will list your data streams, including the newly made GA4 property. Once you click on the property, you\u2019ll see its web stream details \u2013 name, URL, stream ID, and events. Next, you\u2019ll see the Google tag options near the bottom of the page. <strong>Finally, at the very bottom is the <em>View tag instructions<\/em> \u2013 click on that option.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"478\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-View-Tag-Instructions.jpg\" class=\"attachment-full size-full\" alt=\"GA4 View Tag Instructions\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-View-Tag-Instructions.jpg 969w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-View-Tag-Instructions-300x148.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-View-Tag-Instructions-768x379.jpg 768w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2023\/02\/GA4-View-Tag-Instructions-620x306.jpg 620w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This will bring up installation instructions that will show you how to install the tag for specific site builders and CMSs and manually. <strong>Choose the latter to see your Google tag.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Let\u2019s Wrap It Up!<\/h2>\n<p>[\/vc_column_text][vc_column_text]Google Analytics is one of the most valuable tools for tracking your website\u2019s performance. With Google Analytics 4, it only became better, and it\u2019s tough to see it heading in any other direction in the future. So make sure you have the latest version of Analytics monitoring your website, and ensure you add it before the previous version ceases operation.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Looking for the right way to switch to Google Analytics 4 on your WordPress website? Don&#8217;t worry, it&#8217;s easier than it sounds &#8211; we&#8217;ll show you how to do it!<\/p>\n","protected":false},"author":9295,"featured_media":42667,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[347,25,13],"class_list":["post-42653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-google-analytics","tag-seo","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/42653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/9295"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=42653"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/42653\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/42667"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=42653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=42653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=42653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}