{"id":84207,"date":"2018-02-28T04:04:40","date_gmt":"2018-02-28T09:04:40","guid":{"rendered":"https:\/\/www.templatemonster.com\/help\/?p=84207"},"modified":"2018-02-28T04:04:40","modified_gmt":"2018-02-28T09:04:40","slug":"how-to-install-google-analytics-on-wordpress","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/how-to-install-google-analytics-on-wordpress.html","title":{"rendered":"How to install Google Analytics on WordPress"},"content":{"rendered":"<p>Starting your website you could have three crucial questions:<\/p>\r\n<ol>\r\n<li><p>Who is visiting your site? <\/p><\/li>\r\n<li><p>What posts are the most popular?<\/p><\/li>\r\n<li><p>And how people interact with your site?<\/p><\/li>\r\n<\/ol>\r\n<p>We are going to show you how to gather that information in this tutorial. To get that info, you can use Google Analytics. There are different ways to use Google Analytics on your website. We will discuss them further.<\/p>\r\n<h3 class=\"custom\">How to get Google Analytics code?<\/h3>\r\n<ol>\r\n  <li>\r\n    <p>The first step is Google Analytics account setup. Please, visit <a href=\"https:\/\/analytics.google.com\/analytics\/web\/\" target=\"_blank\">Google Analytics Signup page<\/a>. If you already have Gmail account, you can use it to sign in.<\/p><\/li>\r\n  <li>\r\n    <p>You will see the following page on your screen. Click on <strong>Sign Up<\/strong> button.<\/p>\r\n\t\r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_1.jpg\" alt=\"\" width=\"1024\" height=\"439\" class=\"alignnone size-full wp-image-84208\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_1.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_1-150x64.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_1-300x129.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_1-768x329.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a>\r\n\t \r\n\t <\/li>\r\n    <li>\r\n      <p>Now you can proceed to the next step. Click <strong>Website<\/strong> tab on the page you see and start entering your account information:<\/p>\r\n      <ul class=\"list\">\r\n      <li>\r\n        <p>Account Name;<\/p><\/li>\r\n      <li>\r\n        <p>Website Name;<\/p><\/li>\r\n      <li>\r\n        <p>Website URL;<\/p><\/li>\r\n      <\/ul>\r\n\t  \r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_2.jpg\" alt=\"\" width=\"1024\" height=\"807\" class=\"alignnone size-full wp-image-84209\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_2.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_2-150x118.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_2-300x236.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_2-768x605.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a>\t  \r\n\t  <\/li>\r\n      <li>\r\n        <p>Once you are ready, click on the <strong>Get Tracking ID<\/strong> button to get Google Analytics tracking code. You will see the &#8216;Terms and conditions&#8217; pop-up, click on the <strong>I Agree<\/strong> button to be able to get the code.<\/p><\/li>\r\n        <li>\r\n          <p>You can see Google Analytics code now. Copy it to paste it into your website. You can leave this page opened to be able to get this code easily.<\/p>\r\n\t\t  \r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_3.jpg\" alt=\"\" width=\"1024\" height=\"464\" class=\"alignnone size-full wp-image-84210\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_3.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_3-150x68.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_3-300x136.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_3-768x348.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a>\t\t  \r\n\t\t  <\/li>\r\n<\/ol>\r\n<h3 class=\"custom\">How to insert Google Analytics code?<\/h3>\r\n<p>We already mentioned that there are several ways to add Google Analytics Tracking code to WordPress website. So what are they?<\/p>\r\n<ol>\r\n<li>\r\n  <p><strong>Using MonsterInsights plugin<\/strong>.<\/p> \r\n  <ul class=\"list\">\r\n  <li>\r\n    <p>To install MonsterInsights plugin, log into your WordPress admin panel, and navigate to <strong>Plugins<\/strong> &gt; <strong>Add New<\/strong> section. Enter <a href=\"https:\/\/wordpress.org\/plugins\/google-analytics-for-wordpress\/\" target=\"_blank\" rel=\"nofollow\"><strong>Google Analytics by MonsterInsights<\/strong><\/a> into the search field.<\/p><\/li>\r\n    <li><p>Install and activate the plugin.<\/p><\/li>\r\n    <li>\r\n      <p>Navigate to <strong>Insights<\/strong> > <strong>Dashboard<\/strong> section in your backend and authenticate your website with Google Analytics by clicking the <strong>Authenticate with your Google account<\/strong> button.<\/p>\r\n      \t  \r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_4.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_4.jpg\" alt=\"\" width=\"1024\" height=\"747\" class=\"alignnone size-full wp-image-84211\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_4.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_4-150x109.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_4-300x219.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_4-768x560.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a>\t  \r\n\t  <\/li>\r\n      <li><p>Click <strong>To Get Google Code<\/strong> button in the pop-up. Give MonsterInsights access to your Google Analytics data by clicking <strong>Allow<\/strong>. Copy the code and switch to your application to paste it.<\/p>\r\n      \r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_5.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_5.jpg\" alt=\"\" width=\"403\" height=\"588\" class=\"alignnone size-full wp-image-84212\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_5.jpg 403w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_5-103x150.jpg 103w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_5-206x300.jpg 206w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/a>\t  \r\n\t  <\/li>\r\n      <li>\r\n        <p>Select your account from <strong>Select the Google Analytics Profile to Use<\/strong> drop-down and click the <strong>Close<\/strong> button.<\/p>\r\n\t\t\r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_6.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_6.jpg\" alt=\"\" width=\"409\" height=\"595\" class=\"alignnone size-full wp-image-84213\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_6.jpg 409w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_6-103x150.jpg 103w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_6-206x300.jpg 206w\" sizes=\"(max-width: 409px) 100vw, 409px\" \/><\/a>\r\n\t\t<\/li>\r\n      <li>\r\n        <p>Now, visit <strong>Insights<\/strong> > <strong>Dashboard<\/strong> to see Google Analytics data. You may need to wait up to 24 hours to get data populated there.<\/p>\r\n      <\/li>\r\n  <\/ul>\r\n<\/li>\r\n<li>\r\n  <p><strong>Using Insert Headers and Footers Plugin plugin<\/strong>.<\/p>\r\n  <ul class=\"list\">\r\n  <li>\r\n    <p>Open the <strong>Plugins<\/strong> > <strong>Add New<\/strong> page and search for the <a href=\"https:\/\/wordpress.org\/plugins\/insert-headers-and-footers\/\" target=\"_blank\" rel=\"nofollow\">Insert Headers and Footers Plugin<\/a>. Install and activate it.<\/p><\/li>\r\n  <li><p>Navigate to <strong>Settings<\/strong> > <strong>Insert Headers and Footers<\/strong> page. <\/p><\/li>\r\n  <li>\r\n    <p>Here you need to paste Google Analytics code into the header or footer box.<\/p>\r\n\t\r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_7.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_7.jpg\" alt=\"\" width=\"1024\" height=\"788\" class=\"alignnone size-full wp-image-84214\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_7.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_7-150x115.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_7-300x231.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_7-768x591.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a>\t\r\n\t<\/li>\r\n    <li><p>Click &#8216;Save&#8217; to save the changes.<\/p><\/li>\r\n  <\/ul><\/li>\r\n<li>\r\n  <p><strong>Insert Google Analytics tracking code to the theme files<\/strong>. You can do that in case you don&#8217;t want to use additional plugins or if you&#8217;re familiar with the code. There are 2 ways to add code:<\/p>\r\n  <ul class=\"list\">\r\n  <li>\r\n    <p>Simply edit the <strong>header.php<\/strong> file under <strong>Appearance<\/strong> > <strong>Editor<\/strong> section in your WordPress dashboard.<\/p>\r\n    <p>Enter the code just after the <strong>&lt;body&gt;<\/strong> tag and click on the <strong>Update file<\/strong> button to save the changes.<\/p>\r\n\t\r\n<a class=\"darkbox\" href=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_8.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_8.jpg\" alt=\"\" width=\"1024\" height=\"714\" class=\"alignnone size-full wp-image-84215\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_8.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_8-150x105.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_8-300x209.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2018\/02\/How_to_install_Google_Analytics_on_WordPress_8-768x536.jpg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a>\t\r\n\t<\/li>\r\n  <li><p>Or you can modify theme <strong>functions.php<\/strong> file. You can access it from the same <strong>Editor<\/strong> page. Use following function to add Google Analytics tracking code:<\/p>\r\n  <pre class=\"brush:php\">\r\n   &lt;?php\r\n    add_action('wp_head', 'wpb_add_googleanalytics');\r\n    function wpb_add_googleanalytics() {?&gt;\r\n    \/\/ Paste your Google Analytics code \r\n  &lt;?php } ?&gt;\r\n    <\/pre>\r\n    <p>Where <strong>\/\/ Paste your Google Analytics code<\/strong> is your Google Analytics code.<\/p>\r\n  <\/li>\r\n  <\/ul>\r\n<\/li>\r\n<\/ol>\r\n<p>That is it! You know how to install Google Analytics on WordPress now.<\/p>\r\n<p>We would also suggest you to check out the latest collection of <a href=\"https:\/\/www.templatemonster.com\/wordpress-themes.php\">WordPress themes<\/a> to build your very own website.<\/p>","protected":false},"excerpt":{"rendered":"<p>There are different ways to use Google Analytics on your website. We will discuss them in this guide.<\/p>\n","protected":false},"author":55,"featured_media":84216,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2017,728],"tags":[2187,1044],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/84207"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=84207"}],"version-history":[{"count":4,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/84207\/revisions"}],"predecessor-version":[{"id":84252,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/84207\/revisions\/84252"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/84216"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=84207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=84207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=84207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}