I have the form in the popup. I need to use this script:
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'id_of_analytics',
'event_callback': callback
});
return false;
}
And on submit I use:
onclick="return gtag_report_conversion('my_page_url')"
But when I click submit-button, my page get reloaded and popup with form get closed. And no error- or success-messages are displayed.
How can I use this script without reloading my page?
Change this line
window.location = url;
to
// window.location = url;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With