Bobcares

How to add GTM to Drupal

by | Jan 7, 2023

Here is a step-by-step guide to help you add GTM to Drupal. Our Server Management Support team is here to lend a hand with your queries and issues.

How to add GTM to a Drupal website

GTM or Google Tag Manager can be described as a tag management system that enables us to update measurement codes as well as code fragments to our website or mobile app easily and quickly.

Today, our experts are going to demonstrate how to add Google Tag Manager to Drupal.

  1. First, we have to download the GTM module with this command:

    composer require 'drupal/google_tag:^1.4'

  2. Then, we have to head to the admin toolbar and navigate to System under Configurations. Then select Google Tag Manager.
  3. Next, select Google Tag Manager, this will take us to a container page.
  4. After that, click the Add Container button, here we have to add the Container ID that we had created earlier when we signed up with Google Tag Manager. https://tagmanager.google.com/
  5. Then, head to Account setup and enter the Account name as well as the Country name.
  6. After that, enter the Container name and choose the target platform under Container Setup.
  7. Finally, click the Create button.
  8. At this point, we will see a popup screen that displays the code snippet that has to go in the head section. We can get the Container ID from this code. It will be an alphanumeric word that begins with GTM as seen below:

     add GTM to Drupal

  9. Now, we have to head back to the Drupal setup and add the container ID. Add a name for the container in the Label field and paste the Container ID we got in the previous step in the Container ID field. Then save the configuration.
  10. Finally, we can verify of the process has been successful by heading to the home page of our website and selecting “Inspect Element”. If successful, we will be able to see GTM within the head tag.

[Need assistance with a different issue? Our team is just a click away.]

Conclusion

To sum up, our Support Engineers demonstrated how to add GTM to a Drupal website with ease.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.