@reuters-graphics/graphics-components 0.0.20 → 0.0.21
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.
|
@@ -81,15 +81,11 @@ const getOrigin = (baseUrl) => {
|
|
|
81
81
|
};
|
|
82
82
|
$: origin = getOrigin(baseUrl);
|
|
83
83
|
$: canonicalUrl = origin + pageUrl.pathname;
|
|
84
|
-
let hasEnabledPublisherTags = false;
|
|
85
84
|
// Only fire analytics on prod sites
|
|
86
85
|
$: {
|
|
87
86
|
if (typeof window !== 'undefined' && includeAnalytics) {
|
|
88
87
|
analytics(canonicalUrl, seoTitle);
|
|
89
|
-
|
|
90
|
-
publisherTags();
|
|
91
|
-
hasEnabledPublisherTags = true;
|
|
92
|
-
}
|
|
88
|
+
publisherTags();
|
|
93
89
|
}
|
|
94
90
|
}
|
|
95
91
|
const orgLdJson = {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export default () => {
|
|
2
|
+
const { protocol } = document.location;
|
|
3
|
+
const gptScript = document.querySelector(
|
|
4
|
+
`script[src="${protocol}//www.googletagservices.com/tag/js/gpt.js"]`
|
|
5
|
+
);
|
|
6
|
+
// Only do this once.
|
|
7
|
+
if (gptScript) return;
|
|
2
8
|
const googletag = window.googletag || {};
|
|
3
9
|
googletag.cmd = googletag.cmd || [];
|
|
4
|
-
(function() {
|
|
10
|
+
(function () {
|
|
5
11
|
const gads = document.createElement('script');
|
|
6
12
|
gads.async = true;
|
|
7
13
|
gads.type = 'text/javascript';
|
|
@@ -12,7 +18,7 @@ export default () => {
|
|
|
12
18
|
const node = document.getElementsByTagName('script')[0];
|
|
13
19
|
node.parentNode.insertBefore(gads, node);
|
|
14
20
|
})();
|
|
15
|
-
googletag.cmd.push(function() {
|
|
21
|
+
googletag.cmd.push(function () {
|
|
16
22
|
googletag
|
|
17
23
|
.defineSlot(
|
|
18
24
|
'/4735792/reuters_investigates',
|