This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

📣 Try the fastest hosting platform with pay-as-you-go pricing & 24/7 expert support! MIGRATE NOW →

How To Add Google Analytics On Drupal 8 Using A Module

Updated on August 12, 2022

4 Min Read

For any website administrator, the number of visitors is the most important number of all. For many people, this is the only number that really matters. Traffic on a website and other related metrics are extremely useful indicators of the popularity of a website. Using Google Analytics for Drupal 8 can be the perfect solution.

Google Analytics is one of the best tools for measuring and analyzing traffic on a website. This all-purpose tool provides real-time updates about the number of visitors on your website. In addition, Google Analytics provide very detailed information about the visitors, including where they are from and how much time they have spent on individual web pages. In its reports, Google Analytics could track and present hundreds of visitor-focused parameters.

In this tutorial, I will take you through the process of setting up Google Analytics on Drupal 8 website. While embedding Google Analytics on a standard website is a pretty straight-forward process, things could get a bit complicated in the case of a feature-rich CMS Drupal.

What is Google Analytics with Drupal?

Drupal, at its core, is a content management system (CMS), meaning that it gives you the tools to structure and oversee your content. It also allows you to construct adaptable content publishing workflows and all sorts of dynamic features around that content.

Drupal analytics give simple built-in JavaScript tracking inclusion/exclusion by page, client parts, and particular clients. It’ll also be pluggable, so you can utilize the same tracking settings over elective analytics services/sub-modules like Google Analytics.

Google Analytics with Drupal is the foremost popular tool for tracking your web page visits, utilized by millions of websites worldwide. Integration with Google statistics is the basic and essential function of each CMS, which implies it is additionally accessible in Drupal – you’ll be able to empower it with the google_analytics module.

Stop Wasting Time on Servers

Cloudways handles server management so you can focus on creating great apps and keeping your clients happy.

Step 1: Log in to Google Analytics

The very first thing you need to do is add your Drupal website to Google Analytics. For this, log into the Google Analytics account.

Google login

Step 2: Add Your Drupal Website to Google Analytics

Drupal site to GA

After filling in all the details, click the Get Tracking ID button. This will bring you to the next screen, where you will receive the tracking ID and the script to embed into your website. Leave the tab open!

Step 3: Log in to Your Drupal Website

Once you are done with the Google Analytics website, log in to your Drupal website using the admin credentials.


Step 4: Install the Google Analytics Module

Go to the Google Analytics module page, install it, and enable it. Make sure you select the Drupal 8 version of the module for your Drupal 8 website.


Step 5: Get the Tracking ID of Your Website

Go back to the Google Analytics tab and copy the Tracking ID from the Property Settings tab.

Tracking ID of GA

Step 6: Configure the Google Analytics Module

Now go back to your Drupal website and configure the Google Analytics module by following the steps below:

  • Navigate to Configuration > Google Analytics.
  • Paste the Tracking ID you got from the Google Analytics account in the field for Web Property ID.
  • Set additional settings and save the configuration.
  • The Google Analytics setup is now complete.

Step 7: Test the Installation

To test the installation, go to your Google Analytics account. Click the real-time tab and select Overview. In the case of successful Google Analytics installation and setup, you will see the traffic statistic for your Drupal website.

Test the Installation google analytics

Conclusion: Start Tracking Your Visitors

The real power of Drupal lies in its very optimized utilization of modules. As you can see from the steps in this tutorial, what would have been a complex installation procedure is made extremely simple by the module that adds Google Analytics on Drupal 8. If you found this blog post useful, you might like to check out another post by us on: Speed Up Drupal Websites With Google AMP. a topic intertwined with the efficacy of Drupal hosting. For queries or feedback, don’t hesitate to share your thoughts in the comments section.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Inshal Ali

Inshal is a Content Marketer at Cloudways. With background in computer science, skill of content and a whole lot of creativity, he helps business reach the sky and go beyond through content that speaks the language of their customers. Apart from work, you will see him mostly in some online games or on a football field.


Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!


Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour


  • 0


  • 0


  • 0


  • 0



For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now