@guardian/commercial-core 7.1.0 → 27.1.0
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.
- package/LICENSE +201 -0
- package/README.md +23 -34
- package/dist/cjs/ad-sizes.d.ts +150 -8
- package/dist/cjs/ad-sizes.js +129 -38
- package/dist/cjs/breakpoint.d.ts +8 -0
- package/dist/cjs/breakpoint.js +10 -0
- package/dist/cjs/constants/index.d.ts +1 -1
- package/dist/cjs/constants/index.js +2 -2
- package/dist/cjs/detect-ad-blocker.js +1 -2
- package/dist/cjs/event-timer.d.ts +60 -48
- package/dist/cjs/event-timer.js +149 -115
- package/dist/cjs/geo/country-code.d.ts +3 -0
- package/dist/cjs/geo/country-code.js +34 -0
- package/dist/cjs/geo/geo-utils.d.ts +11 -0
- package/dist/cjs/geo/geo-utils.js +31 -0
- package/dist/cjs/global.d.ts +58 -10
- package/dist/cjs/index.d.ts +9 -39
- package/dist/cjs/index.js +12 -67
- package/dist/cjs/send-commercial-metrics.d.ts +8 -2
- package/dist/cjs/send-commercial-metrics.js +51 -27
- package/dist/cjs/targeting/build-page-targeting.d.ts +4 -5
- package/dist/cjs/targeting/build-page-targeting.js +35 -7
- package/dist/cjs/targeting/content.d.ts +1 -1
- package/dist/cjs/targeting/content.js +1 -1
- package/dist/cjs/targeting/personalised.d.ts +2 -3
- package/dist/cjs/targeting/personalised.js +3 -3
- package/dist/cjs/targeting/pick-targeting-values.d.ts +1 -1
- package/dist/cjs/targeting/session.d.ts +2 -2
- package/dist/cjs/targeting/shared.d.ts +31 -20
- package/dist/cjs/targeting/shared.js +0 -30
- package/dist/cjs/targeting/teads-eligibility.d.ts +2 -0
- package/dist/cjs/targeting/teads-eligibility.js +20 -0
- package/dist/cjs/targeting/types.d.ts +6 -0
- package/dist/cjs/targeting/types.js +2 -0
- package/dist/cjs/targeting/viewport.d.ts +1 -1
- package/dist/cjs/targeting/youtube-ima.d.ts +4 -3
- package/dist/cjs/targeting/youtube-ima.js +7 -4
- package/dist/cjs/types.d.ts +403 -63
- package/dist/cjs/types.js +11 -0
- package/dist/esm/ad-sizes.d.ts +150 -8
- package/dist/esm/ad-sizes.js +127 -38
- package/dist/esm/breakpoint.d.ts +8 -0
- package/dist/esm/breakpoint.js +6 -0
- package/dist/esm/constants/index.d.ts +1 -1
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/event-timer.d.ts +60 -48
- package/dist/esm/event-timer.js +147 -115
- package/dist/esm/geo/country-code.d.ts +3 -0
- package/dist/esm/geo/country-code.js +31 -0
- package/dist/esm/geo/geo-utils.d.ts +11 -0
- package/dist/esm/geo/geo-utils.js +20 -0
- package/dist/esm/global.d.ts +58 -10
- package/dist/esm/global.js +0 -1
- package/dist/esm/index.d.ts +9 -39
- package/dist/esm/index.js +6 -31
- package/dist/esm/send-commercial-metrics.d.ts +8 -2
- package/dist/esm/send-commercial-metrics.js +48 -25
- package/dist/esm/targeting/build-page-targeting.d.ts +4 -5
- package/dist/esm/targeting/build-page-targeting.js +35 -7
- package/dist/esm/targeting/content.d.ts +1 -1
- package/dist/esm/targeting/content.js +1 -1
- package/dist/esm/targeting/personalised.d.ts +2 -3
- package/dist/esm/targeting/personalised.js +3 -3
- package/dist/esm/targeting/pick-targeting-values.d.ts +1 -1
- package/dist/esm/targeting/session.d.ts +2 -2
- package/dist/esm/targeting/shared.d.ts +31 -20
- package/dist/esm/targeting/shared.js +0 -30
- package/dist/esm/targeting/teads-eligibility.d.ts +2 -0
- package/dist/esm/targeting/teads-eligibility.js +17 -0
- package/dist/esm/targeting/types.d.ts +6 -0
- package/dist/esm/targeting/types.js +0 -0
- package/dist/esm/targeting/viewport.d.ts +1 -1
- package/dist/esm/targeting/youtube-ima.d.ts +4 -3
- package/dist/esm/targeting/youtube-ima.js +7 -4
- package/dist/esm/types.d.ts +403 -63
- package/dist/esm/types.js +11 -1
- package/package.json +64 -83
- package/dist/cjs/__vendor/a9-apstag.d.ts +0 -1
- package/dist/cjs/__vendor/a9-apstag.js +0 -34
- package/dist/cjs/__vendor/ipsos-mori.d.ts +0 -1
- package/dist/cjs/__vendor/ipsos-mori.js +0 -18
- package/dist/cjs/__vendor/launchpad.d.ts +0 -1
- package/dist/cjs/__vendor/launchpad.js +0 -25
- package/dist/cjs/__vendor/pubmatic.d.ts +0 -1
- package/dist/cjs/__vendor/pubmatic.js +0 -49
- package/dist/cjs/__vendor/twitter-script.d.ts +0 -1
- package/dist/cjs/__vendor/twitter-script.js +0 -26
- package/dist/cjs/create-ad-slot.d.ts +0 -17
- package/dist/cjs/create-ad-slot.js +0 -107
- package/dist/cjs/google-analytics.d.ts +0 -1
- package/dist/cjs/google-analytics.js +0 -14
- package/dist/cjs/lib/ab-localstorage.d.ts +0 -2
- package/dist/cjs/lib/ab-localstorage.js +0 -14
- package/dist/cjs/lib/breakpoint.d.ts +0 -4
- package/dist/cjs/lib/breakpoint.js +0 -5
- package/dist/cjs/lib/can-use-dom.d.ts +0 -2
- package/dist/cjs/lib/can-use-dom.js +0 -9
- package/dist/cjs/lib/construct-query.d.ts +0 -3
- package/dist/cjs/lib/construct-query.js +0 -12
- package/dist/cjs/messenger.d.ts +0 -97
- package/dist/cjs/messenger.js +0 -281
- package/dist/cjs/targeting/build-page-targeting-consentless.d.ts +0 -15
- package/dist/cjs/targeting/build-page-targeting-consentless.js +0 -46
- package/dist/cjs/targeting/youtube.d.ts +0 -13
- package/dist/cjs/targeting/youtube.js +0 -64
- package/dist/cjs/third-party-tags/ias.d.ts +0 -7
- package/dist/cjs/third-party-tags/ias.js +0 -14
- package/dist/cjs/third-party-tags/inizio.d.ts +0 -13
- package/dist/cjs/third-party-tags/inizio.js +0 -39
- package/dist/cjs/third-party-tags/permutive.d.ts +0 -6
- package/dist/cjs/third-party-tags/permutive.js +0 -13
- package/dist/cjs/third-party-tags/remarketing.d.ts +0 -7
- package/dist/cjs/third-party-tags/remarketing.js +0 -22
- package/dist/cjs/third-party-tags/twitter-uwt.d.ts +0 -7
- package/dist/cjs/third-party-tags/twitter-uwt.js +0 -15
- package/dist/cjs/track-gpc-signal.d.ts +0 -7
- package/dist/cjs/track-gpc-signal.js +0 -17
- package/dist/cjs/track-labs-container.d.ts +0 -7
- package/dist/cjs/track-labs-container.js +0 -35
- package/dist/cjs/track-scroll-depth.d.ts +0 -8
- package/dist/cjs/track-scroll-depth.js +0 -41
- package/dist/esm/__vendor/a9-apstag.d.ts +0 -1
- package/dist/esm/__vendor/a9-apstag.js +0 -30
- package/dist/esm/__vendor/ipsos-mori.d.ts +0 -1
- package/dist/esm/__vendor/ipsos-mori.js +0 -14
- package/dist/esm/__vendor/launchpad.d.ts +0 -1
- package/dist/esm/__vendor/launchpad.js +0 -21
- package/dist/esm/__vendor/pubmatic.d.ts +0 -1
- package/dist/esm/__vendor/pubmatic.js +0 -45
- package/dist/esm/__vendor/twitter-script.d.ts +0 -1
- package/dist/esm/__vendor/twitter-script.js +0 -22
- package/dist/esm/create-ad-slot.d.ts +0 -17
- package/dist/esm/create-ad-slot.js +0 -103
- package/dist/esm/google-analytics.d.ts +0 -1
- package/dist/esm/google-analytics.js +0 -10
- package/dist/esm/lib/ab-localstorage.d.ts +0 -2
- package/dist/esm/lib/ab-localstorage.js +0 -10
- package/dist/esm/lib/breakpoint.d.ts +0 -4
- package/dist/esm/lib/breakpoint.js +0 -2
- package/dist/esm/lib/can-use-dom.d.ts +0 -2
- package/dist/esm/lib/can-use-dom.js +0 -6
- package/dist/esm/lib/construct-query.d.ts +0 -3
- package/dist/esm/lib/construct-query.js +0 -9
- package/dist/esm/messenger.d.ts +0 -97
- package/dist/esm/messenger.js +0 -274
- package/dist/esm/targeting/build-page-targeting-consentless.d.ts +0 -15
- package/dist/esm/targeting/build-page-targeting-consentless.js +0 -43
- package/dist/esm/targeting/youtube.d.ts +0 -13
- package/dist/esm/targeting/youtube.js +0 -60
- package/dist/esm/third-party-tags/ias.d.ts +0 -7
- package/dist/esm/third-party-tags/ias.js +0 -10
- package/dist/esm/third-party-tags/inizio.d.ts +0 -13
- package/dist/esm/third-party-tags/inizio.js +0 -35
- package/dist/esm/third-party-tags/permutive.d.ts +0 -6
- package/dist/esm/third-party-tags/permutive.js +0 -9
- package/dist/esm/third-party-tags/remarketing.d.ts +0 -7
- package/dist/esm/third-party-tags/remarketing.js +0 -18
- package/dist/esm/third-party-tags/twitter-uwt.d.ts +0 -7
- package/dist/esm/third-party-tags/twitter-uwt.js +0 -11
- package/dist/esm/track-gpc-signal.d.ts +0 -7
- package/dist/esm/track-gpc-signal.js +0 -14
- package/dist/esm/track-labs-container.d.ts +0 -7
- package/dist/esm/track-labs-container.js +0 -32
- package/dist/esm/track-scroll-depth.d.ts +0 -8
- package/dist/esm/track-scroll-depth.js +0 -38
- /package/dist/cjs/constants/{adLabelHeight.d.ts → ad-label-height.d.ts} +0 -0
- /package/dist/cjs/constants/{adLabelHeight.js → ad-label-height.js} +0 -0
- /package/dist/cjs/{lib → geo}/get-locale.d.ts +0 -0
- /package/dist/cjs/{lib → geo}/get-locale.js +0 -0
- /package/dist/esm/constants/{adLabelHeight.d.ts → ad-label-height.d.ts} +0 -0
- /package/dist/esm/constants/{adLabelHeight.js → ad-label-height.js} +0 -0
- /package/dist/esm/{lib → geo}/get-locale.d.ts +0 -0
- /package/dist/esm/{lib → geo}/get-locale.js +0 -0
package/dist/cjs/event-timer.js
CHANGED
|
@@ -1,27 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventTimer = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
exports.supportsPerformanceAPI = exports._ = exports.EventTimer = void 0;
|
|
4
|
+
const libs_1 = require("@guardian/libs");
|
|
5
|
+
const supportsPerformanceAPI = () => typeof window !== 'undefined' &&
|
|
6
|
+
typeof window.performance !== 'undefined' &&
|
|
7
|
+
typeof window.performance.mark === 'function';
|
|
8
|
+
exports.supportsPerformanceAPI = supportsPerformanceAPI;
|
|
9
|
+
// Events will be logged using the performance API for all slots, but only these slots will be tracked as commercial metrics and sent to the data lake
|
|
10
|
+
const trackedSlots = [
|
|
11
|
+
'top-above-nav',
|
|
12
|
+
'inline1',
|
|
13
|
+
'inline2',
|
|
14
|
+
'fronts-banner-1',
|
|
15
|
+
'fronts-banner-2',
|
|
16
|
+
];
|
|
17
|
+
// marks that we want to save as commercial metrics
|
|
18
|
+
const slotMarks = [
|
|
19
|
+
'slotReady',
|
|
20
|
+
'adRenderStart',
|
|
21
|
+
'prebidStart',
|
|
22
|
+
'adOnPage',
|
|
23
|
+
'viewable',
|
|
24
|
+
];
|
|
25
|
+
// measures that we want to save as commercial metrics
|
|
26
|
+
const slotMeasures = [
|
|
27
|
+
'adRender',
|
|
28
|
+
'defineSlot',
|
|
29
|
+
'prepareSlot',
|
|
30
|
+
'prebid',
|
|
31
|
+
'fetchAd',
|
|
32
|
+
];
|
|
33
|
+
const pageMarks = ['commercialStart', 'commercialModulesLoaded'];
|
|
34
|
+
// measures that we want to save as commercial metrics
|
|
35
|
+
const pageMeasures = ['commercialBoot', 'googletagInit'];
|
|
36
|
+
// all marks, including the measure start and end marks
|
|
37
|
+
const allSlotMarks = [
|
|
38
|
+
...slotMarks,
|
|
39
|
+
...slotMeasures.map((measure) => `${measure}Start`),
|
|
40
|
+
...slotMeasures.map((measure) => `${measure}End`),
|
|
41
|
+
];
|
|
42
|
+
const externalMarks = [
|
|
43
|
+
'cmp-init',
|
|
44
|
+
'cmp-ui-displayed',
|
|
45
|
+
'cmp-got-consent',
|
|
46
|
+
];
|
|
47
|
+
const shouldSave = (name) => {
|
|
48
|
+
let [origin, type] = name.split('_');
|
|
49
|
+
if (!type) {
|
|
50
|
+
type = origin;
|
|
51
|
+
origin = 'page';
|
|
9
52
|
}
|
|
10
|
-
|
|
53
|
+
const shouldSaveMark = (trackedSlots.includes(origin) &&
|
|
54
|
+
slotMarks.includes(type)) ||
|
|
55
|
+
(origin === 'page' && pageMarks.includes(type));
|
|
56
|
+
const shouldSaveMeasure = (trackedSlots.includes(origin) &&
|
|
57
|
+
slotMeasures.includes(type)) ||
|
|
58
|
+
(origin === 'page' && pageMeasures.includes(type));
|
|
59
|
+
return shouldSaveMark || shouldSaveMeasure;
|
|
60
|
+
};
|
|
11
61
|
class EventTimer {
|
|
62
|
+
_marks;
|
|
63
|
+
_measures;
|
|
64
|
+
properties;
|
|
12
65
|
/**
|
|
13
66
|
* Initialise the EventTimer class on page.
|
|
14
67
|
* Returns the singleton instance of the EventTimer class and binds
|
|
15
68
|
* to window.guardian.commercialTimer. If it's been previously
|
|
16
69
|
* initialised and bound it returns the original instance
|
|
17
70
|
* Note: We save to window.guardian.commercialTimer because
|
|
18
|
-
* different bundles (DCR / DCP) can use commercial
|
|
71
|
+
* different bundles (DCR / DCP) can use commercial, and we want
|
|
19
72
|
* all timer events saved to a single instance per-page
|
|
20
73
|
* @returns {EventTimer} Instance of EventTimer
|
|
21
74
|
*/
|
|
22
75
|
static init() {
|
|
23
|
-
|
|
24
|
-
return ((_a = window.guardian).commercialTimer || (_a.commercialTimer = new EventTimer()));
|
|
76
|
+
return (window.guardian.commercialTimer ??= new EventTimer());
|
|
25
77
|
}
|
|
26
78
|
/**
|
|
27
79
|
* Just a helper method to access the singleton instance of EventTimer.
|
|
@@ -31,68 +83,42 @@ class EventTimer {
|
|
|
31
83
|
return this.init();
|
|
32
84
|
}
|
|
33
85
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
86
|
+
* These are marks that are not triggered by commercial but we are interested in
|
|
87
|
+
* tracking their performance. For example, CMP-related events.
|
|
88
|
+
**/
|
|
89
|
+
get _externalMarks() {
|
|
90
|
+
if (!supportsPerformanceAPI()) {
|
|
91
|
+
return new Map();
|
|
92
|
+
}
|
|
93
|
+
return externalMarks.reduce((map, mark) => {
|
|
94
|
+
const entries = window.performance.getEntriesByName(mark);
|
|
95
|
+
if (entries.length && entries[0]) {
|
|
96
|
+
map.set(mark, entries[0]);
|
|
97
|
+
}
|
|
98
|
+
return map;
|
|
99
|
+
}, new Map());
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Returns all performance marks that should be saved as commercial metrics.
|
|
36
103
|
*/
|
|
37
|
-
get
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: this._events;
|
|
104
|
+
get marks() {
|
|
105
|
+
return [...this._marks, ...this._externalMarks].map(([name, timer]) => ({
|
|
106
|
+
name,
|
|
107
|
+
ts: timer.startTime,
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns all performance measures that should be saved as commercial metrics.
|
|
112
|
+
*/
|
|
113
|
+
get measures() {
|
|
114
|
+
return [...this._measures].map(([name, measure]) => ({
|
|
115
|
+
name,
|
|
116
|
+
duration: measure.duration,
|
|
117
|
+
}));
|
|
52
118
|
}
|
|
53
119
|
constructor() {
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.triggers = {
|
|
57
|
-
first: {
|
|
58
|
-
slotReady: false,
|
|
59
|
-
prebidStart: false,
|
|
60
|
-
prebidEnd: false,
|
|
61
|
-
slotInitialised: false,
|
|
62
|
-
adOnPage: false,
|
|
63
|
-
},
|
|
64
|
-
'top-above-nav': {
|
|
65
|
-
slotReady: false,
|
|
66
|
-
prebidStart: false,
|
|
67
|
-
prebidEnd: false,
|
|
68
|
-
slotInitialised: false,
|
|
69
|
-
adOnPage: false,
|
|
70
|
-
},
|
|
71
|
-
page: {
|
|
72
|
-
commercialStart: false,
|
|
73
|
-
commercialExtraModulesLoaded: false,
|
|
74
|
-
commercialBaseModulesLoaded: false,
|
|
75
|
-
commercialModulesLoaded: false,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
this.gaConfig = {
|
|
79
|
-
logEvents: [
|
|
80
|
-
{
|
|
81
|
-
timingVariable: 'slotReady',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
timingVariable: 'slotInitialised',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
timingVariable: 'commercialStart',
|
|
88
|
-
timingLabel: 'Commercial start parse time',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
timingVariable: 'commercialModulesLoaded',
|
|
92
|
-
timingLabel: 'Commercial end parse time',
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
};
|
|
120
|
+
this._marks = new Map();
|
|
121
|
+
this._measures = new Map();
|
|
96
122
|
this.properties = {};
|
|
97
123
|
if (window.navigator.connection) {
|
|
98
124
|
this.properties.type = window.navigator.connection.type;
|
|
@@ -102,7 +128,7 @@ class EventTimer {
|
|
|
102
128
|
}
|
|
103
129
|
}
|
|
104
130
|
/**
|
|
105
|
-
* Adds
|
|
131
|
+
* Adds a non timer measurement
|
|
106
132
|
*
|
|
107
133
|
* @param {string} name - the property's name
|
|
108
134
|
* @param value - the property's value
|
|
@@ -111,60 +137,68 @@ class EventTimer {
|
|
|
111
137
|
this.properties[name] = value;
|
|
112
138
|
}
|
|
113
139
|
/**
|
|
114
|
-
* Creates a new performance mark
|
|
115
|
-
*
|
|
116
|
-
*
|
|
140
|
+
* Creates a new performance mark, and if the mark ends with 'End' it will
|
|
141
|
+
* create a performance measure between the start and end marks.
|
|
142
|
+
*
|
|
143
|
+
* Marks can be triggered multiple times, but we only save the first
|
|
144
|
+
* instance of a mark, as things like ad refreshes can trigger the same mark.
|
|
117
145
|
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
146
|
+
* More info on the performance API:
|
|
147
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark
|
|
148
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure
|
|
149
|
+
*
|
|
150
|
+
* @todo more strict typing for eventName and origin
|
|
151
|
+
* @param eventName The short name applied to the mark
|
|
152
|
+
* @param origin - Either 'page' (default) or the name of the slot
|
|
120
153
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (origin
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this.triggers.page[eventName] = true;
|
|
154
|
+
mark(eventName, origin = 'page') {
|
|
155
|
+
let name = eventName;
|
|
156
|
+
if (allSlotMarks.includes(eventName) && origin !== 'page') {
|
|
157
|
+
name = `${origin}_${name}`;
|
|
158
|
+
}
|
|
159
|
+
if (!!this._marks.get(name) || !supportsPerformanceAPI()) {
|
|
128
160
|
return;
|
|
129
161
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
162
|
+
const mark = window.performance.mark(name);
|
|
163
|
+
if (
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- browser support is patchy
|
|
165
|
+
typeof mark?.startTime === 'number' &&
|
|
166
|
+
// we only want to save the marks that are related to certain slots or the page
|
|
167
|
+
shouldSave(name)) {
|
|
168
|
+
this._marks.set(name, mark);
|
|
135
169
|
}
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
const trackLabel = `${TRACKED_SLOT_NAME}-${eventName}`;
|
|
139
|
-
this.mark(trackLabel);
|
|
140
|
-
this.trackInGA(eventName, trackLabel);
|
|
141
|
-
this.triggers[TRACKED_SLOT_NAME][eventName] = true;
|
|
142
|
-
}
|
|
170
|
+
if (name.endsWith('End')) {
|
|
171
|
+
this.measure(name);
|
|
143
172
|
}
|
|
144
173
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Creates a performance measure given the name of the end marks.
|
|
176
|
+
* The start mark is inferred from the end mark.
|
|
177
|
+
*
|
|
178
|
+
* @param endMark - The name of the mark that ends the measure
|
|
179
|
+
**/
|
|
180
|
+
measure(endMark) {
|
|
181
|
+
const startMark = endMark.replace('End', 'Start');
|
|
182
|
+
const measureName = endMark.replace('End', '');
|
|
183
|
+
const startMarkExists = window.performance.getEntriesByName(startMark).length > 0;
|
|
184
|
+
if (startMarkExists) {
|
|
185
|
+
try {
|
|
186
|
+
const measure = window.performance.measure(measureName, startMark, endMark);
|
|
187
|
+
// we only want to save the measures that are related to certain slots or the page
|
|
188
|
+
if (measure && shouldSave(measureName)) {
|
|
189
|
+
this._measures.set(measureName, measure);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
(0, libs_1.log)('commercial', `error measuring ${measureName}`, e);
|
|
154
194
|
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
trackInGA(eventName, label = '') {
|
|
158
|
-
const gaEvent = this.gaConfig.logEvents.find((e) => e.timingVariable === eventName);
|
|
159
|
-
if (gaEvent) {
|
|
160
|
-
const labelToUse = gaEvent.timingLabel ?? label;
|
|
161
|
-
(0, google_analytics_1.trackEvent)('Commercial Events', gaEvent.timingVariable, labelToUse);
|
|
162
195
|
}
|
|
163
196
|
}
|
|
164
197
|
}
|
|
165
198
|
exports.EventTimer = EventTimer;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
199
|
+
const _ = {
|
|
200
|
+
slotMarks,
|
|
201
|
+
slotMeasures,
|
|
202
|
+
trackedSlots,
|
|
203
|
+
};
|
|
204
|
+
exports._ = _;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCountryCode = void 0;
|
|
4
|
+
const libs_1 = require("@guardian/libs");
|
|
5
|
+
const editionToCountryCodeMap = {
|
|
6
|
+
UK: 'GB',
|
|
7
|
+
US: 'US',
|
|
8
|
+
AU: 'AU',
|
|
9
|
+
};
|
|
10
|
+
const editionToCountryCode = (editionKey = 'UK') => editionToCountryCodeMap[editionKey];
|
|
11
|
+
const countryCookieName = 'GU_geo_country';
|
|
12
|
+
const countryOverrideName = 'gu.geo.override';
|
|
13
|
+
let locale;
|
|
14
|
+
/*
|
|
15
|
+
This method can be used as a non async way of getting the country code
|
|
16
|
+
after init has been called. Returning locale should cover all/most
|
|
17
|
+
of the cases but if a race condition happen or the cookie is not set,
|
|
18
|
+
we keep fallbacks to cookie or geo from edition.
|
|
19
|
+
*/
|
|
20
|
+
const getCountryCode = () => {
|
|
21
|
+
const pageEdition = window.guardian.config.page.edition;
|
|
22
|
+
const maybeCountryOverride = libs_1.storage.local.get(countryOverrideName);
|
|
23
|
+
const countryOverride = (0, libs_1.isString)(maybeCountryOverride)
|
|
24
|
+
? maybeCountryOverride
|
|
25
|
+
: null;
|
|
26
|
+
return (locale ??
|
|
27
|
+
countryOverride ??
|
|
28
|
+
(0, libs_1.getCookie)({
|
|
29
|
+
name: countryCookieName,
|
|
30
|
+
shouldMemoize: true,
|
|
31
|
+
}) ??
|
|
32
|
+
editionToCountryCode(pageEdition));
|
|
33
|
+
};
|
|
34
|
+
exports.getCountryCode = getCountryCode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const isInUk: () => boolean;
|
|
2
|
+
export declare const isInUsa: () => boolean;
|
|
3
|
+
export declare const isInCanada: () => boolean;
|
|
4
|
+
export declare const isInAustralia: () => boolean;
|
|
5
|
+
export declare const isInNewZealand: () => boolean;
|
|
6
|
+
export declare const isInUsOrCa: () => boolean;
|
|
7
|
+
export declare const isInAuOrNz: () => boolean;
|
|
8
|
+
export declare const isInRow: () => boolean;
|
|
9
|
+
export declare const _: {
|
|
10
|
+
resetModule: () => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._ = exports.isInRow = exports.isInAuOrNz = exports.isInUsOrCa = exports.isInNewZealand = exports.isInAustralia = exports.isInCanada = exports.isInUsa = exports.isInUk = void 0;
|
|
4
|
+
const country_code_1 = require("./country-code");
|
|
5
|
+
// cache the users location so we only have to look it up once
|
|
6
|
+
let geo;
|
|
7
|
+
const currentGeoLocation = () => {
|
|
8
|
+
geo = geo ?? (0, country_code_1.getCountryCode)();
|
|
9
|
+
return geo;
|
|
10
|
+
};
|
|
11
|
+
const isInUk = () => currentGeoLocation() === 'GB';
|
|
12
|
+
exports.isInUk = isInUk;
|
|
13
|
+
const isInUsa = () => currentGeoLocation() === 'US';
|
|
14
|
+
exports.isInUsa = isInUsa;
|
|
15
|
+
const isInCanada = () => currentGeoLocation() === 'CA';
|
|
16
|
+
exports.isInCanada = isInCanada;
|
|
17
|
+
const isInAustralia = () => currentGeoLocation() === 'AU';
|
|
18
|
+
exports.isInAustralia = isInAustralia;
|
|
19
|
+
const isInNewZealand = () => currentGeoLocation() === 'NZ';
|
|
20
|
+
exports.isInNewZealand = isInNewZealand;
|
|
21
|
+
const isInUsOrCa = () => (0, exports.isInUsa)() || (0, exports.isInCanada)();
|
|
22
|
+
exports.isInUsOrCa = isInUsOrCa;
|
|
23
|
+
const isInAuOrNz = () => (0, exports.isInAustralia)() || (0, exports.isInNewZealand)();
|
|
24
|
+
exports.isInAuOrNz = isInAuOrNz;
|
|
25
|
+
const isInRow = () => !(0, exports.isInUk)() && !(0, exports.isInUsOrCa)() && !(0, exports.isInAuOrNz)();
|
|
26
|
+
exports.isInRow = isInRow;
|
|
27
|
+
exports._ = {
|
|
28
|
+
resetModule: () => {
|
|
29
|
+
geo = undefined;
|
|
30
|
+
},
|
|
31
|
+
};
|
package/dist/cjs/global.d.ts
CHANGED
|
@@ -1,23 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
import type { GoogleTagParams, GoogleTrackConversionObject,
|
|
3
|
-
import type { EventTimer } from '.';
|
|
1
|
+
import type { EventTimer } from './event-timer';
|
|
2
|
+
import type { AdBlockers, Apstag, ArticleCounts, ComscoreGlobals, Confiant, Config, DfpEnv, FetchBidResponse, GoogleTagParams, GoogleTrackConversionObject, HeaderNotification, IasPET, NetworkInformation, NSdkInstance, Ophan, OptOutAdSlot, OptOutInitializeOptions, Permutive, SafeFrameAPI, TeadsAnalytics, Trac } from './types';
|
|
4
3
|
declare global {
|
|
5
4
|
interface Navigator {
|
|
6
5
|
readonly connection?: NetworkInformation;
|
|
6
|
+
readonly cookieDeprecationLabel?: {
|
|
7
|
+
getValue: () => Promise<string>;
|
|
8
|
+
};
|
|
7
9
|
}
|
|
8
10
|
interface Window {
|
|
11
|
+
guardian: {
|
|
12
|
+
ophan?: Ophan;
|
|
13
|
+
config: Config;
|
|
14
|
+
queue: Array<() => Promise<void>>;
|
|
15
|
+
mustardCut?: boolean;
|
|
16
|
+
polyfilled?: boolean;
|
|
17
|
+
adBlockers: AdBlockers;
|
|
18
|
+
css: {
|
|
19
|
+
onLoad: () => void;
|
|
20
|
+
loaded: boolean;
|
|
21
|
+
};
|
|
22
|
+
articleCounts?: ArticleCounts;
|
|
23
|
+
commercial?: {
|
|
24
|
+
dfpEnv?: DfpEnv;
|
|
25
|
+
a9WinningBids?: FetchBidResponse[];
|
|
26
|
+
};
|
|
27
|
+
notificationEventHistory?: HeaderNotification[][];
|
|
28
|
+
commercialTimer?: EventTimer;
|
|
29
|
+
offlineCount?: number;
|
|
30
|
+
modules: {
|
|
31
|
+
sentry?: {
|
|
32
|
+
reportError?: (error: Error, feature: string, tags?: Record<string, string>, extras?: Record<string, unknown>) => void;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
ootag: {
|
|
37
|
+
queue: Array<() => void>;
|
|
38
|
+
initializeOo: (o: OptOutInitializeOptions) => void;
|
|
39
|
+
addParameter: (key: string, value: string | string[]) => void;
|
|
40
|
+
addParameterForSlot: (slotId: string, key: string, value: string | string[]) => void;
|
|
41
|
+
defineSlot: (o: OptOutAdSlot) => void;
|
|
42
|
+
makeRequests: () => void;
|
|
43
|
+
refreshSlot: (slotId: string) => void;
|
|
44
|
+
refreshAllSlots: () => void;
|
|
45
|
+
logger: (...args: unknown[]) => void;
|
|
46
|
+
};
|
|
47
|
+
readonly navigator: Navigator;
|
|
48
|
+
confiant?: Confiant;
|
|
49
|
+
apstag?: Apstag;
|
|
50
|
+
permutive?: Permutive;
|
|
51
|
+
_comscore?: ComscoreGlobals[];
|
|
52
|
+
__iasPET?: IasPET;
|
|
53
|
+
teads_analytics?: TeadsAnalytics;
|
|
54
|
+
$sf: SafeFrameAPI;
|
|
55
|
+
conf: unknown;
|
|
56
|
+
NOLCMB: {
|
|
57
|
+
getInstance: (apid: string) => NSdkInstance;
|
|
58
|
+
};
|
|
59
|
+
nol_t: (pvar: {
|
|
60
|
+
cid: string;
|
|
61
|
+
content: string;
|
|
62
|
+
server: string;
|
|
63
|
+
}) => Trac;
|
|
9
64
|
google_trackConversion?: (arg0: GoogleTrackConversionObject) => void;
|
|
10
65
|
google_tag_params?: GoogleTagParams;
|
|
11
66
|
_brandmetrics?: Array<{
|
|
12
67
|
cmd: string;
|
|
13
68
|
val: Record<string, unknown>;
|
|
14
69
|
}>;
|
|
15
|
-
guardian: {
|
|
16
|
-
commercialTimer?: EventTimer;
|
|
17
|
-
config: GuardianWindowConfig;
|
|
18
|
-
offlineCount?: number;
|
|
19
|
-
};
|
|
20
|
-
ga: UniversalAnalytics.ga | null;
|
|
21
|
-
readonly navigator: Navigator;
|
|
22
70
|
}
|
|
23
71
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,43 +1,13 @@
|
|
|
1
|
-
export { ias } from './third-party-tags/ias';
|
|
2
|
-
export { permutive } from './third-party-tags/permutive';
|
|
3
|
-
export { twitter } from './third-party-tags/twitter-uwt';
|
|
4
|
-
export { inizio } from './third-party-tags/inizio';
|
|
5
|
-
export { remarketing } from './third-party-tags/remarketing';
|
|
6
|
-
export { EventTimer } from './event-timer';
|
|
7
|
-
export { bypassCommercialMetricsSampling, initCommercialMetrics, } from './send-commercial-metrics';
|
|
8
|
-
export type { ThirdPartyTag } from './types';
|
|
9
|
-
export { adSizes, createAdSize, getAdSize, outstreamSizes, slotSizeMappings, standardAdSizes, } from './ad-sizes';
|
|
10
|
-
export { isBreakpoint } from './lib/breakpoint';
|
|
11
|
-
export type { Breakpoint } from './lib/breakpoint';
|
|
12
|
-
export type { SizeKeys, AdSizeString, AdSize, SizeMapping, SlotSizeMappings, SlotName, } from './ad-sizes';
|
|
13
1
|
export { isAdBlockInUse } from './detect-ad-blocker';
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export { initTrackLabsContainer } from './track-labs-container';
|
|
17
|
-
export { initTrackGpcSignal } from './track-gpc-signal';
|
|
18
|
-
export { buildAdsConfigWithConsent, disabledAds } from './targeting/youtube';
|
|
19
|
-
export { createAdSlot, concatSizeMappings } from './create-ad-slot';
|
|
20
|
-
export type { AdsConfig, AdsConfigBasic, AdsConfigDisabled, AdTargetingBuilder, CustomParams, } from './types';
|
|
2
|
+
export { EventTimer } from './event-timer';
|
|
3
|
+
export { adSizes } from './ad-sizes';
|
|
21
4
|
export * as constants from './constants';
|
|
22
|
-
export
|
|
23
|
-
export { getContentTargeting } from './targeting/content';
|
|
24
|
-
export type { PersonalisedTargeting } from './targeting/personalised';
|
|
25
|
-
export { getPersonalisedTargeting } from './targeting/personalised';
|
|
26
|
-
export type { SessionTargeting } from './targeting/session';
|
|
27
|
-
export { getSessionTargeting } from './targeting/session';
|
|
28
|
-
export type { SharedTargeting } from './targeting/shared';
|
|
29
|
-
export { getSharedTargeting } from './targeting/shared';
|
|
30
|
-
export type { ViewportTargeting } from './targeting/viewport';
|
|
31
|
-
export { getViewportTargeting } from './targeting/viewport';
|
|
32
|
-
export { pickTargetingValues } from './targeting/pick-targeting-values';
|
|
33
|
-
export { init as initMessenger } from './messenger';
|
|
34
|
-
export type { RegisterListener, RegisterPersistentListener, RespondProxy, } from './messenger';
|
|
35
|
-
export { postMessage } from './messenger/post-message';
|
|
5
|
+
export { bypassCommercialMetricsSampling, initCommercialMetrics, } from './send-commercial-metrics';
|
|
36
6
|
export { buildPageTargeting } from './targeting/build-page-targeting';
|
|
37
|
-
export {
|
|
38
|
-
export type { PageTargeting } from './targeting/build-page-targeting';
|
|
39
|
-
export { a9Apstag } from './__vendor/a9-apstag';
|
|
40
|
-
export { ipsosMoriStub } from './__vendor/ipsos-mori';
|
|
41
|
-
export { launchpad } from './__vendor/launchpad';
|
|
42
|
-
export { pubmatic } from './__vendor/pubmatic';
|
|
7
|
+
export { postMessage } from './messenger/post-message';
|
|
43
8
|
export { buildImaAdTagUrl } from './targeting/youtube-ima';
|
|
9
|
+
export { getPermutivePFPSegments } from './permutive';
|
|
10
|
+
export { isEligibleForTeads } from './targeting/teads-eligibility';
|
|
11
|
+
export type { AdSize, SizeMapping, SlotName } from './ad-sizes';
|
|
12
|
+
export type { PageTargeting } from './targeting/build-page-targeting';
|
|
13
|
+
export type { AdsConfigDisabled, AdsConfigUSNATorAus, AdsConfigTCFV2, } from './types';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* istanbul ignore file -- there's no point check this for test coverage */
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -24,78 +23,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
23
|
return result;
|
|
25
24
|
};
|
|
26
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
var
|
|
29
|
-
Object.defineProperty(exports, "
|
|
30
|
-
var permutive_1 = require("./third-party-tags/permutive");
|
|
31
|
-
Object.defineProperty(exports, "permutive", { enumerable: true, get: function () { return permutive_1.permutive; } });
|
|
32
|
-
var twitter_uwt_1 = require("./third-party-tags/twitter-uwt");
|
|
33
|
-
Object.defineProperty(exports, "twitter", { enumerable: true, get: function () { return twitter_uwt_1.twitter; } });
|
|
34
|
-
var inizio_1 = require("./third-party-tags/inizio");
|
|
35
|
-
Object.defineProperty(exports, "inizio", { enumerable: true, get: function () { return inizio_1.inizio; } });
|
|
36
|
-
var remarketing_1 = require("./third-party-tags/remarketing");
|
|
37
|
-
Object.defineProperty(exports, "remarketing", { enumerable: true, get: function () { return remarketing_1.remarketing; } });
|
|
26
|
+
exports.isEligibleForTeads = exports.getPermutivePFPSegments = exports.buildImaAdTagUrl = exports.buildPageTargeting = exports.initCommercialMetrics = exports.bypassCommercialMetricsSampling = exports.constants = exports.adSizes = exports.EventTimer = exports.isAdBlockInUse = void 0;
|
|
27
|
+
var detect_ad_blocker_1 = require("./detect-ad-blocker");
|
|
28
|
+
Object.defineProperty(exports, "isAdBlockInUse", { enumerable: true, get: function () { return detect_ad_blocker_1.isAdBlockInUse; } });
|
|
38
29
|
var event_timer_1 = require("./event-timer");
|
|
39
30
|
Object.defineProperty(exports, "EventTimer", { enumerable: true, get: function () { return event_timer_1.EventTimer; } });
|
|
40
|
-
var send_commercial_metrics_1 = require("./send-commercial-metrics");
|
|
41
|
-
Object.defineProperty(exports, "bypassCommercialMetricsSampling", { enumerable: true, get: function () { return send_commercial_metrics_1.bypassCommercialMetricsSampling; } });
|
|
42
|
-
Object.defineProperty(exports, "initCommercialMetrics", { enumerable: true, get: function () { return send_commercial_metrics_1.initCommercialMetrics; } });
|
|
43
31
|
var ad_sizes_1 = require("./ad-sizes");
|
|
44
32
|
Object.defineProperty(exports, "adSizes", { enumerable: true, get: function () { return ad_sizes_1.adSizes; } });
|
|
45
|
-
Object.defineProperty(exports, "createAdSize", { enumerable: true, get: function () { return ad_sizes_1.createAdSize; } });
|
|
46
|
-
Object.defineProperty(exports, "getAdSize", { enumerable: true, get: function () { return ad_sizes_1.getAdSize; } });
|
|
47
|
-
Object.defineProperty(exports, "outstreamSizes", { enumerable: true, get: function () { return ad_sizes_1.outstreamSizes; } });
|
|
48
|
-
Object.defineProperty(exports, "slotSizeMappings", { enumerable: true, get: function () { return ad_sizes_1.slotSizeMappings; } });
|
|
49
|
-
Object.defineProperty(exports, "standardAdSizes", { enumerable: true, get: function () { return ad_sizes_1.standardAdSizes; } });
|
|
50
|
-
var breakpoint_1 = require("./lib/breakpoint");
|
|
51
|
-
Object.defineProperty(exports, "isBreakpoint", { enumerable: true, get: function () { return breakpoint_1.isBreakpoint; } });
|
|
52
|
-
var detect_ad_blocker_1 = require("./detect-ad-blocker");
|
|
53
|
-
Object.defineProperty(exports, "isAdBlockInUse", { enumerable: true, get: function () { return detect_ad_blocker_1.isAdBlockInUse; } });
|
|
54
|
-
var permutive_2 = require("./permutive");
|
|
55
|
-
Object.defineProperty(exports, "clearPermutiveSegments", { enumerable: true, get: function () { return permutive_2.clearPermutiveSegments; } });
|
|
56
|
-
Object.defineProperty(exports, "getPermutiveSegments", { enumerable: true, get: function () { return permutive_2.getPermutiveSegments; } });
|
|
57
|
-
Object.defineProperty(exports, "getPermutivePFPSegments", { enumerable: true, get: function () { return permutive_2.getPermutivePFPSegments; } });
|
|
58
|
-
var track_scroll_depth_1 = require("./track-scroll-depth");
|
|
59
|
-
Object.defineProperty(exports, "initTrackScrollDepth", { enumerable: true, get: function () { return track_scroll_depth_1.initTrackScrollDepth; } });
|
|
60
|
-
var track_labs_container_1 = require("./track-labs-container");
|
|
61
|
-
Object.defineProperty(exports, "initTrackLabsContainer", { enumerable: true, get: function () { return track_labs_container_1.initTrackLabsContainer; } });
|
|
62
|
-
var track_gpc_signal_1 = require("./track-gpc-signal");
|
|
63
|
-
Object.defineProperty(exports, "initTrackGpcSignal", { enumerable: true, get: function () { return track_gpc_signal_1.initTrackGpcSignal; } });
|
|
64
|
-
var youtube_1 = require("./targeting/youtube");
|
|
65
|
-
Object.defineProperty(exports, "buildAdsConfigWithConsent", { enumerable: true, get: function () { return youtube_1.buildAdsConfigWithConsent; } });
|
|
66
|
-
Object.defineProperty(exports, "disabledAds", { enumerable: true, get: function () { return youtube_1.disabledAds; } });
|
|
67
|
-
var create_ad_slot_1 = require("./create-ad-slot");
|
|
68
|
-
Object.defineProperty(exports, "createAdSlot", { enumerable: true, get: function () { return create_ad_slot_1.createAdSlot; } });
|
|
69
|
-
Object.defineProperty(exports, "concatSizeMappings", { enumerable: true, get: function () { return create_ad_slot_1.concatSizeMappings; } });
|
|
70
33
|
exports.constants = __importStar(require("./constants"));
|
|
71
|
-
var
|
|
72
|
-
Object.defineProperty(exports, "
|
|
73
|
-
|
|
74
|
-
Object.defineProperty(exports, "getPersonalisedTargeting", { enumerable: true, get: function () { return personalised_1.getPersonalisedTargeting; } });
|
|
75
|
-
var session_1 = require("./targeting/session");
|
|
76
|
-
Object.defineProperty(exports, "getSessionTargeting", { enumerable: true, get: function () { return session_1.getSessionTargeting; } });
|
|
77
|
-
var shared_1 = require("./targeting/shared");
|
|
78
|
-
Object.defineProperty(exports, "getSharedTargeting", { enumerable: true, get: function () { return shared_1.getSharedTargeting; } });
|
|
79
|
-
var viewport_1 = require("./targeting/viewport");
|
|
80
|
-
Object.defineProperty(exports, "getViewportTargeting", { enumerable: true, get: function () { return viewport_1.getViewportTargeting; } });
|
|
81
|
-
var pick_targeting_values_1 = require("./targeting/pick-targeting-values");
|
|
82
|
-
Object.defineProperty(exports, "pickTargetingValues", { enumerable: true, get: function () { return pick_targeting_values_1.pickTargetingValues; } });
|
|
83
|
-
var messenger_1 = require("./messenger");
|
|
84
|
-
Object.defineProperty(exports, "initMessenger", { enumerable: true, get: function () { return messenger_1.init; } });
|
|
85
|
-
var post_message_1 = require("./messenger/post-message");
|
|
86
|
-
Object.defineProperty(exports, "postMessage", { enumerable: true, get: function () { return post_message_1.postMessage; } });
|
|
34
|
+
var send_commercial_metrics_1 = require("./send-commercial-metrics");
|
|
35
|
+
Object.defineProperty(exports, "bypassCommercialMetricsSampling", { enumerable: true, get: function () { return send_commercial_metrics_1.bypassCommercialMetricsSampling; } });
|
|
36
|
+
Object.defineProperty(exports, "initCommercialMetrics", { enumerable: true, get: function () { return send_commercial_metrics_1.initCommercialMetrics; } });
|
|
87
37
|
var build_page_targeting_1 = require("./targeting/build-page-targeting");
|
|
88
38
|
Object.defineProperty(exports, "buildPageTargeting", { enumerable: true, get: function () { return build_page_targeting_1.buildPageTargeting; } });
|
|
89
|
-
var
|
|
90
|
-
Object.defineProperty(exports, "
|
|
91
|
-
/* -- Vendor JavaScript -- */
|
|
92
|
-
var a9_apstag_1 = require("./__vendor/a9-apstag");
|
|
93
|
-
Object.defineProperty(exports, "a9Apstag", { enumerable: true, get: function () { return a9_apstag_1.a9Apstag; } });
|
|
94
|
-
var ipsos_mori_1 = require("./__vendor/ipsos-mori");
|
|
95
|
-
Object.defineProperty(exports, "ipsosMoriStub", { enumerable: true, get: function () { return ipsos_mori_1.ipsosMoriStub; } });
|
|
96
|
-
var launchpad_1 = require("./__vendor/launchpad");
|
|
97
|
-
Object.defineProperty(exports, "launchpad", { enumerable: true, get: function () { return launchpad_1.launchpad; } });
|
|
98
|
-
var pubmatic_1 = require("./__vendor/pubmatic");
|
|
99
|
-
Object.defineProperty(exports, "pubmatic", { enumerable: true, get: function () { return pubmatic_1.pubmatic; } });
|
|
39
|
+
var post_message_1 = require("./messenger/post-message");
|
|
40
|
+
Object.defineProperty(exports, "postMessage", { enumerable: true, get: function () { return post_message_1.postMessage; } });
|
|
100
41
|
var youtube_ima_1 = require("./targeting/youtube-ima");
|
|
101
42
|
Object.defineProperty(exports, "buildImaAdTagUrl", { enumerable: true, get: function () { return youtube_ima_1.buildImaAdTagUrl; } });
|
|
43
|
+
var permutive_1 = require("./permutive");
|
|
44
|
+
Object.defineProperty(exports, "getPermutivePFPSegments", { enumerable: true, get: function () { return permutive_1.getPermutivePFPSegments; } });
|
|
45
|
+
var teads_eligibility_1 = require("./targeting/teads-eligibility");
|
|
46
|
+
Object.defineProperty(exports, "isEligibleForTeads", { enumerable: true, get: function () { return teads_eligibility_1.isEligibleForTeads; } });
|