nuxt / scripts

Third-Party Scripts Meets Nuxt Developer Experience.
https://scripts.nuxt.com
MIT License
269 stars 29 forks source link

Google Ads #269

Closed diego-lipinski-de-castro closed 15 hours ago

diego-lipinski-de-castro commented 2 days ago

🆒 Your use case

I use Google Ads to track conversions

🆕 The solution you'd like

Something similar to Facebook Pixel or Google Tag Manager

🔍 Alternatives you've considered

No response

ℹī¸ Additional info

Site: ads.google.com

harlan-zw commented 2 days ago

Can you link docs for the tracker?

diego-lipinski-de-castro commented 1 day ago

Hello, maybe it will not be necessary to add a different lib, because it seems to be the case that google is saying to just use the tag manager to track events from AdWords, I will link a few pages just in case.

GoogleAds 1 GoogleAds 2 GoogleAds 3 GoogleAds 4 Stackoverflow about google ads

It seems they are saying to use something like

gtag('event',  'conversion',  {
    'send_to': 'AW-CONVERSION_ID/AW-CONVERSION_LABEL',
    'value': 1.0,
    'currency': 'USD'
});

Instead of

<!-- Put this script in your <head> -->
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion_async.js" charset="utf-8"></script>

<!-- the rest of your web page as usual etc -->

<!-- Call this function when the form submits -->
<script type="text/javascript">
/* <![CDATA[ */
window.google_trackConversion({
    google_conversion_id: 123456789, 
    google_conversion_label: abcdefghijkl,  // if provided, remove this line if not provided
    google_conversion_value: 0,  // or the dollar value of this conversion, e.g. 100 etc.
    google_remarketing_only: false
});
//]]>

But, to be honest, I am still confused if they are the same thing

diego-lipinski-de-castro commented 15 hours ago

Closing this