Skip to content

Commit

Permalink
update conversion info
Browse files Browse the repository at this point in the history
  • Loading branch information
siimsams committed Jul 31, 2023
1 parent d7d1892 commit 18f5b7d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
21 changes: 17 additions & 4 deletions src/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<meta name="theme-color" content="#ffffff">
<!--Google ads-->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3B8KNM2LVT">
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-11274608498"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-3B8KNM2LVT');
gtag('config', 'AW-11274608498');
</script>
</head>

Expand Down Expand Up @@ -240,6 +240,19 @@ <h2 class="text-center text-4xl mb-4">Location</h2>
});
});

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()) {
Expand All @@ -260,7 +273,7 @@ <h2 class="text-center text-4xl mb-4">Location</h2>
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');
}
Expand Down
21 changes: 17 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<meta name="theme-color" content="#ffffff">
<!--Google ads-->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3B8KNM2LVT">
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-11274608498"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-3B8KNM2LVT');
gtag('config', 'AW-11274608498');
</script>
</head>

Expand Down Expand Up @@ -240,6 +240,19 @@ <h2 class="text-center text-4xl mb-4">Asukoht</h2>
});
});

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()) {
Expand All @@ -260,7 +273,7 @@ <h2 class="text-center text-4xl mb-4">Asukoht</h2>
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');
}
Expand Down
6 changes: 3 additions & 3 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<meta name="theme-color" content="#ffffff">
<!--Google ads-->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-3B8KNM2LVT">
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-11274608498"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-3B8KNM2LVT');
gtag('config', 'AW-11274608498');
</script>
</head>

Expand Down

0 comments on commit 18f5b7d

Please sign in to comment.