How to install Google Tag Manager in Drupal8

Google Tag Manager is the main tool for managing tracking scripts on our websites. Once installed on our Drupal website it allows us to add, edit or delete tracking scripts without to touch the website. If you want to know more about Google Tag Manager please read this article.

With first search I found two different modules. They both do same thing - add Google Tag Manager to our Drupal8 website.

I will select the first one - GoogleTagManager.

first moduleupdate manager

Recording to the project information this module was downloaded more than 570,665 times and 40,705 websites have it installed. The last release is from 6th December 2019.

My recomandation to you is always to select trusted and well supported contribute modules for your Drupal website.

To enable "Install new module" option in our Drupal8 website we need to install the "Update Manager" module.

update managerinstall new module

Now let's install the module. First copy the installation link (you can select from two archive types - tar.gz or zip) and then paste it in "Install from a URL" field.

copy pathpaste path

After installation finish we need to activate newlly installed Drupal module. Let's open "Extend" section and type "google tag manager" in the search field. Select the checkbox and click "Install" button.

enable module

Now we have the module installed, let's add a container. Click "Add container" and give it a name.

google tag manageredit google tag manager container

The final step is to fill in your Google Tag Manager ID. You can manage also other settings from this page.

enable module

You are ready to use Google Tag Manager in your Drupal8 website.

We hope this article was helpful.