@surfside/surfside-events 0.0.1 → 2.0.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.
@@ -168,6 +168,63 @@ interface segmentContext {
168
168
  * @param trackers - The tracker identifiers which the context will be stored against
169
169
  */
170
170
  declare function segment(context?: segmentContext, trackers?: Array<string>): void;
171
+ /**
172
+ * Removes a Surfside Segment Context
173
+ *
174
+ * @param context - The context to be stored
175
+ * @param trackers - The tracker identifiers which the context will be stored against
176
+ */
177
+ declare function removeSegment(context?: segmentContext, trackers?: Array<string>): void;
178
+ /**
179
+ * A Surfside Local Business Location Context
180
+ */
181
+ interface localBusinessLocationContext {
182
+ /** The Location ID */
183
+ id?: string;
184
+ /** The Location Latitude */
185
+ latitude?: string;
186
+ /** The Location Longitude */
187
+ longitude?: string;
188
+ /** The Location Country Code */
189
+ country_code?: string;
190
+ /** The Location Zip */
191
+ zip?: string;
192
+ /** The Location State Label */
193
+ state_label?: string;
194
+ /** The Location State */
195
+ state?: string;
196
+ /** The Location City */
197
+ city?: string;
198
+ /** The Location Street */
199
+ street?: string;
200
+ /** The Location Name */
201
+ name?: string;
202
+ /** The Location Parent */
203
+ parent?: string;
204
+ /** The Location Type */
205
+ type?: string;
206
+ /** The Location Category */
207
+ category?: string;
208
+ }
209
+ declare global {
210
+ interface Window {
211
+ surf: any;
212
+ }
213
+ }
214
+ /**
215
+ * Adds a Surfside Local Business Location Context
216
+ *
217
+ * @param context - The context to be stored
218
+ * @param trackers - The tracker identifiers which the context will be stored against
219
+ */
220
+ declare function setLocation(context?: localBusinessLocationContext, trackers?: Array<string>): void;
221
+ /**
222
+ * Removes a Surfside Local Business Location Context
223
+ *
224
+ * @param context - The context to be stored
225
+ * @param trackers - The tracker identifiers which the context will be stored against
226
+ */
227
+ declare function removeLocation(context?: localBusinessLocationContext, trackers?: Array<string>): void;
171
228
  /**
172
229
  * A Surfside User Context
173
230
  */
@@ -192,6 +249,8 @@ interface userContext {
192
249
  userId?: string;
193
250
  /** The last name of the user */
194
251
  lastName?: string;
252
+ /** The phone number of the user */
253
+ phone?: string;
195
254
  }
196
255
  /**
197
256
  * Adds a Surfside User Context
@@ -200,6 +259,11 @@ interface userContext {
200
259
  * @param trackers - The tracker identifiers which the context will be stored against
201
260
  */
202
261
  declare function setUser(context?: userContext, trackers?: Array<string>): void;
262
+ interface SurfIdContextRequest {
263
+ email?: string;
264
+ phone?: string;
265
+ }
266
+ declare function setSurfId(context?: SurfIdContextRequest, trackers?: Array<string>): void;
203
267
  /**
204
268
  * A Surfside User Context
205
269
  */
@@ -242,4 +306,136 @@ interface identifyUserContext {
242
306
  * @param trackers - The tracker identifiers which the context will be stored against
243
307
  */
244
308
  declare function identifyUser(context?: identifyUserContext, trackers?: Array<string>): void;
245
- export { SurfsideCommercePlugin, commerceAction, setCommerceAction, commerceTransactionContext, addTransaction, commerceImpressionContext, addImpression, commerceProductContext, addProduct, commercePromoContext, addPromotion, sourceContext, source, segmentContext, segment, userContext, setUser, identifyUserContext, identifyUser };
309
+ type AuctionInitEvent = {
310
+ auctionId: string;
311
+ timestamp: number;
312
+ auctionStatus: string;
313
+ adUnits: AuctionInitEventAdUnit[];
314
+ bidderRequests: AdUnitBidderRequest[];
315
+ };
316
+ type AuctionInitEventAdUnit = {
317
+ requestId: string;
318
+ mediaTypes: object;
319
+ bids: AdUnitBid[];
320
+ timeout: number;
321
+ sizes: number[][];
322
+ transactionId: string;
323
+ };
324
+ type AdUnitBid = {
325
+ params: object;
326
+ user: object;
327
+ };
328
+ type AdUnitBidderRequest = {
329
+ bidderRequestId: string;
330
+ bids: BidderRequestBid[];
331
+ auctionStart: number;
332
+ timeout: number;
333
+ refererInfo: BidderRequestRefererInfo;
334
+ };
335
+ type BidderRequestBid = {
336
+ ortb2: {
337
+ site: {
338
+ page: string;
339
+ domain: string;
340
+ };
341
+ device: {
342
+ w: number;
343
+ h: number;
344
+ dnt: number;
345
+ ua: string;
346
+ language: string;
347
+ };
348
+ };
349
+ };
350
+ type BidderRequestRefererInfo = {
351
+ stack: string[];
352
+ location: string;
353
+ page: string;
354
+ domain: string;
355
+ };
356
+ declare function auctionInit(e: AuctionInitEvent & CommonEventProperties, trackers?: Array<string>): void;
357
+ type BidRequestedEvent = {
358
+ auctionId: string;
359
+ bidderRequestId: string;
360
+ bids: BidRequestedBid[];
361
+ auctionStart: number;
362
+ timeout: number;
363
+ refererInfo: BidderRequestRefererInfo;
364
+ start: number;
365
+ };
366
+ type BidRequestedBid = {
367
+ params: object;
368
+ user: object;
369
+ ortb2Imp: object;
370
+ mediaTypes: object;
371
+ transactionId: string;
372
+ sizes: [];
373
+ bidId: string;
374
+ ortb2: {
375
+ site: {
376
+ page: string;
377
+ domain: string;
378
+ };
379
+ device: {
380
+ w: number;
381
+ h: number;
382
+ dnt: number;
383
+ ua: string;
384
+ language: string;
385
+ };
386
+ };
387
+ };
388
+ declare function bidRequested(e: BidRequestedEvent, trackers?: Array<string>): void;
389
+ type BidResponseEvent = {
390
+ width: number;
391
+ height: number;
392
+ statusMessage: string;
393
+ adId: string;
394
+ requestId: string;
395
+ transactionId: string;
396
+ auctionId: string;
397
+ mediaType: string;
398
+ ad: string;
399
+ seatBidId: string;
400
+ cpm: number;
401
+ currency: string;
402
+ creative_id: string;
403
+ creativeId: string;
404
+ ttl: number;
405
+ netRevenue: boolean;
406
+ meta: {
407
+ advertiserDomains: string[];
408
+ };
409
+ originalRequest: {
410
+ ext: {
411
+ tid: string;
412
+ };
413
+ id: string;
414
+ banner: {
415
+ topFrame: number;
416
+ format: {
417
+ w: number;
418
+ h: number;
419
+ }[];
420
+ };
421
+ tagid: string;
422
+ };
423
+ originalCpm: number;
424
+ originalCurrency: string;
425
+ responseTimestamp: number;
426
+ requestTimestamp: number;
427
+ timeToRespond: number;
428
+ size: string;
429
+ };
430
+ declare function bidResponse(e: BidResponseEvent, trackers?: Array<string>): void;
431
+ type BidderDoneEvent = BidRequestedEvent;
432
+ declare function bidderDone(e: BidderDoneEvent, trackers?: Array<string>): void;
433
+ type BidderErrorEvent = {
434
+ error: object;
435
+ } & {
436
+ bidderRequest: BidRequestedEvent;
437
+ };
438
+ declare function bidderError(e: BidderErrorEvent, trackers?: Array<string>): void;
439
+ type NoBidEvent = BidRequestedEvent;
440
+ declare function noBid(e: NoBidEvent, trackers?: Array<string>): void;
441
+ export { SurfsideCommercePlugin, commerceAction, setCommerceAction, commerceTransactionContext, addTransaction, commerceImpressionContext, addImpression, commerceProductContext, addProduct, commercePromoContext, addPromotion, sourceContext, source, segmentContext, segment, removeSegment, localBusinessLocationContext, setLocation, removeLocation, userContext, setUser, SurfIdContextRequest, setSurfId, identifyUserContext, identifyUser, auctionInit, bidRequested, bidResponse, bidderDone, bidderError, noBid };