-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHIRO_Integration_Including_MAID.js
More file actions
111 lines (100 loc) · 3.61 KB
/
Copy pathHIRO_Integration_Including_MAID.js
File metadata and controls
111 lines (100 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<script>
// Detect mobile traffic
var isMobile = /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
// start liveintent module init and measurement v1.5.6
const LI_REPORTING_KEY = "li-module-enabled";
let LI_PUBLISHER_ID; // = your LiveIntent Publisher ID
let LI_DISTRIBUTOR_ID; // = your LiveIntent Distributor ID (did-xxxx)
let LOGGED_IN_USERS_EMAIL_OR_EMAIL_HASH; // email or hash if logged in
let USERS_IPV4_ADDRESS;
let USERS_IPV6_ADDRESS;
const pbjs = (window.pbjs = window.pbjs || { que: [] });
const googletag = (window.googletag = window.googletag || { cmd: [] });
const TREATMENT_RATE = 0.95;
if (window.liModuleEnabled === undefined) {
function setTargeting(enriched) {
googletag.cmd.push(function () {
let targeting = window.liModuleEnabled ? "t1" : "t0";
if (enriched !== undefined) targeting += enriched ? "-e1" : "-e0";
googletag.pubads().setTargeting(LI_REPORTING_KEY, targeting);
});
}
setTargeting();
pbjs.que.push(function () {
if (window.liModuleEnabled) {
pbjs.mergeConfig({
userSync: {
auctionDelay: 300,
userIds: [
{
name: "liveIntentId",
bidders: [
'rubicon', 'bidswitch', 'pubmatic', 'ix', 'ttd', 'grid', 'medianet',
'sovrn', 'openx', 'vidazoo', 'sharethrough', 'triplelift', 'unruly', 'zeta_global_ssp'
],
idPriority: {
uid2: ['uid2', 'liveIntentID']
},
params: {
publisherId: LI_PUBLISHER_ID,
distributorId: LI_DISTRIBUTOR_ID,
emailHash: LOGGED_IN_USERS_EMAIL_OR_EMAIL_HASH,
ipv4: USERS_IPV4_ADDRESS,
ipv6: USERS_IPV6_ADDRESS,
requestedAttributesOverrides: Object.assign(
{
uid2: true,
bidswitch: true,
medianet: true,
magnite: true,
pubmatic: true,
index: true,
openx: true,
thetradedesk: true,
sovrn: true,
vidazoo: true,
sharethrough: true,
triplelift: true,
zetassp: true,
nexxen: true
},
isMobile ? { aaid: true, idfa: true } : {}
)
},
storage: {
type: "html5",
name: "__tamLIResolveResult",
expires: 1
}
}
]
}
});
}
pbjs.refreshUserIds({ submoduleNames: ["liveIntentId"] });
pbjs.onEvent("auctionInit", function (args) {
auctionsEnriched[args.auctionId] =
args.adUnits &&
args.adUnits.some(
(au) =>
au.bids &&
au.bids.some(
(b) =>
b.userIdAsEids &&
b.userIdAsEids.some(
(eid) =>
eid.source === "liveintent.com" ||
(eid.uids &&
eid.uids.some(
(uid) =>
uid.ext && uid.ext.provider === "liveintent.com"
))
)
)
);
setTargeting(auctionsEnriched[args.auctionId]);
});
});
}
// end liveintent module init and measurement
</script>