Skip to content

Instantly share code, notes, and snippets.

@sneg55
Created August 29, 2018 23:24
Show Gist options
  • Save sneg55/3542cba4fd3b831617e9e939e784b480 to your computer and use it in GitHub Desktop.
Save sneg55/3542cba4fd3b831617e9e939e784b480 to your computer and use it in GitHub Desktop.
<!-- Event snippet for sent 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-794594304/3fsOCKS-pIgBEICY8voC',
'transaction_id': '',
'event_callback': callback
});
return false;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment