nuxt-community / gtm-module

Google Tag Manager Module for Nuxt.js
MIT License
327 stars 70 forks source link

How to add google site tag/Google Adwords? #41

Open Jones-S opened 4 years ago

Jones-S commented 4 years ago

Hi there

I need to add Google Adword Tracking stuff to a site. So far I have a Google Tag Manager implemented. (ID: GTM...)

I now should add another code (the AW-CONVERSION_ID) which is described here: https://support.google.com/google-ads/answer/7548399?hl=en

I would need to add the conversion ID to the global site tag, Is there a way to do this with this gtm-module?

== EDIT: ====

Is this line: https://github.com/nuxt-community/gtm-module/blob/559814cd24d424320164e90ca08d0b3a9e7b6b44/lib/module.js#L84

responsible for doing this: function gtag(){dataLayer.push(arguments);} in the standard way of integration the google scripts?

And if so where is this part

    gtag('js', new Date());

    gtag('config', 'GA_TRACKING_ID');
    gtag('config', 'AW-CONVERSION_ID');

hidden? So where is the gtm-module actually configuring the GA_TRACKING_ID? I would assume that there I should be able to set another google tag (AW-CONVERSION_ID) ...

Help is much appreciated

sndrgb commented 4 years ago

Hi, did you resolve this?

Jones-S commented 4 years ago

I could not. But in my case in the end it was enough to add the GTM code. There was no need for a global site tag, but if you find out how this can be solved, I would still be interested to know...

aphavichitr commented 4 years ago

Do you have to have a GTM ID to use this library? I only have a Google Analytics and Adwords ID.