0

Module : https://www.drupal.org/project/google_tag

The only difference and advantage I can see is , from the GTM module the variables will be automatically created while on standard GTM , all variables will need to be created automatically.

Referred this : https://www.bounteous.com/insights/2019/01/11/drupal-friendly-google-tag-manager-configuration-datalayer-module/

I'm may be wrong, can anyone explain me the difference and the advantage over each other?

1 Answers1

1

The GTM module does not create a dataLayer, unless you also install the dataLayer module (it is typical for Drupal to put related functionality into separate modules).

The advantage of using a module, as opposed to e.g. place the GTM snippet into your template, is that it gives you more control - you can exclude the GTM snippets from certain paths (e.g. GTM is usually not needed when you add or edit posts).

You can also exclude the GTM snippet for certain user groups - e.g. if you use GTM for marketing pixels you can chose not to display GTM for your logged in editors and site admins.

It is true, however, that you can do almost the same thing with exception triggers in GTM ("almost" because GTM has to load for that, while with the module you can block GTM from loading completely).

A possible advantage of inserting the snippet in your template would be that you are not restrained by the position of web hooks and can place it so you can do Google search console verification (plus I don't know if Drupal has become better at maintaining modules, but it used to be that modules fell into disarray pretty quickly, so if you can dispense with a module or two it might be of advantage).

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62