-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathec-migration.html
70 lines (64 loc) · 2.13 KB
/
ec-migration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html>
<head>
<title>My Test Page for EC</title>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16548767634"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-16548767634');
</script>
</head>
<body>
<h1>Prod EC Test Page</h1>
<p>Conversion</p>
<button id="sendConversion">Do something</button><br>
<button id="sendConversion2">Do something 2</button>
<form action="/ec-migration.html" id="foo" method="GET">
email: <input type="email" id="email" name="email"><br>
email2: <input type="email" id="email2" name="email2"><br>
phone1: <input type="tel" id="phone1" name="phone1"><br>
phone2: <input type="tel" id="phone2" name="phone2"><br>
<input id="next-page" type="submit" value="Submit">
</form>
</body>
<script>
window.emailVariable1 = '[email protected]';
window.emailVariable2 = '[email protected]';
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-16548767634/pAkHCK7-0qsZEJLPiNM9',
'transaction_id': '',
'event_callback': callback
});
return false;
}
document.getElementById("sendConversion").addEventListener("click", function () {
return gtag_report_conversion();
});
function gtag_report_conversion2(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-16548767634/06-1CI_L16sZEJLPiNM9',
'value': 8.0,
'currency': 'TWD',
'event_callback': callback
});
return false;
}
document.getElementById("sendConversion2").addEventListener("click", function () {
return gtag_report_conversion2();
});
</script>
</html>