From 18f5b7d65d7a1e0d5245f299d9de08a492adab07 Mon Sep 17 00:00:00 2001 From: Siim Sams Date: Mon, 31 Jul 2023 17:08:40 +0300 Subject: [PATCH] update conversion info --- src/en/index.html | 21 +++++++++++++++++---- src/index.html | 21 +++++++++++++++++---- www/index.html | 6 +++--- 3 files changed, 37 insertions(+), 11 deletions(-) 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 @@ - + +