-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
250 lines (207 loc) · 7.23 KB
/
Copy pathindex.html
File metadata and controls
250 lines (207 loc) · 7.23 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Measurement protocol testing</title>
<script>
</script>
<style>
body
{
background-color: antiquewhite;
width: 100%;
height: 900px;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
align-content: space-around;
}
.box
{
background-color: rgb(208, 148, 76);
width: 1200px;
height: 300px;
display: flex;
flex-direction: column;
}
.data-box
{
align-self: center;
margin-top: 15px;
display: flex;
flex-direction: row;
justify-content: center;
padding: 5px;
}
.input-box
{
align-self: center;
display: flex;
flex: 3;
flex-direction: row;
padding: 5px;
justify-content: space-evenly;
align-items: center;
width: 900px;
}
.input-box input
{
width: 250px;
}
.trigger-box
{
align-self: center;
display: flex;
flex: 3;
flex-direction: row;
padding: 5px;
padding-left: 150px;
padding-right: 150px;
justify-content: space-between;
align-items: center;
width: 700px;
}
.col
{
display: flex;
flex-direction: column;
width: 250px;
margin: 15px;
}
.col button
{
margin: 10px;
align-self: center;
width: 120px;
height: 25px;
}
.trigger-box button
{
width: 120px;
height: 50px;
}
label
{
margin: 5px;
align-self: center;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
font-size: medium;
font-weight: 500;
}
</style>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T4CVW24K');</script>
<!-- End Google Tag Manager -->
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-T4CVW24K"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div class="box">
<div class="data-box">
<div class="col 1">
<label for="client_id">client_id</label>
<input type="text" name="client_id" id="client_id">
<label for="session_id">session_id</label>
<input type="text" name="session_id" id="session_id">
<button class="button" id="client-button" onclick="load_user()">load</button>
</div>
<div class="col 2">
<label for="source">source</label>
<input type="text" name="source" id="source_id">
<label for="medium">medium</label>
<input type="text" name="medium" id="medium_id">
<button class="button" id="channel-button" onclick="load_channel()">load</button>
</div>
<div class="col 3">
<label for="referrer">referrer</label>
<input type="text" name="referrer" id="referrer">
<label for="query">query parameter</label>
<input type="text" name="query" id="query">
<button class="button" id="url-button" onclick="load_referrer()">load</button>
</div>
</div>
<div class="input-box">
<input type="text" name="measurement_id" id="measurement_id">
<input type="text" name="page_view" id="page_name">
<input type="text" name="conversion" id="conversion_id">
</div>
<div class="trigger-box">
<button onclick="config()">confinguration</button>
<button onclick="page_view()">page_view</button>
<button onclick="conversion()">conversion</button>
</div>
</div>
<script>
function config() {
var measurement_id = document.querySelector("#measurement_id").value;
dataLayer.push({
event: "configuration",
measurement_id: measurement_id
});
}
function page_view() {
var page = document.querySelector("#page_name").value;
dataLayer.push({
event: "page_view",
page_location: page
});
}
function conversion() {
var conversion = document.querySelector("#conversion_id").value;
dataLayer.push({
event: "conversion",
conversion: conversion
});
}
function load_referrer() {
var name = document.querySelector("#referrer").value;
var query = document.querySelector("#query").value;
query == '' ? name : name+"?"+query;
if (name != '')
{
delete window.document.referrer;
window.document.__defineGetter__('referrer', function () {
return name;
});
}
dataLayer.push({
event: "load_referrer",
previous_page: "https://"+name+query,
referrer: name,
query: query
})
}
function load_user()
{
var client_id = document.getElementById("client_id").value;
var session_id = document.getElementById("session_id").value;
dataLayer.push({
event: "load_user",
client_id: client_id,
session_id: session_id
});
}
function load_channel()
{
var source = document.getElementById("source_id").value;
var medium = document.getElementById("medium_id").value;
var name = document.getElementById("page_name").value;
dataLayer.push({
event: "refresh_channel",
source: source,
medium: medium,
page_location: "https://www."+name
});
};
</script>
</body>
</html>