forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.js
199 lines (181 loc) · 4.65 KB
/
constants.js
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
export const JSON_MAPPING = {
PL_CODE: 'code',
PL_SIZE: 'sizes',
PL_BIDS: 'bids',
BD_BIDDER: 'bidder',
BD_ID: 'paramsd',
BD_PL_ID: 'placementId',
ADSERVER_TARGETING: 'adserverTargeting',
BD_SETTING_STANDARD: 'standard'
};
export const DEBUG_MODE = 'pbjs_debug';
export const STATUS = {
GOOD: 1
};
export const EVENTS = {
AUCTION_INIT: 'auctionInit',
AUCTION_TIMEOUT: 'auctionTimeout',
AUCTION_END: 'auctionEnd',
BID_ADJUSTMENT: 'bidAdjustment',
BID_TIMEOUT: 'bidTimeout',
BID_REQUESTED: 'bidRequested',
BID_RESPONSE: 'bidResponse',
BID_REJECTED: 'bidRejected',
NO_BID: 'noBid',
SEAT_NON_BID: 'seatNonBid',
BID_WON: 'bidWon',
BIDDER_DONE: 'bidderDone',
BIDDER_ERROR: 'bidderError',
SET_TARGETING: 'setTargeting',
BEFORE_REQUEST_BIDS: 'beforeRequestBids',
BEFORE_BIDDER_HTTP: 'beforeBidderHttp',
REQUEST_BIDS: 'requestBids',
ADD_AD_UNITS: 'addAdUnits',
AD_RENDER_FAILED: 'adRenderFailed',
AD_RENDER_SUCCEEDED: 'adRenderSucceeded',
TCF2_ENFORCEMENT: 'tcf2Enforcement',
AUCTION_DEBUG: 'auctionDebug',
BID_VIEWABLE: 'bidViewable',
STALE_RENDER: 'staleRender',
EXPIRED_RENDER: 'expiredRender',
BILLABLE_EVENT: 'billableEvent',
BID_ACCEPTED: 'bidAccepted',
RUN_PAAPI_AUCTION: 'paapiRunAuction',
PBS_ANALYTICS: 'pbsAnalytics',
PAAPI_BID: 'paapiBid',
PAAPI_NO_BID: 'paapiNoBid',
PAAPI_ERROR: 'paapiError',
};
export const AD_RENDER_FAILED_REASON = {
PREVENT_WRITING_ON_MAIN_DOCUMENT: 'preventWritingOnMainDocument',
NO_AD: 'noAd',
EXCEPTION: 'exception',
CANNOT_FIND_AD: 'cannotFindAd',
MISSING_DOC_OR_ADID: 'missingDocOrAdid'
};
export const EVENT_ID_PATHS = {
bidWon: 'adUnitCode'
};
export const GRANULARITY_OPTIONS = {
LOW: 'low',
MEDIUM: 'medium',
HIGH: 'high',
AUTO: 'auto',
DENSE: 'dense',
CUSTOM: 'custom'
};
export const TARGETING_KEYS = {
BIDDER: 'hb_bidder',
AD_ID: 'hb_adid',
PRICE_BUCKET: 'hb_pb',
SIZE: 'hb_size',
DEAL: 'hb_deal',
SOURCE: 'hb_source',
FORMAT: 'hb_format',
UUID: 'hb_uuid',
CACHE_ID: 'hb_cache_id',
CACHE_HOST: 'hb_cache_host',
ADOMAIN: 'hb_adomain',
ACAT: 'hb_acat',
CRID: 'hb_crid',
DSP: 'hb_dsp'
};
export const DEFAULT_TARGETING_KEYS = {
BIDDER: 'hb_bidder',
AD_ID: 'hb_adid',
PRICE_BUCKET: 'hb_pb',
SIZE: 'hb_size',
DEAL: 'hb_deal',
FORMAT: 'hb_format',
UUID: 'hb_uuid',
CACHE_HOST: 'hb_cache_host'
};
export const NATIVE_KEYS = {
title: 'hb_native_title',
body: 'hb_native_body',
body2: 'hb_native_body2',
privacyLink: 'hb_native_privacy',
privacyIcon: 'hb_native_privicon',
sponsoredBy: 'hb_native_brand',
image: 'hb_native_image',
icon: 'hb_native_icon',
clickUrl: 'hb_native_linkurl',
displayUrl: 'hb_native_displayurl',
cta: 'hb_native_cta',
rating: 'hb_native_rating',
address: 'hb_native_address',
downloads: 'hb_native_downloads',
likes: 'hb_native_likes',
phone: 'hb_native_phone',
price: 'hb_native_price',
salePrice: 'hb_native_saleprice',
rendererUrl: 'hb_renderer_url',
adTemplate: 'hb_adTemplate'
};
export const S2S = {
SRC: 's2s',
DEFAULT_ENDPOINT: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction',
SYNCED_BIDDERS_KEY: 'pbjsSyncs'
};
export const BID_STATUS = {
BID_TARGETING_SET: 'targetingSet',
RENDERED: 'rendered',
BID_REJECTED: 'bidRejected'
};
export const REJECTION_REASON = {
INVALID: 'Bid has missing or invalid properties',
INVALID_REQUEST_ID: 'Invalid request ID',
BIDDER_DISALLOWED: 'Bidder code is not allowed by allowedAlternateBidderCodes / allowUnknownBidderCodes',
FLOOR_NOT_MET: 'Bid does not meet price floor',
CANNOT_CONVERT_CURRENCY: 'Unable to convert currency',
DSA_REQUIRED: 'Bid does not provide required DSA transparency info',
DSA_MISMATCH: 'Bid indicates inappropriate DSA rendering method',
PRICE_TOO_HIGH: 'Bid price exceeds maximum value'
};
export const PREBID_NATIVE_DATA_KEYS_TO_ORTB = {
body: 'desc',
body2: 'desc2',
sponsoredBy: 'sponsored',
cta: 'ctatext',
rating: 'rating',
address: 'address',
downloads: 'downloads',
likes: 'likes',
phone: 'phone',
price: 'price',
salePrice: 'saleprice',
displayUrl: 'displayurl'
};
export const NATIVE_ASSET_TYPES = {
sponsored: 1,
desc: 2,
rating: 3,
likes: 4,
downloads: 5,
price: 6,
saleprice: 7,
phone: 8,
address: 9,
desc2: 10,
displayurl: 11,
ctatext: 12
};
export const NATIVE_IMAGE_TYPES = {
ICON: 1,
MAIN: 3
};
export const NATIVE_KEYS_THAT_ARE_NOT_ASSETS = [
'privacyIcon',
'clickUrl',
'sendTargetingKeys',
'adTemplate',
'rendererUrl',
'type'
];
export const MESSAGES = {
REQUEST: 'Prebid Request',
RESPONSE: 'Prebid Response',
NATIVE: 'Prebid Native',
EVENT: 'Prebid Event'
};
export const PB_LOCATOR = '__pb_locator__';