Google Analytics Drupal CMS

How To Add Google Analytics To Drupal Sites

Before we discuss how to add Google Analytics to Drupal, we wanted to first explain the importance of Google Analytics. We’ve met established businesses, marketing directors, and web developers that’ll completely forget to connect the Google Analytics code to their Drupal website.

Google Analytics should be added to your Drupal website once you’re prepared to launch it on your main domain account, so please ensure your hosting environment is ready to go. At our web design agency, we do not add the Google Analytics code during the coding process since the website is still a work in progress, which means the public isn’t ready to view it.

Thankfully, we will share a detailed method you can easily follow, our team utilizes this specific method to implement Google Analytics to any Drupal site. There’s clearly several techniques you’ll find online when it comes to adding Google Analytics to Drupal, so the method we will discuss will only take a few minutes of your time, and you’re following Drupal’s best practices.

In this blog post tutorial, our team will discuss the key points of Google Analytics, how to signup, and how to add it to your Drupal website within minutes…and don’t worry, zero Drupal development knowledge is required!

Let’s jump right to it- grab your cup of coffee and continue reading below on how to setup Google Analytics to Drupal. (shhh, don’t tell your boss or client you’re using this blog post).

Benefits of Adding Google Analytics to Drupal

By directly adding the Google Analytics code to Drupal backend, you’ll unlock useful data relating to your Drupal environment. A few benefits of utilizing the analytics data include:

  • Location of website visitors, which include both prospective and current customers. This data will display where visitors are originating from. It will reveal key traffic referral sources such as Google search and PPC ads, social media sites, news articles, etc. This data is extremely beneficial so your marketing budget can be allocated to the right channels.
  • Locating your most popular nodes– high traffic website pages, blog posts, etc. With the ability to locate your most popular website content, you’ll be well prepared to implement and constantly enhance your content marketing strategies based on popular topics.
  • User experience audit. By having specific data relating to website behavior, you’ll easily expose a variety of issues that could be ultimately affecting your marketing efforts. These issues could range from a broken website link to non-functional buttons on your Drupal site that may affect conversions.
  • Google Analytics Goals. Within the Analytics system, you also have the ability to track website conversions, which is usually an advanced task and not always required, but helpful as it’ll display detailed information which can benefit an e-commerce based website.

How to Signup with Google Analytics

Google Analytics is completely free of charge, but you’ll need a registered Google account, so basically, if you have a Gmail account, you qualify. The entire sign-up process is quite straightforward- please review our detailed instructions below to get your Google Analytics account setup.

Step 1: To start, you’ll need to visit the Google Analytics website so you can begin the setup process. You’ll instantly be asked to login with your Google account, if you haven’t already signed in, so please do so when prompted.

If you’ve already logged into your Google or Gmail account, then you can continue to follow the steps below to complete the process. If you don’t have an account yet, you’ll need to create one to fully setup Google Analytics on your Drupal site.

Step 2: Make sure to click on the blue button that says, Start measuring, which will then take you to the next page, Create Account. At this point, Google will require you to input an account name which signifies your account so Analytics is tracking data accordingly.

Step 3: On the next page, you’ll need to provide a property name, select your specific time zone, and currency, and finally, complete the “about your business” section.

After you’ve finished these sections, please go ahead and click on the Create button. At this stage, if you’ve followed the steps, you’ll see a message displaying the Google Analytics TOS agreement, which you must fully agree to…so please read the terms and then click the “I Accept” button, if you agree for the terms of service.

Step 4: On this screen, you’ll need to select a specific platform, so it’s important to select “Web” since this is for your Drupal website, and finally, you’ll need to input your website URL and finish that section.

You’ll now see a new screen appear with the Google Analytics tracking code, which you can finally set up using one of the user-friendly methods below…

(Tip: our team recommends leaving this page open so you can easily access the code, if needed.)

Congrats – you’ve now set up a Google Analytics account – let’s show you how to add Google Analytics on your Drupal site with the following methods listed below.

How to Install Google Analytics on Drupal

1. Drupal Module

One of the quickest ways to add Google Analytics to your Drupal site is by installing and configuring the Google Analytics Module which was specifically developed for Drupal websites.

This is a fairly-straightforward task, our team recommends installing the module directly from your Drupal backend. We will discuss step-by-step how to properly set up the module to ensure Google Analytics is working on your Drupal site.

This module connects your Google Analytics account to your Drupal website with a user-friendly process so you can easily view key website data without any technical knowledge.

Please note, by installing the Google Analytics module, you do not need to edit your Drupal theme files.

Steps to follow:

Login to your Drupal website and click on Extend, which is located on the left-side bar. Select the blue button, Add new module. Upload the module by choosing the Google Analytics zip file which can be downloaded from this Drupal page (if you haven’t already downloaded it yet). Click on the continue button to ensure the process is fully complete.

You’ll now need to go back to the Extend page and locate the Google Analytics module, then select the checkbox next to it and then select the blue Install button. You should now be presented with a message that says, “Module Google Analytics has been enabled”

See our screenshot below…

How To Add Google Analytics to Drupal

At this point, you’ve enabled the Google Analytics module, so you can select the configure button to continue the setup process.

Google Analytics configure button

Finally, input your Google Analytics Property ID and select the blue, Save configuration, button which is located at the bottom of your page (please don’t forget to save it as this is a common mistake). Have issues locating your Property ID? It is located within your Google Analytics account, typically, it can be found in the Property Settings section.

How to Install Google Analytics on Drupal

If you thoroughly went through the steps and configured the module correctly, you’ll see valuable data shown in your Google Analytics dashboard. Of course, this may take up to 24 hours or a few days, as Google is processing your website structure.

Add it to Your Drupal Site!

If you’ve made it through this entire tutorial and still haven’t configured Google Analytics on your Drupal site, then I’d definitely recommend grabbing your second or third cup of coffee, and immediately starting this task.

If your business needs assistance with adding Google Analytics to your Drupal site, please feel free to contact our web design agency for Drupal support!

Here are useful articles we wrote that are relevant to any Drupal project:

WordPress vs Drupal

Importance of Website Speed

Advantages of HTTPS