Cleanup and add comments after review
This commit is contained in:
parent
d742e36250
commit
0c602d7308
4 changed files with 7 additions and 44 deletions
|
|
@ -36,7 +36,7 @@
|
|||
<Template let:args>
|
||||
<AdScripts />
|
||||
<AdSlot {...args} />
|
||||
<!-- <AdSlot placementName="reuters_desktop_canvas" dataFreestarAd="__970x250" /> Add a crown -->
|
||||
<AdSlot placementName="reuters_desktop_canvas" dataFreestarAd="__970x250" />
|
||||
</Template>
|
||||
|
||||
<Story
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import trackTiming from './trackTiming';
|
||||
import getParameterByName from './getParameterByName';
|
||||
import Ias from './ias';
|
||||
|
||||
|
|
@ -17,10 +16,9 @@ export default () => {
|
|||
freestar.newAdSlots(freestar.config.enabled_slots);
|
||||
};
|
||||
|
||||
// Ask Rachel
|
||||
freestar.config.channel = '/4735792/reuters.com/home';
|
||||
|
||||
trackTiming('onetrust_start');
|
||||
|
||||
(<any>window).initBootstrap(
|
||||
{
|
||||
onetrust_logs: getParameterByName(ONETRUST_LOGS) || 'false',
|
||||
|
|
@ -29,33 +27,11 @@ export default () => {
|
|||
onetrust_script_id: ONETRUST_SCRIPT_ID,
|
||||
},
|
||||
(onetrustResponse) => {
|
||||
trackTiming('onetrust_completion');
|
||||
// Never used...
|
||||
// const {
|
||||
// require_consent, // eslint-disable-line camelcase
|
||||
// consent,
|
||||
// require_gdpr_consent, // eslint-disable-line camelcase
|
||||
// gdpr_consent_data, // eslint-disable-line camelcase
|
||||
// require_ccpa_consent, // eslint-disable-line camelcase
|
||||
// ccpa_consent_data, // eslint-disable-line camelcase
|
||||
// } = onetrustResponse;
|
||||
|
||||
// Trigger data layer events to GTM
|
||||
(<any>window).dataLayer = (<any>window).dataLayer || [];
|
||||
(<any>window).dataLayer.push({
|
||||
event: 'bootstrap_results',
|
||||
...onetrustResponse,
|
||||
});
|
||||
|
||||
// Never used...
|
||||
// const opt_in = require_consent ? consent : true; // eslint-disable-line camelcase
|
||||
// const token =
|
||||
// (require_gdpr_consent ? gdpr_consent_data : undefined) || // eslint-disable-line camelcase
|
||||
// (require_ccpa_consent ? ccpa_consent_data : undefined); // eslint-disable-line camelcase
|
||||
// const consent_given = require_consent && consent; // eslint-disable-line camelcase
|
||||
|
||||
const iasPromise = Ias();
|
||||
|
||||
// Ask Thea about Permutive implementation (considering there are no logged in users on Graphics)
|
||||
// Should we use Permutive at all?
|
||||
// Should we import ArcP SDK to graphics to get the same user as logged in on RCom?
|
||||
return Promise.all([iasPromise]).then((responses) => {
|
||||
const [iasResponse] = responses;
|
||||
|
||||
|
|
@ -81,6 +57,7 @@ export default () => {
|
|||
(<any>window).googletag.pubads().setTargeting('adstest', adstest);
|
||||
}
|
||||
|
||||
// Ask Rachel about targeting
|
||||
const template = (<any>document.querySelector('meta[name="ad:template"]'))?.content;
|
||||
if (template) {
|
||||
(<any>window).googletag.pubads().setTargeting('template', template);
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
import trackTiming from './trackTiming';
|
||||
|
||||
const IAS_REQUEST_TIMEOUT = 600;
|
||||
|
||||
export default () => {
|
||||
return new Promise((resolve) => {
|
||||
trackTiming('ias_start');
|
||||
const timerId = setTimeout(() => {
|
||||
trackTiming('ias_completion_with_timeout');
|
||||
resolve('Resolved with timeout');
|
||||
}, IAS_REQUEST_TIMEOUT);
|
||||
|
||||
const setupIAS = () => {
|
||||
clearTimeout(timerId);
|
||||
trackTiming('ias_completion');
|
||||
(<any>window).__iasPET = (<any>window).__iasPET || {};
|
||||
(<any>window).__iasPET.queue = (<any>window).__iasPET.queue || [];
|
||||
(<any>window).__iasPET.pubId = '931336';
|
||||
(<any>window).__iasPET.pubId = '931336'; // Ask Rachel
|
||||
resolve('loaded');
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
export default (timingName: string) => {
|
||||
const timestamp = window.performance.now();
|
||||
(<any>window).dataLayer = (<any>window).dataLayer || [];
|
||||
(<any>window).dataLayer.push({
|
||||
event: 'rum_add_timing',
|
||||
rum_timing_name: timingName,
|
||||
rum_timing_timestamp: timestamp,
|
||||
});
|
||||
};
|
||||
Loading…
Reference in a new issue