Skip to content

Commit 6db1f1c

Browse files
authored
Merge pull request #98 from cheeaun/staging
Update from staging
2 parents 5a84bea + 99c2334 commit 6db1f1c

File tree

4 files changed

+205
-0
lines changed

4 files changed

+205
-0
lines changed

bus-arrival/index.html

+51
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,55 @@
3535
window.gtag = gtag;
3636
</script>
3737
<script src="../assets/arrival.js" type="module"></script>
38+
<script type="text/javascript">
39+
(function (window, document, dataLayerName, id) {
40+
(window[dataLayerName] = window[dataLayerName] || []),
41+
window[dataLayerName].push({
42+
start: new Date().getTime(),
43+
event: 'stg.start',
44+
});
45+
var scripts = document.getElementsByTagName('script')[0],
46+
tags = document.createElement('script');
47+
function stgCreateCookie(a, b, c) {
48+
var d = '';
49+
if (c) {
50+
var e = new Date();
51+
e.setTime(e.getTime() + 24 * c * 60 * 60 * 1e3),
52+
(d = '; expires=' + e.toUTCString());
53+
f = '; SameSite=Strict';
54+
}
55+
document.cookie = a + '=' + b + d + f + '; path=/';
56+
}
57+
var isStgDebug =
58+
(window.location.href.match('stg_debug') ||
59+
document.cookie.match('stg_debug')) &&
60+
!window.location.href.match('stg_disable_debug');
61+
stgCreateCookie('stg_debug', isStgDebug ? 1 : '', isStgDebug ? 14 : -1);
62+
var qP = [];
63+
dataLayerName !== 'dataLayer' &&
64+
qP.push('data_layer_name=' + dataLayerName),
65+
isStgDebug && qP.push('stg_debug');
66+
var qPString = qP.length > 0 ? '?' + qP.join('&') : '';
67+
(tags.async = !0),
68+
(tags.src = 'https://ca.containers.piwik.pro/' + id + '.js' + qPString),
69+
scripts.parentNode.insertBefore(tags, scripts);
70+
!(function (a, n, i) {
71+
a[n] = a[n] || {};
72+
for (var c = 0; c < i.length; c++)
73+
!(function (i) {
74+
(a[n][i] = a[n][i] || {}),
75+
(a[n][i].api =
76+
a[n][i].api ||
77+
function () {
78+
var a = [].slice.call(arguments, 0);
79+
'string' == typeof a[0] &&
80+
window[dataLayerName].push({
81+
event: n + '.' + i + ':' + a[0],
82+
parameters: [].slice.call(arguments, 1),
83+
});
84+
});
85+
})(i[c]);
86+
})(window, 'ppms', ['tm', 'cm']);
87+
})(window, document, 'dataLayer', 'f84f7808-9fe5-444d-884d-3f61a5d8b01e');
88+
</script>
3889
</html>

bus-first-last/index.html

+51
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,55 @@
4646
window.gtag = gtag;
4747
</script>
4848
<script src="../assets/firstlast.js" type="module"></script>
49+
<script type="text/javascript">
50+
(function (window, document, dataLayerName, id) {
51+
(window[dataLayerName] = window[dataLayerName] || []),
52+
window[dataLayerName].push({
53+
start: new Date().getTime(),
54+
event: 'stg.start',
55+
});
56+
var scripts = document.getElementsByTagName('script')[0],
57+
tags = document.createElement('script');
58+
function stgCreateCookie(a, b, c) {
59+
var d = '';
60+
if (c) {
61+
var e = new Date();
62+
e.setTime(e.getTime() + 24 * c * 60 * 60 * 1e3),
63+
(d = '; expires=' + e.toUTCString());
64+
f = '; SameSite=Strict';
65+
}
66+
document.cookie = a + '=' + b + d + f + '; path=/';
67+
}
68+
var isStgDebug =
69+
(window.location.href.match('stg_debug') ||
70+
document.cookie.match('stg_debug')) &&
71+
!window.location.href.match('stg_disable_debug');
72+
stgCreateCookie('stg_debug', isStgDebug ? 1 : '', isStgDebug ? 14 : -1);
73+
var qP = [];
74+
dataLayerName !== 'dataLayer' &&
75+
qP.push('data_layer_name=' + dataLayerName),
76+
isStgDebug && qP.push('stg_debug');
77+
var qPString = qP.length > 0 ? '?' + qP.join('&') : '';
78+
(tags.async = !0),
79+
(tags.src = 'https://ca.containers.piwik.pro/' + id + '.js' + qPString),
80+
scripts.parentNode.insertBefore(tags, scripts);
81+
!(function (a, n, i) {
82+
a[n] = a[n] || {};
83+
for (var c = 0; c < i.length; c++)
84+
!(function (i) {
85+
(a[n][i] = a[n][i] || {}),
86+
(a[n][i].api =
87+
a[n][i].api ||
88+
function () {
89+
var a = [].slice.call(arguments, 0);
90+
'string' == typeof a[0] &&
91+
window[dataLayerName].push({
92+
event: n + '.' + i + ':' + a[0],
93+
parameters: [].slice.call(arguments, 1),
94+
});
95+
});
96+
})(i[c]);
97+
})(window, 'ppms', ['tm', 'cm']);
98+
})(window, document, 'dataLayer', 'f84f7808-9fe5-444d-884d-3f61a5d8b01e');
99+
</script>
49100
</html>

