I don’t have a great understanding with coding so if possible please give a very detailed reply.
I essentially want to track how many people click on certain buttons. I went ahead on my google analytics and set up my conversion action.
From what I understand I need to paste the event snippet code somewhere so that every time someone clicks on a button related to the conversion action record on GA.
Could some one please tell me what exactly I have to do and where I need to paste the event snippet?
I want to track a book button, so when someone clicks on it takes them to a valuable page. It looks like this.
<!-- Event snippet for Click Hero book button conversion page
In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->
<script>
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-823066871/povGCPuL7noQ94G8iAM',
'event_callback': callback
});
return false;
}
</script>
Hi @beauty, thanks for replay also. Could you please share the link to the published url so that I may take a look? I am not an expert on Google Tracking but I can check if there are any other console errors.