Posts tagged with jquery

I have a Wordpress page and I need to track all clicks as Google Ads conversion so I've found that I can use the entire page as a link with the following code:

<html>     <body onclick='window.location.href="http://google.com"'>     </body> </html>

Then I need to activate the Google conversion tag at every click and the conversion script are:

<!-- Event snippet for Solicitar cotação 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-ID/AWID',       'event_callback': callback   });   return false; }</script>

Ok, so please, how can I make every click count as a conversion?

Thank you very much.