diff --git a/src/en/index.html b/src/en/index.html index c68906a..924b69d 100644 --- a/src/en/index.html +++ b/src/en/index.html @@ -21,14 +21,14 @@ - + + @@ -240,6 +240,19 @@

Location

}); }); + function gtag_report_conversion(url) { + var callback = function () { + if (typeof(url) != 'undefined') { + window.location = url; + } + }; + gtag('event', 'conversion', { + 'send_to': 'AW-11274608498/ZAhyCN6O-soYEPK-k4Aq', + 'event_callback': callback + }); + return false; + } + function onSubmit(token) { // Check if the form is valid if (!form.reportValidity()) { @@ -260,7 +273,7 @@

Location

success.classList.remove('hidden'); form.classList.add('hidden'); failure.classList.add('hidden'); - window.history.replaceState(null, null, "#success"); + gtag_report_conversion(); } else { failure.classList.remove('hidden'); } diff --git a/src/index.html b/src/index.html index 409fe32..88bfdfb 100644 --- a/src/index.html +++ b/src/index.html @@ -21,14 +21,14 @@ - + + @@ -240,6 +240,19 @@

Asukoht

}); }); + function gtag_report_conversion(url) { + var callback = function () { + if (typeof(url) != 'undefined') { + window.location = url; + } + }; + gtag('event', 'conversion', { + 'send_to': 'AW-11274608498/ZAhyCN6O-soYEPK-k4Aq', + 'event_callback': callback + }); + return false; + } + function onSubmit(token) { // Check if the form is valid if (!form.reportValidity()) { @@ -260,7 +273,7 @@

Asukoht

success.classList.remove('hidden'); form.classList.add('hidden'); failure.classList.add('hidden'); - window.history.replaceState(null, null, "#success"); + gtag_report_conversion(); } else { failure.classList.remove('hidden'); } diff --git a/www/index.html b/www/index.html index 61d44ac..05ad7ab 100644 --- a/www/index.html +++ b/www/index.html @@ -21,14 +21,14 @@ - + +