Google Analytics Drupal 8


SEO is an integral part of any website. The same holds true for Drupal as well. Fortunately, due to Drupal’s prolific community and consequently module-rich nature, getting started on SEO with it is somewhat easier as there are loads of SEO modules available for it.

However, sifting through loads of modules can get overwhelming, and this is why I’m going to help you out by highlighting the ones our team has found the most useful.

Drupal SEO Checklist

First up on our list, we’ve got the Drupal SEO Checklist module; an all-in-one SEO dashboard that checks if your site is optimized for search engines and gives you an overview of various SEO functions for the site.

Google Analytics is necessary for optimizing your website and increasing its efficiency. How to Integrate Google Analytics in Drupal 8. This step-by-step guide on how to install Google Analytics in Drupal 8 will help you improve your website in a few minutes! Create your account on Google Analytics and log in. Google Analytics is a powerful business tool that generates details statistics about a website’s traffic, traffic sources, conversions and sales. When paired with your Drupal website, Google Analytics allows user experience designers and marketers to gather important information about your website that can be used to make continuous improvements and drive positive change for your business.

Apart from that, it also breaks down the SEO tasks for you, recommends various SEO modules that further improve functionality and even keeps track of what has already been done with a date and time stamp. If you like to keep things organized, then the SEO Checklist is a must-have for you!


Pathauto is an immensely useful module that most Drupal developers swear by. Where SEO is concerned, having proper URLs to a site’s pages is essential if you want your content to rank high on SERPs.

By using Pathauto, the need to manually create proper URLs for each new node is eliminated. Instead, the module automatically generates URLs based on specific set patterns that can be customized by the user. The URLs thus generated are concise and structured in the way that the user wants. As such, the Pathauto module is a really simple solution that can do wonders for your SEO.



Imagine a situation where you make a change to an article, which also means changing the context of the URL. The thing is, that URL is already ranked on search engines - this means that if any user were to click on the ranked URL, they would be directed to a link that is no longer available.

Very likely, this would cause the user to leave your site and look elsewhere for the desired information, resulting in a detriment to your site's SEO ranking. With the Redirect module, you can easily redirect the users to the new URL. This contributes greatly towards your SEO efforts as it eliminates dead links from your site.

XML Sitemap & Simple XML Sitemap

A website’s XML sitemap is like the directory of that website. In it is defined the website’s structure, such as its URLs and the relationships between them. This makes it easier for Google’s search engine bots to crawl through such directories and hence rank them. It is highly recommended that you create a sitemap for your site in order to boost its SEO ranking.

The XML sitemap and the Simple XML sitemap modules for Drupal create such a sitemap for your Drupal site. The major difference between these two modules is that the latter was made specifically for Drupal 8; see this post for more differences between the two.


Google Analytics Drupal 8 Module


The Metatag module gives you the ability to provide more metadata to your website. This includes tags, page titles, descriptions etc. Google’s search engine uses this metadata to rank the website in search engine results.

While Drupal natively doesn’t allow editable meta tags fields, all of that can be done with the Metatag module. Using this module, the user can set meta tags for users, taxonomy, nodes, views etc.

Drupal 8 Google Analytics Opt Out

A new release of the module was made just a few days ago, resolving the issues described in SA-CORE-2019-003.

Google Analytics

While not a SEO module in and of itself, Google Analytics is a powerful tool for all aspects of a website. It helps you with monitoring traffic and keeping tabs on an extensive analysis of your site.

Whenever you perform SEO-related changes to your site, you might be curious to see what results it yields. Using the Google Analytics module for Drupal, you can integrate your Drupal site with Google Analytics and find out what results your practices bring about.


There you have it - some of the most useful modules for Drupal 8 which encompass a wide variety of SEO actions. These are also the most accessible modules for anyone wanting to get started on optimizing their Drupal site for search engines. We hope you make good use of them and succeed in upping your website’s SEO game!

Are you struggling with your Drupal site’s SEO? Need a helping hand? Contact us at Agiledrop - our extensive experience of working with Drupal enables us to provide top-notch Drupal services to our clients.

Even though installing Google Tag Manager (GTM) adds a layer of complexity, it is far more flexible (and powerful) than Google Analytics (GA) alone:

  • GTM can be set up to track advanced analytics, like Scroll Depth, Link Clicks, & Video Playback information.
  • GTM makes it easy to install custom tracking, like LinkedIn Insights or Facebook Pixel, without developer help.
  • GTM makes it easier to track transaction data, like order amount, which is essential for ROI calculations for your ad campaigns.

Drupal 8 Release

While not difficult, it does take a little time and effort to complete. Below are the steps Volacci goes through to do a Google Tag Manager install on all our clients’ Drupal websites.

