{"id":1661,"date":"2018-12-13T13:24:51","date_gmt":"2018-12-13T13:24:51","guid":{"rendered":"https:\/\/azoora.com\/blog\/?p=1661"},"modified":"2019-06-01T18:56:02","modified_gmt":"2019-06-01T18:56:02","slug":"how-to-add-google-analytics-to-wordpress-manually-and-via-plugin","status":"publish","type":"post","link":"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/","title":{"rendered":"How to Add Google Analytics to WordPress (Manually and via Plugin)"},"content":{"rendered":"\n<p>As a&nbsp;website owner, something that you should definitely be familiar with is how to add Google Analytics to WordPress. Web analytics allow you to understand how visitors interact with your site. That information enables you to make improvements and create an even better user experience.<\/p>\n\n\n\n<p>For that reason, this article will show you everything you need to know about this topic. It will explain what Google Analytics is and why you should use it, talk about privacy concerns in connection with the new GDPR rules and several ways how you can add Google Analytics to WordPress both manually and via plugin.<\/p>\n\n\n\n<p>Ready to go? Then let\u2019s.<\/p>\n\n\n\n<h3>What is Google Analytics (And Why Use It)? <\/h3>\n\n\n\n<p>Before getting to the how-to part, let\u2019s quickly cover what we are talking about. If you don\u2019t know what Google Analytics is and what you can use it for, this part is for you. <\/p>\n\n\n\n<h4>Get to Know Your Audience<\/h4>\n\n\n\n<p>Google Analytics is a popular suite of web analytics tools present on literally millions of websites. One of the main reasons for its prevalence is that it is available for free. However, what does it do?<\/p>\n\n\n\n<p>Basically, Google Analytics collects information about your web traffic and makes it available to you. For that to happen, all you need to do is add a piece of JavaScript code to your site (more on that soon), which enables the software to track every visitor on your website and what they do. After it does so, Google Analytics turns this information into graphs and statistics that you can access inside your account.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1662\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/how-to-add-google-analytics-to-wordpress-1024x516\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516.png\" data-orig-size=\"1024,516\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"how-to-add-google-analytics-to-wordpress-1024&#215;516\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-300x151.png\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-1024x516.png\" loading=\"lazy\" width=\"1024\" height=\"516\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-1024x516.png\" alt=\"\" class=\"wp-image-1662\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516.png 1024w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-300x151.png 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-768x387.png 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-720x363.png 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-580x292.png 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1024x516-320x161.png 320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In particular, you can learn the following:<\/p>\n\n\n\n<ul><li><strong>Who are your visitors?<\/strong>&nbsp;\u2014 Where are they located in the world? What devices do they use to access your website?<\/li><li><strong>What do they do on your site?<\/strong>&nbsp;\u2014 See which pages they frequent, how many of them leave after just one page (the so-called bounce rate), how long they stick around, which links they click and other interactions with your site. You are also able to set goals (i.e. email subscriber conversions) and track them.<\/li><li><strong>When are they coming by?<\/strong>&nbsp;\u2014 Learn when your site is particularly popular, broken down by hour, day, week and month.<\/li><li><strong>How do they find you?<\/strong>&nbsp;\u2014 Google Analytics can tell you what your primary traffic sources are: search engines, social media, links or direct traffic<\/li><\/ul>\n\n\n\n<h4>Use This Information to Improve Your Site<\/h4>\n\n\n\n<p>You might be thinking, \u201cthat\u2019s all fine and dandy, but how does that help me?\u201d Well, knowing the above allows you to further optimize your site in many ways, such as:<\/p>\n\n\n\n<ul><li>Improve the user experience for different kinds of devices if needed<\/li><li>Optimize under-performing traffic sources or establish more of those that perform well already<\/li><li>Improve your content strategy to give visitors more of what they want<\/li><li>Make under-performing&nbsp;landing pages&nbsp;better<\/li><li>Track the performance of your marketing campaigns<\/li><\/ul>\n\n\n\n<p>In short, learning how to add Google Analytics to your site means you no longer have to guess what would make your site better. Instead, you can take steps based on facts and data to improve what you have to offer. However, collecting this data also comes with some responsibility. Let\u2019s talk about that next.<\/p>\n\n\n\n<h4>Google Analytics and GDPR<\/h4>\n\n\n\n<p>By now, you are probably aware that we recently saw a new European rule on consumer data protection come into effect. It is called&nbsp;<a href=\"https:\/\/www.eugdpr.org\/\">General Data Protection Regulation<\/a>. This law has consequences for anyone who is active in the European market in any way. If that is you (which is likely), you have to make sure your use of Google Analytics is compliant with it.<\/p>\n\n\n\n<ol><li><strong>Don\u2019t send any Personal Identifiable Information (PII)<\/strong>&nbsp;\u2014 This means things like email or home addresses, phone numbers or anything else that can be used to personally identify someone. It\u2019s crucial that you audit your site whether you are passing any of this kind of data on to Google. More on that in&nbsp;<a href=\"https:\/\/support.google.com\/analytics\/answer\/6366371?hl=en\">this article<\/a>.<\/li><li><strong>Enable IP anonymization<\/strong>&nbsp;\u2014 PII extends to IP addresses. For that reason, to be on the safe side, it makes sense to switch on anonymization within Google Analytics. Find out how&nbsp;<a href=\"https:\/\/www.optimizesmart.com\/how-to-turn-on-ip-anonymization-in-google-analytics-and-google-tag-manager\/\">here<\/a>.<\/li><li><strong>Include a privacy policy<\/strong>&nbsp;\u2014 Under the new law, every website needs their own privacy policy. This document needs to lay down in plain language everything you are doing concerning collecting and processing user data, including for cookies and contact forms. <\/li><li><strong>Make your cookie consent GCPR compliant<\/strong>&nbsp;\u2014 For all cookies that are not strictly necessary, you need to get consent from your users to use them. Your consent solution must include information about the purpose of the cookies, ensure that visitors can still use your site even if they decline, provide access to cookie settings and document their acceptance. There are several&nbsp;<a href=\"https:\/\/wordpress.org\/plugins\/tags\/gdpr\/\">plugins in the WordPress directory<\/a>&nbsp;for that.<\/li><\/ol>\n\n\n\n<p>For more information on GDPR and what it means for your site, We recommend&nbsp;<a href=\"https:\/\/www.codeinwp.com\/blog\/complete-wordpress-gdpr-guide\/\">this post<\/a>. Alright, now we can finally get to what you came here for.<\/p>\n\n\n\n<h2>How to Add Google Analytics to WordPress Manually<\/h2>\n\n\n\n<p>In order to use Google Analytics on your site, you first have to sign up to an account. You can do this on the&nbsp;<a href=\"https:\/\/analytics.google.com\/\">Google Analytics homepage<\/a>. Either sign into your existing account or follow the instruction to create a new one. This will give you access to your tracking ID and code, which you will need soon. You can find it under&nbsp;<em>Admin &gt; Property &gt; Tracking Info &gt; Tracking Code<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1665\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/find-tracking-code-inside-google-analytics-1024x516\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516.png\" data-orig-size=\"1024,516\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"find-tracking-code-inside-google-analytics-1024&#215;516\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-300x151.png\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-1024x516.png\" loading=\"lazy\" width=\"1024\" height=\"516\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-1024x516.png\" alt=\"\" class=\"wp-image-1665\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516.png 1024w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-300x151.png 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-768x387.png 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-720x363.png 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-580x292.png 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-tracking-code-inside-google-analytics-1024x516-320x161.png 320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3>Method #1: Add the Tracking Code to&nbsp;<code>header.php<\/code><\/h3>\n\n\n\n<p>One of the easiest ways to add Google Analytics to WordPress is to insert the tracking code into the header file. That way, it will load on every single page. This is an especially good solution if your theme is using the standard&nbsp;<code>header.php<\/code>&nbsp;file.<\/p>\n\n\n\n<p>Be aware, however, that the best idea to implement this is in a&nbsp;child theme. Otherwise, you will lose your changes to a theme update. So, either open up&nbsp;<code>header.php<\/code>&nbsp;in your main theme or copy it to your child theme folder and then edit it. After that, copy the tracking code from your Google rel=\u201dnofollow\u201dAnalytics account and paste it right before the closing&nbsp;<code>&lt;\/head&gt;<\/code>&nbsp;bracket.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1666\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398.jpg\" data-orig-size=\"1024,398\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024&#215;398\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-300x117.jpg\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-1024x398.jpg\" loading=\"lazy\" width=\"1024\" height=\"398\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-1024x398.jpg\" alt=\"\" class=\"wp-image-1666\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398.jpg 1024w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-300x117.jpg 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-768x299.jpg 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-720x280.jpg 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-580x225.jpg 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-manually-in-header-file-1024x398-320x124.jpg 320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Don\u2019t forget to include the&nbsp;<code>&lt;script&gt;<\/code>&nbsp;brackets so browsers know what it is. Save the file, upload it to your theme and you are done.<\/p>\n\n\n\n<h3>Method #2: Use&nbsp;<code>functions.php<\/code><\/h3>\n\n\n\n<p>Another possibility of how you can add Google Analytics to WordPress manually is&nbsp;<code>functions.php<\/code>. It works the same way as above only that you add the analytics code to your header with a function instead of inside the file.<\/p>\n\n\n\n<p>To achieve this, edit the&nbsp;<code>functions.php<\/code>&nbsp;file of your theme or child theme and add the tracking code like so:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1667\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/untitled\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled.jpg\" data-orig-size=\"960,540\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Untitled\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled-300x169.jpg\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled.jpg\" loading=\"lazy\" width=\"960\" height=\"540\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled.jpg\" alt=\"\" class=\"wp-image-1667\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled.jpg 960w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled-300x169.jpg 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled-768x432.jpg 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled-720x405.jpg 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled-580x326.jpg 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/Untitled-320x180.jpg 320w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/figure>\n\n\n\n<p>Be sure to change the details so it uses your own tracking code! After that, save, upload and you are done.<\/p>\n\n\n\n<h2>Installing Google Analytics via a WordPress Plugin<\/h2>\n\n\n\n<p>Of course, WordPress also gives you the ability to add Google Analytics through a plugin. There are several options and for this tutorial, we will be using&nbsp;<a href=\"https:\/\/wordpress.org\/plugins\/ga-google-analytics\/\">GA Google Analytics<\/a>. It makes connecting your site very easy, is fast and not as bloated as other plugins on the market. Plus it supports IP anonymization for GDPR compliance and other privacy settings. You will find more plugin options at the bottom and I recommend you compare to find your favorite solution.<\/p>\n\n\n\n<h3>1. Install the Plugin<\/h3>\n\n\n\n<p>In order to use the plugin, the first thing you need to do is install it on your site. For that, go to&nbsp;<em>Plugins &gt; Add New<\/em>&nbsp;and write its name into the search bar.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1668\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/install-ga-google-analytics-plugin-1024x282\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282.png\" data-orig-size=\"1024,282\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"install-ga-google-analytics-plugin-1024&#215;282\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-300x83.png\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-1024x282.png\" loading=\"lazy\" width=\"1024\" height=\"282\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-1024x282.png\" alt=\"\" class=\"wp-image-1668\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282.png 1024w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-300x83.png 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-768x212.png 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-720x198.png 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-580x160.png 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/install-ga-google-analytics-plugin-1024x282-320x88.png 320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Find it in the results list and click&nbsp;<em>Install Now<\/em>&nbsp;to start the download onto your site. Once done, hit&nbsp;<em>Activate<\/em>&nbsp;and you are done.<\/p>\n\n\n\n<h3>2. Input Tracking Code<\/h3>\n\n\n\n<p>With the plugin installed, you can find its configuration options under&nbsp;<em>Settings &gt; Google Analytics<\/em>. Alternatively, click on&nbsp;<em>Settings<\/em>&nbsp;under its name in the plugin list. Both will take you to the same screen. There, all you need to do is click on&nbsp;<em>Plugin Settings<\/em>&nbsp;either at the top or bottom to open up the settings.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1669\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/ga-google-analytics-plugin-settings-1024x735\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735.png\" data-orig-size=\"1024,735\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ga-google-analytics-plugin-settings-1024&#215;735\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-300x215.png\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-1024x735.png\" loading=\"lazy\" width=\"1024\" height=\"735\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-1024x735.png\" alt=\"\" class=\"wp-image-1669\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735.png 1024w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-300x215.png 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-768x551.png 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-720x517.png 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-580x416.png 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-plugin-settings-1024x735-320x230.png 320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> The next thing you will need is your Google Analytics Tracking ID. As mentioned, you find it in your account under&nbsp;<em>Admin &gt; Property &gt; Tracking Info &gt; Tracking Code<\/em>. This time you don\u2019t need to copy the entire code but only the ID at the top. In addition to that, pay attention to the name of your tracking code, whether it\u2019s&nbsp;<code>gtag.js<\/code>,&nbsp;<code>analytics.js<\/code>&nbsp;or&nbsp;<code>ga.js<\/code>. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1670\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/find-out-type-of-google-tracking-code-1024x237\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237.jpg\" data-orig-size=\"1024,237\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"find-out-type-of-google-tracking-code-1024&#215;237\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-300x69.jpg\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-1024x237.jpg\" loading=\"lazy\" width=\"1024\" height=\"237\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-1024x237.jpg\" alt=\"\" class=\"wp-image-1670\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237.jpg 1024w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-300x69.jpg 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-768x178.jpg 768w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-720x167.jpg 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-580x134.jpg 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/find-out-type-of-google-tracking-code-1024x237-320x74.jpg 320w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> Now go back the plugin settings on your WordPress site. Input the tracking ID at the top of the plugin settings where it says&nbsp;<em>GA Tracking ID<\/em>. After that, be sure to choose the correct tracking method according to the name of your tracking code. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-attachment-id=\"1671\" data-permalink=\"https:\/\/azoora.com\/blog\/analytics\/how-to-add-google-analytics-to-wordpress-manually-and-via-plugin\/attachment\/ga-google-analytics-input-tracking-code-and-type\/#main\" data-orig-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type.png\" data-orig-size=\"745,172\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ga-google-analytics-input-tracking-code-and-type\" data-image-description=\"\" data-medium-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type-300x69.png\" data-large-file=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type.png\" loading=\"lazy\" width=\"745\" height=\"172\" src=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type.png\" alt=\"\" class=\"wp-image-1671\" srcset=\"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type.png 745w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type-300x69.png 300w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type-720x166.png 720w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type-580x134.png 580w, https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/ga-google-analytics-input-tracking-code-and-type-320x74.png 320w\" sizes=\"(max-width: 745px) 100vw, 745px\" \/><\/figure>\n\n\n\n<h3>3. Configure the Rest of the Plugin<\/h3>\n\n\n\n<p>Once you have done that, it\u2019s time to move on to the rest of the settings. Let\u2019s go over them real quick. Not that some of the settings are only available for certain types of the Google tracking code.<\/p>\n\n\n\n<ul><li><strong>Display Advertising<\/strong>&nbsp;\u2014 This will enable Google Analytics data for the Google Display Network.<\/li><li><strong>Link Attribution<\/strong>&nbsp;\u2014 Enhanced Link Attribution is a feature that lets you track which link to the same URL users click on a single page. You can enable it here.<\/li><li><strong>IP Anonymization<\/strong>&nbsp;\u2014 Check this box to enable IP anonymization, recommended for anyone who has to obey the new GDPR.<\/li><li><strong>Force SSL<\/strong>&nbsp;\u2014 Switch this on to send all data via secure&nbsp;HTTPS connections, even if your site is not on HTTPS yet.<\/li><li><strong>Tracking Code Location<\/strong>&nbsp;\u2014 Determine whether to load your tracking code in the header or footer of your pages. Google recommends the former but moving the script to the footer can&nbsp;increase page performance.<\/li><li><strong>Custom Tracker Objects<\/strong>&nbsp;\u2014 Here you can add code to collect custom data. More information&nbsp;<a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/creating-trackers\">here<\/a>.<\/li><li><strong>Custom GA Code<\/strong>&nbsp;\u2014 Add any custom code here that you want to include in the Google Analytics tracker.<\/li><li><strong>Custom Code<\/strong>&nbsp;\u2014 If you have any other markup to execute together with the tracking code, you can input it here.<\/li><li><strong>Custom Code Location<\/strong>&nbsp;\u2014 This option lets you define whether to execute any custom code before or after the Google Analytics tracker. The default is after.<\/li><li><strong>Admin Area<\/strong>&nbsp;\u2014 Enable this to include user behavior in the WordPress admin area in your Google Analytics data.<\/li><li><strong>Admin Users<\/strong>&nbsp;\u2014 Here you can disable tracking for admin-level users on your site, I would recommend doing so.<\/li><\/ul>\n\n\n\n<p>Once you have configured everything to your liking, don\u2019t forget to save the changes for them to take effect. After that, it can take up to 48 hours before you see data in your analytics account. However, that\u2019s it. Well done, you just learned how to add Google Analytics to WordPress!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a&nbsp;website owner, something that you should definitely be familiar with is how to add Google Analytics to WordPress. Web analytics allow you to understand how visitors interact with your site. That information enables you to make improvements and create an even better user experience. For that reason, this article will show you everything you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1672,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[2,62,59],"tags":[127,110,88],"jetpack_featured_media_url":"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/02\/how-to-add-google-analytics-to-wordpress-1.png","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p7FQPL-qN","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1661"}],"collection":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/comments?post=1661"}],"version-history":[{"count":2,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1661\/revisions"}],"predecessor-version":[{"id":2284,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1661\/revisions\/2284"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media\/1672"}],"wp:attachment":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media?parent=1661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/categories?post=1661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/tags?post=1661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}