I set up conversion tracking on the Google ads dashboard and it gave me snippets to use on my app. The snippets are all for GA4.
On the app I need to support both GA4 and Universal Analytics. I fire events to both properties. But I can't find anywhere online examples of how fire ad conversion tracking events in UA, it's all in GA4.
Is there a UA equivalent of this GA4 code?:
gtag('event', 'conversion', {
'send_to': 'Some/Id',
'transaction_id': '',
'event_callback': callback
});
Or can google ad conversions only be tracked in GA4?
G-Tag can be used for both Google ADs as well as Analytics reporting
ASwell as with ANalytics you first need to initialize G-Tag and configure it:
<!-- Global site tag (gtag.js) - Google Ads: CONVERSION_ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config','AW-CONVERSION_ID');
</script>
Then send the Conversion Data.
<script>
gtag('event', 'conversion', {'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL',
'value': 1.0,
'currency': 'USD'
});
</script>
The Conversion ID and LAbel can be retrieved from the Google Ads Interface when selecting manual Implementation.