-1
Good afternoon to all!! All right? i created a google ads conversion tag, which should be triggered by clicking on the Whatsapp link on my site, but I’m not able to install correctly on the trigger, which is the Whats button(it’s a href)...I launched an "onclick" but the girl from Goolge said that way, this wrong... I’ll post the code, will you help me? this is the global tag:
<!--
Global site tag (gtag.js) - Google Ads: ********** -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-
**********"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-******************');
</script>
Snipet is this guy who informs the click according to the google people :
<script>
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-***************/*******************',
'event_callback': callback
});
return false;
}
</script>
the problem is that the trigger here is the click on a button, which is an image or text...I’m not sure how to put this code on the buttons...does anyone know? Could you help me, please? Thank you all!!! Big hug!!!