@reuters-graphics/graphics-components 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,30 +16,32 @@ const attachScript = function (i, s, o, g, r, a, m) {
|
|
|
16
16
|
/* eslint-enable */
|
|
17
17
|
|
|
18
18
|
export default (page, title) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
window.ga('send', 'pageview', {
|
|
33
|
-
page,
|
|
34
|
-
title,
|
|
35
|
-
});
|
|
19
|
+
try {
|
|
20
|
+
if (!window.ga) {
|
|
21
|
+
attachScript(
|
|
22
|
+
window,
|
|
23
|
+
document,
|
|
24
|
+
'script',
|
|
25
|
+
'https://www.google-analytics.com/analytics.js',
|
|
26
|
+
'ga'
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
window.ga('create', 'UA-41619329-3', { cookieDomain: 'auto' });
|
|
30
|
+
window.ga('require', 'linkid', 'linkid.js');
|
|
31
|
+
}
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
reportInterval: 30,
|
|
33
|
+
window.ga('send', 'pageview', {
|
|
34
|
+
page,
|
|
35
|
+
title,
|
|
41
36
|
});
|
|
42
|
-
|
|
37
|
+
|
|
38
|
+
if (!inIframe()) {
|
|
39
|
+
// start time on page tracking if not in an iframe
|
|
40
|
+
riveted.init({
|
|
41
|
+
reportInterval: 30,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
} catch (e) {}
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
// checks if page is in an iframe
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
export default () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
googletag
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
try {
|
|
3
|
+
const { protocol } = document.location;
|
|
4
|
+
const gptScript = document.querySelector(
|
|
5
|
+
`script[src="${protocol}//www.googletagservices.com/tag/js/gpt.js"]`
|
|
6
|
+
);
|
|
7
|
+
// Only do this once.
|
|
8
|
+
if (gptScript) return;
|
|
9
|
+
const googletag = window.googletag || {};
|
|
10
|
+
googletag.cmd = googletag.cmd || [];
|
|
11
|
+
(function () {
|
|
12
|
+
const gads = document.createElement('script');
|
|
13
|
+
gads.async = true;
|
|
14
|
+
gads.type = 'text/javascript';
|
|
15
|
+
const useSSL = document.location.protocol === 'https:';
|
|
16
|
+
gads.src =
|
|
17
|
+
(useSSL ? 'https:' : 'http:') +
|
|
18
|
+
'//www.googletagservices.com/tag/js/gpt.js';
|
|
19
|
+
const node = document.getElementsByTagName('script')[0];
|
|
20
|
+
node.parentNode.insertBefore(gads, node);
|
|
21
|
+
})();
|
|
22
|
+
googletag.cmd.push(function () {
|
|
23
|
+
googletag
|
|
24
|
+
.defineSlot(
|
|
25
|
+
'/4735792/reuters_investigates',
|
|
26
|
+
[[300, 250]],
|
|
27
|
+
'div-gpt-ad-1441822201033-0'
|
|
28
|
+
)
|
|
29
|
+
.addService(googletag.pubads());
|
|
30
|
+
googletag.pubads().enableSingleRequest();
|
|
31
|
+
googletag.enableServices();
|
|
32
|
+
});
|
|
33
|
+
} catch (e) {}
|
|
32
34
|
};
|