{"id":59297,"date":"2023-10-29T15:52:36","date_gmt":"2023-10-29T10:22:36","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=59297"},"modified":"2023-11-03T15:59:59","modified_gmt":"2023-11-03T10:29:59","slug":"add-google-analytics-to-your-drupal-website","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/add-google-analytics-to-your-drupal-website\/","title":{"rendered":"Add Google Analytics to your Drupal website"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>Google Analytics is a web analytics service offered by Google that allows website owners and marketers to track and analyze various aspects of their website&#8217;s performance and user behavior. It provides valuable insights into how users interact with a website, what content they engage with, where they come from, and much more. Google Analytics helps businesses and website owners make data-driven decisions to improve their online presence and user experience.<\/p>\n<p>Drupal provides its users with Google Analytics module (https:\/\/www.drupal.org\/project\/google_analytics).<\/p>\n<h3>Installation and configuration of Google analytics module<\/h3>\n<p><strong>Step 1:<\/strong>&#8211;\u00a0 To add your Drupal website to Google Analytics, we need to get the tracking or measurement id for which the user should log into the Google Analytics account (https:\/\/analytics.google.com\/)<\/p>\n<p><strong>Step 2:<\/strong>&#8211; Add your Drupal website to the google analytics and get your tracking id as shown in the screenshot<img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59293\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-14-59.png\" alt=\"\" width=\"747\" height=\"378\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-14-59.png 960w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-14-59-300x152.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-14-59-768x389.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-14-59-624x316.png 624w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59294\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-15-19.png\" alt=\"\" width=\"751\" height=\"166\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-15-19.png 956w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-15-19-300x66.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-15-19-768x170.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-15-19-624x138.png 624w\" sizes=\"(max-width: 751px) 100vw, 751px\" \/><\/p>\n<p><strong>Step 3:<\/strong>&#8211; Install the module like any other Drupal module using composer command and enable it using either drush or manually with the help of Drupal\u2019s UI as shown in the screenshot below:-<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft size-full wp-image-59291\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-52-34.png\" alt=\"\" width=\"443\" height=\"29\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-52-34.png 443w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-52-34-300x20.png 300w\" sizes=\"(max-width: 443px) 100vw, 443px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59292\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-56-27.png\" alt=\"\" width=\"648\" height=\"176\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-56-27.png 775w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-56-27-300x82.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-56-27-768x209.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-07-56-27-624x170.png 624w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step 4:-<\/strong> After the successful installation of the module, navigate to <strong>Configuration -&gt; Google Analytics\u00a0<\/strong>and paste your tracking\/measurement id copied before.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59295\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-26-23.png\" alt=\"\" width=\"743\" height=\"342\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-26-23.png 1220w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-26-23-300x138.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-26-23-1024x472.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-26-23-768x354.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-26-23-624x287.png 624w\" sizes=\"(max-width: 743px) 100vw, 743px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step 5:-<\/strong> To test the successful integration, move to real time tab in your google analytics account and click on overview where you can see the traffic data of your site.<\/p>\n<h2><img decoding=\"async\" loading=\"lazy\" class=\"alignleft wp-image-59296\" src=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-31-29.png\" alt=\"\" width=\"755\" height=\"369\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-31-29.png 1312w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-31-29-300x147.png 300w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-31-29-1024x501.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-31-29-768x376.png 768w, \/blog\/wp-ttn-blog\/uploads\/2023\/10\/Screenshot-from-2023-10-30-08-31-29-624x305.png 624w\" sizes=\"(max-width: 755px) 100vw, 755px\" \/><\/h2>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>To put it in a nutshell, we have thoroughly learnt the integration of Google Analytics (an excellent free tool) with Drupal which can help in website optimization, improve user experience, improve site&#8217;s ranking, set marketing goals and many more.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Introduction Google Analytics is a web analytics service offered by Google that allows website owners and marketers to track and analyze various aspects of their website&#8217;s performance and user behavior. It provides valuable insights into how users interact with a website, what content they engage with, where they come from, and much more. Google Analytics [&hellip;]<\/p>\n","protected":false},"author":1533,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3},"categories":[3602],"tags":[4862,4948],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59297"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1533"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=59297"}],"version-history":[{"count":3,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59297\/revisions"}],"predecessor-version":[{"id":59352,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/59297\/revisions\/59352"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=59297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=59297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=59297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}