Except in very special cases, you do not want to have both the Google Analytics and Google Tag Manager modules (or embedded code snippets) enabled on your site at the same time -- it can skew your Analytics. We recommend coordinating the Google Tag Manager installation & configuration with disabling your Google Analytics module. Contact your developer if you have questions on how Google Analytics is currently installed on your website -- or if you have multiple GA codes deployed, which can complicate things further.

Google Account Sign Ups

While we offer top level instructions in this section, you may need to find additional resources on the exact steps for signing up for these accounts. Google tends to change things periodically, so it’s best to find their step by step instructions. We've included links to their current instructions in this section.

  1. If you don’t already have one, sign up for a free Google Account.
    This will include a gmail account. If your company already uses Gmail for email, then you can use that Google Account. You’ll use this account for all the sign ups that follow.
  2. Sign up forGoogle Analytics for your website. When you complete this process, you will have created a property for your website on the GA admin Tracking Info > Tracking Code page. There will be a tracking code there that looks something like this:
    We recommend opening a text editor and copying and pasting this tracking ID so you have it handy for your GTM set up. You’ll be using this text document again later, so leave it open.
  3. Create a Google Search Console (GSC) account for your website. This account will track organic (search) traffic to your website and can also be integrated into your Google Analytics (GA) account.
    For information on integrating GSC into your GA account, go here for their detailed instructions.
  4. Set up your website’s Google Tag Manageraccount.
  5. Fill out the Account Name and Container name fields with your organization’s and website’s information, and select “Web” under Target platform.
  6. Click Create, agree to the terms of service and GDPR rules, and you should be presented with a pop up window containing two different code snippets. The top one will look like this:
  7. Highlight the GTM-XXXXXXX number as we have in the example above.
  8. Copy and paste that number into the same text editor you placed your Google Analytics tracking ID.
  9. Deploy Google Analytics using Google Tag Manager by following Google's instructions. NOTE: You’ll need the UA-XXXXXXX-1 number you pasted into your text document for this step.
  10. Submit your XML Sitemap to Google by following Google's instructions.

Install The Google Tag Manager Module

You may need to get help from your developer with this process. Contact them should you have any questions or issues. Sending along a link to this page could help speed things up.

  1. Make a backup of your website. If something goes wrong, you’ll need to restore your website from a backup.
  2. Install the Google Tag Manager module available here:
    NOTE: Drupal module installation instructions can be found here:
  3. Once the module is installed, make sure it’s enabled by going to the Extend page of your website: Click Manage > Extend or visit
    Note: if you are using Drupal 7, you may need to consult the D7 specific instructions.

  4. In the search box, enter “google tag” to find the Google Tag Manager module.
    • If the check box next to the module is checked, then the module has been enabled and is ready for configuration. Move on to Configure The Google Tag Manager Module.
    • If the check box next to the module is not checked, it will need to be enabled.

      If you have permissions to enable a module, you can select the check box next to the module, and click the Install button at the bottom of the page.

      NOTE: If you do not have permissions to enable the module, you’ll need to contact your web developer to enable it and give you the appropriate permissions to install and configure the GTM module.

Configure The Google Tag Manager Module

Make sure you have that text document handy that contains the GTM container ID that was generated above.

Google Analytics Drupal 8

  1. On your Drupal site, go to Manage > Configuration > System > Google Tag Manager or visit http://<>/admin/config/system/google-tag in your browser.
    This will take you to the Google Tag Manager containers page.

  2. Click on the + Add container button. This will take you to the Add container page.
  3. Enter a relevant name in the Label field.
  4. In the Container ID field, enter the Container ID (GTM-XXXXXXX) you copied from Google Tag Manager.
  5. Leave all other settings at their default.
  6. Click the Save button at the bottom of the page.

Testing Your Installation

We recommend testing to make sure your Google Tag Manager is properly installed and configured. Here at Volacci, we test in several different ways using the Chrome browser. If you use a different browser, some of these methods may not work.

  1. Go into the Google Tag Manager workspace for your website and follow Google's instructions for testing with Preview mode.
  2. Install Google Tag Assistant within your Chrome browser.
    For additional information on how to use Google Tag Assistant for testing and troubleshooting your Google product installations, visit Google's support page

There you have it. You should be all set to gather Google Analytics data and make deployment of 3rd party scripts to your website much easier.

We always try to make sure our posts are as accurate and up to date as possible. If you find something is wrong, or you have a question, please feel free to contact us with any questions or feedback you might have.

And remember, Volacci stands ready to help you implement your Google Tag Manager and Google Analytics should you need us to.

Google Analytics Download Data

Did you like this walkthrough? Please tell your friends about it!