forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalytics.amp.html
341 lines (323 loc) · 11.7 KB
/
analytics.amp.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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>AMP Analytics</title>
<link rel="canonical" href="analytics.amp.html" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-custom>
.box {
background: #ccc;
border: 1px solid #aaa;
padding: 10px;
margin: 10px;
}
#container {
position: absolute;
top: 10000px;
height: 10px;
}
</style>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<div id="container">
Container for analytics tags. Positioned far away from top to make sure that doesn't matter.
<amp-analytics id="analytics1">
<script type="application/json">
{
"transport": {"beacon": false, "xhrpost": false},
"requests": {
"base": "https://example.com/?domain=${canonicalHost}&path=${canonicalPath}&title=${title}&time=${timestamp}&tz=${timezone}&pid=${pageViewId}&_=${random}",
"pageview": "${base}&name=${eventName}&type=${eventId}&screenSize=${screenWidth}x${screenHeight}",
"event": "${base}&name=${eventName}&scrollY=${scrollTop}&scrollX=${scrollLeft}&height=${availableScreenHeight}&width=${availableScreenWidth}"
},
"vars": {
"title": "Example Request"
},
"triggers": {
"defaultPageview": {
"on": "visible",
"request": "pageview",
"vars": {
"eventName": "page-loaded",
"eventId": "42"
}
},
"scrollPings": {
"on": "scroll",
"request": "event",
"scrollSpec": {
"verticalBoundaries" : [1, 50, 90],
"horizontalBoundaries": [100]
},
"vars": {
"eventName": "scroll"
}
}
}
}
</script>
</amp-analytics>
<!-- AT Internet tracking -->
<amp-analytics type="atinternet">
<script type="application/json">
{
"vars": {
"site": "123456", // Site number
"log": "logs", // Secured collect log
"domain": ".xiti.com", // Collect domain name
"title": "pageChapter::pageTitle", // Page label
"level2": "10" // Page level 2
},
"triggers": {
"defaultPageview": {
"on": "visible",
"request": "pageview"
},
"links": {
"on": "click",
"selector": "#test1",
"request": "click",
"vars": {
"label": "clickChapter::clickLabel", // Click label
"level2Click": "12", // Click level 2
"type": "a" // Click type (a = action, t = download, n = navigation, s exit)
}
}
}
}
</script>
</amp-analytics>
<!-- End AT Internet tracking -->
<!-- Chartbeat tracking -->
<amp-analytics type="chartbeat">
<script type="application/json">
{
"vars": {
"uid": "12345",
"domain": "my-site.com",
"sections": "section 1, section 2"
}
}
</script>
</amp-analytics>
<!-- End Chartbeat example -->
<!-- comScore UDM pageview tracking -->
<amp-analytics type="comscore">
<script type="application/json">
{
"vars": {
"c2": "1000001"
}
}
</script>
</amp-analytics>
<!-- End comScore example -->
<amp-analytics type="googleanalytics" id="analytics2">
<script type="application/json">
{
"vars": {
"account": "UA-YYYY-Y"
},
"triggers": {
"defaultPageview": {
"on": "visible",
"request": "pageview",
"vars": {
"title": "Example Pageview"
}
},
"clickOnTest1Trigger": {
"on": "click",
"selector": "#test1",
"request": "event",
"vars": {
"eventCategory": "examples",
"eventAction": "clicked-test1"
}
},
"clickOnTopTrigger": {
"on": "click",
"selector": "#top",
"request": "event",
"vars": {
"eventCategory": "examples",
"eventAction": "clicked-header"
}
}
}
}
</script>
</amp-analytics>
<!-- Krux tracking. Ensure you replace KMnP7vhh with your configuration ID. -->
<amp-analytics type="krux" config="https://cdn.krxd.net/controltag/amp/KMnP7vhh.json">
<script type="application/json">
{
"vars": {
"section": "amp",
"subsection": "examples"
},
"extraUrlParams": {
"user.status": "developer",
"page.keywords": "amp, mobile, examples"
}
}
</script>
</amp-analytics>
<!-- Parsely tracking -->
<amp-analytics type="parsely">
<script type="application/json">
{
"vars": {
"apikey": "example.com"
}
}
</script>
</amp-analytics>
<!-- Quantcast tracking -->
<amp-analytics type="quantcast">
<script type="application/json">
{
"vars": {
"pcode": "p-1234567890abc",
"labels": ["Example.label.1", "Example.label.2"]
}
}
</script>
</amp-analytics>
<!-- End Quantcast example -->
<amp-analytics id="analytics3" config="./analytics.config.json"></amp-analytics>
<amp-analytics id="analytics4">
<script type="application/json">
{
"requests": {
"test-ping": "https://my-analytics.com/ping?title=${title}&acct=${account}"
},
"vars": {
"title": "A page that sends a ping",
"account": "12345"
},
"triggers": {
"timer": {
"on": "timer",
"timerSpec": {
"interval": 5,
"max-timer-length": 300
},
"request": "test-ping"
}
}
}
</script>
</amp-analytics>
<!-- comScore UDM pageview tracking -->
<amp-analytics type="comscore">
<script type="application/json">
{
"vars": {
"c2": "1000001"
}
}
</script>
</amp-analytics>
<!-- End comScore example -->
<!--
INFOnline example
Important: url needs to point to a copy of
amp-analytics-infonline.html on a different subdomain
than your AMP files.
-->
<amp-analytics type="infonline" id="infonline">
<script type="application/json">
{
"vars": {
"st": "angebotskennung",
"co": "comment",
"cp": "code"
},
"requests": {
"url": "https://3p.ampproject.net/custom/amp-analytics-infonline.html"
}
}
</script>
</amp-analytics>
<!-- End INFOnline example -->
<!-- SimpleReach Tracking -->
<amp-analytics type="simplereach">
<script type="application/json">
{
"vars": {
"pid": "000000000000000000000000",
"title": "a title",
"authors": ["john smith", "jane doe", "last name, first name"],
"categories": ["sports", "football"],
"tags": ["big-game", "nfl"],
"published_at": "2015-01-01 00:00:00"
}
}
</script>
</amp-analytics>
<!-- End SimpleReach Example -->
</div>
<div class="logo"></div>
<h1 id="top">AMP Analytics</h1>
<span id="test1" class="box">
Click here to generate an event
</span>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam pellentesque augue quis elementum tempus. Pellentesque sit amet neque bibendum, sagittis purus vitae, pellentesque magna. Vestibulum non viverra metus, eget feugiat lacus. Nulla in maximus orci. Maecenas id turpis vel ipsum vestibulum bibendum ut sit amet magna. Nullam hendrerit ex at est eleifend, nec dignissim nibh rutrum. Aliquam quis tellus et nibh faucibus laoreet in eget turpis. Nam quam nisl, porttitor vel ex eget, dapibus placerat dui. Mauris commodo pellentesque leo, eu tempus quam. In hac habitasse platea dictumst. Suspendisse non ante finibus, luctus augue non, luctus orci. Vestibulum ornare lacinia aliquam. In sollicitudin vehicula vulputate. Sed mi elit, commodo nec sapien nec, pretium bibendum leo. Donec id justo tortor. Ut in mauris dapibus, laoreet metus vitae, dictum nisi.
</p>
<p>
Integer dapibus egestas arcu. Nunc vitae velit congue, placerat augue quis, suscipit nisi. Donec suscipit imperdiet turpis pharetra feugiat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus aliquam eleifend dolor, at lacinia orci semper vel. Nunc semper sem vel tincidunt posuere. Nunc lobortis velit vitae condimentum mollis. Morbi eu ullamcorper mauris. Pellentesque ac eros maximus, pulvinar sapien vitae, semper nisi. Curabitur imperdiet non mauris vitae sollicitudin.
</p>
<p>
Nam posuere velit euismod risus pulvinar, in sollicitudin sapien consectetur. Vestibulum nec ex odio. Quisque at elit nec nunc ultricies lacinia nec non lorem. Maecenas porttitor consequat mauris, vitae porttitor ligula pellentesque ut. Pellentesque rhoncus diam vel lacus lobortis imperdiet. Sed maximus dictum hendrerit. Vivamus ornare, purus in laoreet sagittis, est ante pretium mauris, vel vulputate arcu erat eget mauris. Suspendisse eu lorem metus. Aliquam tempus aliquet urna, vitae mollis lacus pretium vitae. Etiam semper gravida commodo. Maecenas at pulvinar quam. Nullam dolor ipsum, ornare a sollicitudin et, sodales porttitor neque.
</p>
<p>
Integer in felis at lacus mattis facilisis. Curabitur tincidunt, felis porttitor mollis finibus, tortor elit elementum dolor, vel vulputate lorem dui id ante. Vivamus in velit at lectus blandit gravida vitae quis arcu. Nam et magna magna. Fusce condimentum diam lacus, ac ullamcorper purus malesuada eu. Mauris ullamcorper elit et venenatis faucibus. Nullam lobortis molestie purus quis pellentesque. Sed at libero id nisi rhoncus tincidunt. Praesent vestibulum vehicula tristique. Etiam rutrum, nunc id porta interdum, nulla nisi molestie leo, at fermentum justo dolor at lorem. Duis in egestas sapien.
</p>
<p>
Donec pharetra molestie sollicitudin. Duis mattis eleifend rutrum. Quisque luctus tincidunt lacus, vitae lobortis nisi malesuada ac. Aliquam mattis leo vel elit rutrum, nec consequat massa vestibulum. Maecenas bibendum metus nec ante feugiat, eu faucibus orci mattis. Cras tristique sem non elit congue malesuada. Proin ornare, lacus et porttitor consequat, sapien urna rutrum diam, ac pellentesque ligula est eget nisi. Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec ultrices sollicitudin eros a placerat. Proin eget pulvinar est. Donec posuere ultrices odio at ultrices. Suspendisse potenti. Phasellus id orci id purus porttitor consectetur a at erat. Nullam volutpat ultricies nisl id maximus. Morbi porta ex ante, et egestas odio ultricies consequat.
</p>
<p>
</p><ul>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li>
<li>Aliquam in ex porta, imperdiet elit sit amet, condimentum diam.</li>
<li>Etiam fermentum nisi at porta pulvinar.</li>
</ul>
<p></p>
<p>
</p><ul>
<li>Proin mattis neque vel elit posuere molestie.</li>
<li>Integer tincidunt sem sed nunc auctor elementum.</li>
<li>Integer a felis in ipsum aliquet auctor sit amet a neque.</li>
</ul>
<p></p>
<p>
</p><ul>
<li>Sed suscipit dolor molestie, rhoncus quam ac, lacinia ex.</li>
<li>Curabitur et tellus vel justo ultrices aliquet sed id turpis.</li>
<li>Nam finibus risus at justo elementum bibendum.</li>
<li>In non lacus non urna congue feugiat at vel diam.</li>
</ul>
<p></p>
<p>
</p><ul>
<li>Integer hendrerit augue interdum dui venenatis, sit amet tristique mauris cursus.</li>
<li>Etiam quis eros viverra, tincidunt justo in, facilisis nunc.</li>
<li>Aliquam at lacus faucibus, congue lorem interdum, semper mauris.</li>
<li>Ut vulputate erat vel feugiat pharetra.</li>
<li>Morbi id augue id orci sagittis tempus.</li>
<li>Vestibulum varius libero ac dignissim sodales.</li>
</ul>
<p></p>
<p>
</p><ul>
<li>Aenean ac sem eget libero varius viverra sit amet vitae nunc.</li>
</ul>
<p></p>
</body>
</html>