Here Is How You Install Google Tag Manager on Drupal

Now you didn't think that precisely a powerful Google tool like Google Tag Manager would be left out of the Drupal 8's whole “constellation” of modules now did you? Not only that there's a dedicated module for it (although, for the time being, available in GitHub only), but the whole installation process is nothing but a sequence of a few highly intuitive steps to take. A click here, a click there, entering a name or two, copying and pasting an ID and that's pretty much it. The whole process's summary! You'll have your GTM integrated on your Drupal website in no time! But let's cut it short: here is my step-by-step guide on how to install Google Tag Manager on Drupal:

What Is Google Tag Manager and What Makes it an Essential Tool?

Not only that it's a free-to-use Google tool, accessible to anyone, but it's also an “easy to use” empowering tool. And that's precisely what it does: it empowers you to manage your own tags (tracking pixels or snippets of code) without the need to get “get your hands dirty” with code. To rewrite or simply to edit at least line or two in order to make it work. 

No need for that! No need to be a “coding guru” to handle your tags in Drupal anymore!

Another “life savior” benefit that you can “reap”: you'll practically have all your marketing tags stored in one place!

And there's more! It also comes with a friendly UI so that anyone in your team, irrespective of his/her role (whether he's a developer, a digital marketer, an editor or a site administrator) can easily use it and rapidly integrate it into their work.

OK, "tags", but what precisely can I track using Google Tag Manager?” you might ask. Well, here's a short list:

  • shopping cart abandonment

     
  • all types of key events happening on your website (link clicks, add to cart links etc.)

     
  • form abandonment 

     
  • etc.

Install the Google_Tag Module on Your Drupal Site

Before you rush in to Google Tag Manager page, you should take some time (not much) to install and then to enable your correspondent Drupal module: google_tag.

It's a more than straightforward module installation process:  

  • download your module from GitHub 

     
  • use your admin credentials to login to your Drupal site

     
  • one you're on your admin panel go to the “Extend” tab

     
  • click on the “Install new”

     
  • next simply upload the zip file you've just at step 1

And that's it! Just enable your module after the installation process is complete and... jump straight to the next step!
How to Install the Google_Tag Module  

Create Your Account in Google Tag Manager

Pretty obvious right? You couldn't possibly start to install Google Tag Manager on Drupal without first setting up an account on this specific Google tool's page.

Just use your Google account credentials to log in and then go to "Create Account". Name it as you wish, but I would recommend you to go for something as relevant as your own brand's (or your client's) or your company's name.

Once you've created your account on Google Tag Manager, you'll need to enter a name and pick a location for the container (the “Container Setup” section on the same page) the one that will, eventually, carry all your tags. 

Next: just click the “Create” button.
Create Your Account in Google Tag Manager

Copy Your Container ID

Now you're looking at a pop-up window displaying code snippets! Go ahead and select and copy copy only the container ID from the entire code snippet that you have there: “GTM-TQQ9SQ3”.

Configure Your google_tag Module

Next go into your Drupal website: ConfigurationGoogle Tag ManagerContainer ID. There, into “Container ID”, paste your previously copied ID and then just click on the blue, left-side “Save configuration” button (it's so large that you can't possibly miss it!).

How to Configure Your Google_tag Module

Check If You've Managed to Install Google Tag Manager on Drupal

Luckily, you have a more than useful tool for that: the inspect element option!

Here's where you'll find it and how you can trigger its use:

Go on your Drupal site's homepage→right click on inspect element from the context menu→next simply look for “Google Tag Manager” in the window that opens up, performing a quick quick scan on the script there. Can you spot it?

And this is just one more strong proof of how Drupal modules are built with the very goal of easing our lives (as Drupal developers) in mind!

Now Connect Your Google Tag Manager with Google Analytics

Not only that Google empowers you with a whole set of free-to-use and easy to use (and to install) tools aimed at simplifying your whole designing and managing your web resources job, but it makes it easy for you to implement one via the other.

Like our case here: as your Drupal website's admin you can easily implement Google Analytics via the Google Tag manager tool that you've just installed on your site.

Here's how:

1. Head to your Google Tag manager account

2. Once there, look for “WORKPLACE” 

3. Next Go to "Tags"→"New"→"Name Your Tag"→"Tag Configuration"→Select "Universal Analytics" (that you'll find listed in FEATURED)

4. Login to your Google Analytics account→"Properties"→"Basic Settings"→"Tracking ID"

5. Copy your Tracking ID→ paste it into your Google Tag Manager's Tag configuration→click "Save"

And there you have it! You've just connected your Google Analytics account with your Google Tag Manager tool! A more than straightforward process, don't you think? 

Now, with these two Google “powers” combined, you can easily store, handle and customize, through Google Tag Manager, all the data that will be sent to your Google Analytics to be turned into some insightful reports. And this is what I call “customized traffic monitoring”.

As usual, if I haven't managed to make my step-by-step guides clear enough, do leave a comment below “scolding” me for that and I'll take the due measure. The same applies if you encounter any sort of problems as you venture to install Google Tag Manager on Drupal: leave me a note here and I'll do my best to lend you a hand!