@reuters-graphics/graphics-components 1.0.15 → 1.0.16
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.
|
@@ -54,9 +54,9 @@ export const loadBootstrap = () => {
|
|
|
54
54
|
window.googletag.pubads().setTargeting('adstest', adstest);
|
|
55
55
|
}
|
|
56
56
|
// Use the URL path to create a unique ID for the page.
|
|
57
|
-
const graphicId = window.location.pathname
|
|
58
|
-
.
|
|
59
|
-
.
|
|
57
|
+
const graphicId = window.location.pathname.split('/')
|
|
58
|
+
// Get the first lowercase slug in the pathname, which is the graphic UID.
|
|
59
|
+
.filter(d => d.match(/[a-z0-9]+/) && d !== 'graphics')[0] || 'unknown-graphic';
|
|
60
60
|
window.googletag.pubads().setTargeting('template', 'graphics');
|
|
61
61
|
window.googletag.pubads().setTargeting('graphicId', graphicId);
|
|
62
62
|
});
|