0

If we have Google Analytics module set up with a UA id and also wish to do some custom click tracking set up with GTM.

For one, is using both codes allowed or should be done? (UA-xxxx via Google Analytics module and GTM code in html.twig template).

Secondly, if I only create a specific click event tracking on a button in GTM (no page views tracking). Would this still cause any duplication issues. Logic says no, but not sure about the basic level of tracking simply by adding the tag scripts.

Any clarity would be great.

Thanks in advance guys.

1 Answer 1

1

Do not mix the Google Analytics module's javascript with the GTM javascript on the same site. This will create a mess and you'll probably get duplicate tracking, plus you'll bloat your pages.

Instead, use GTM for everything. One of the "tags" that Google Tag Manager "manages" is Google Analytics, so this is the best approach.

Uninstall the Google Analytics module from your site and use the GoogleTagManager module instead.

You can set up UA inside GTM from within the GTM admin UI.

Also, if this is a new site, consider upgrading to GA4 instead of UA because UA has been sunset.

3
  • Using GA via GTM is not perfect too, a lot of traffic is cut out by ad blockers (as gtm.js is the first thing to turn off). Jul 4, 2022 at 8:02
  • 1
    @GrzegorzPietrzak Do you have a source for ad blockers that block GTM but not GA? Jul 4, 2022 at 8:13
  • I don't know which adblockers are responsible for this, but every time I change pure GA to GA/GTM, I see significant drop in statistics. So probably one of the popular lists is not cutting off GA, as it is not related to ads at all. Jul 4, 2022 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.