index.html

+52
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,58 @@ <h1>
115115
<div id="app"></div>
116116
<div id="tooltip"></div>
117117
<script src="assets/app.js" type="module"></script>
118+
<script type="text/javascript">
119+
(function (window, document, dataLayerName, id) {
120+
(window[dataLayerName] = window[dataLayerName] || []),
121+
window[dataLayerName].push({
122+
start: new Date().getTime(),
123+
event: 'stg.start',
124+
});
125+
var scripts = document.getElementsByTagName('script')[0],
126+
tags = document.createElement('script');
127+
function stgCreateCookie(a, b, c) {
128+
var d = '';
129+
if (c) {
130+
var e = new Date();
131+
e.setTime(e.getTime() + 24 * c * 60 * 60 * 1e3),
132+
(d = '; expires=' + e.toUTCString());
133+
f = '; SameSite=Strict';
134+
}
135+
document.cookie = a + '=' + b + d + f + '; path=/';
136+
}
137+
var isStgDebug =
138+
(window.location.href.match('stg_debug') ||
139+
document.cookie.match('stg_debug')) &&
140+
!window.location.href.match('stg_disable_debug');
141+
stgCreateCookie('stg_debug', isStgDebug ? 1 : '', isStgDebug ? 14 : -1);
142+
var qP = [];
143+
dataLayerName !== 'dataLayer' &&
144+
qP.push('data_layer_name=' + dataLayerName),
145+
isStgDebug && qP.push('stg_debug');
146+
var qPString = qP.length > 0 ? '?' + qP.join('&') : '';
147+
(tags.async = !0),
148+
(tags.src =
149+
'https://ca.containers.piwik.pro/' + id + '.js' + qPString),
150+
scripts.parentNode.insertBefore(tags, scripts);
151+
!(function (a, n, i) {
152+
a[n] = a[n] || {};
153+
for (var c = 0; c < i.length; c++)
154+
!(function (i) {
155+
(a[n][i] = a[n][i] || {}),
156+
(a[n][i].api =
157+
a[n][i].api ||
158+
function () {
159+
var a = [].slice.call(arguments, 0);
160+
'string' == typeof a[0] &&
161+
window[dataLayerName].push({
162+
event: n + '.' + i + ':' + a[0],
163+
parameters: [].slice.call(arguments, 1),
164+
});
165+
});
166+
})(i[c]);
167+
})(window, 'ppms', ['tm', 'cm']);
168+
})(window, document, 'dataLayer', 'f84f7808-9fe5-444d-884d-3f61a5d8b01e');
169+
</script>
118170
<script
119171
async
120172
src="https://www.googletagmanager.com/gtag/js?id=G-D34FLYKNNR"

visualization/index.html

+51
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,57 @@
233233
<div id="status" hidden></div>
234234
<div id="tooltip" hidden></div>
235235
<script src="visualization.js" type="module"></script>
236+
<script type="text/javascript">
237+
(function (window, document, dataLayerName, id) {
238+
(window[dataLayerName] = window[dataLayerName] || []),
239+
window[dataLayerName].push({
240+
start: new Date().getTime(),
241+
event: 'stg.start',
242+
});
243+
var scripts = document.getElementsByTagName('script')[0],
244+
tags = document.createElement('script');
245+
function stgCreateCookie(a, b, c) {
246+
var d = '';
247+
if (c) {
248+
var e = new Date();
249+
e.setTime(e.getTime() + 24 * c * 60 * 60 * 1e3),
250+
(d = '; expires=' + e.toUTCString());
251+
f = '; SameSite=Strict';
252+
}
253+
document.cookie = a + '=' + b + d + f + '; path=/';
254+
}
255+
var isStgDebug =
256+
(window.location.href.match('stg_debug') ||
257+
document.cookie.match('stg_debug')) &&
258+
!window.location.href.match('stg_disable_debug');
259+
stgCreateCookie('stg_debug', isStgDebug ? 1 : '', isStgDebug ? 14 : -1);
260+
var qP = [];
261+
dataLayerName !== 'dataLayer' &&
262+
qP.push('data_layer_name=' + dataLayerName),
263+
isStgDebug && qP.push('stg_debug');
264+
var qPString = qP.length > 0 ? '?' + qP.join('&') : '';
265+
(tags.async = !0),
266+
(tags.src = 'https://ca.containers.piwik.pro/' + id + '.js' + qPString),
267+
scripts.parentNode.insertBefore(tags, scripts);
268+
!(function (a, n, i) {
269+
a[n] = a[n] || {};
270+
for (var c = 0; c < i.length; c++)
271+
!(function (i) {
272+
(a[n][i] = a[n][i] || {}),
273+
(a[n][i].api =
274+
a[n][i].api ||
275+
function () {
276+
var a = [].slice.call(arguments, 0);
277+
'string' == typeof a[0] &&
278+
window[dataLayerName].push({
279+
event: n + '.' + i + ':' + a[0],
280+
parameters: [].slice.call(arguments, 1),
281+
});
282+
});
283+
})(i[c]);
284+
})(window, 'ppms', ['tm', 'cm']);
285+
})(window, document, 'dataLayer', 'f84f7808-9fe5-444d-884d-3f61a5d8b01e');
286+
</script>
236287
<script
237288
async
238289
src="https://www.googletagmanager.com/gtag/js?id=G-D34FLYKNNR"

0 commit comments

Comments
 (0)