@xylabs/pixel 7.0.8 → 8.0.1
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/README.md +1 -1417
- package/dist/browser/index.d.ts +1 -14
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +2 -534
- package/dist/browser/index.mjs.map +3 -3
- package/dist/browser/model.d.ts +1 -8
- package/dist/browser/model.d.ts.map +1 -1
- package/dist/browser/model.mjs +2 -0
- package/dist/browser/model.mjs.map +3 -3
- package/package.json +10 -7
- package/dist/browser/Api/Api.d.ts +0 -13
- package/dist/browser/Api/Api.d.ts.map +0 -1
- package/dist/browser/Api/UserEvent.d.ts +0 -26
- package/dist/browser/Api/UserEvent.d.ts.map +0 -1
- package/dist/browser/Api/UserEventSystem.d.ts +0 -26
- package/dist/browser/Api/UserEventSystem.d.ts.map +0 -1
- package/dist/browser/Api/index.d.ts +0 -4
- package/dist/browser/Api/index.d.ts.map +0 -1
- package/dist/browser/CommonFields.d.ts +0 -6
- package/dist/browser/CommonFields.d.ts.map +0 -1
- package/dist/browser/ExIds.d.ts +0 -11
- package/dist/browser/ExIds.d.ts.map +0 -1
- package/dist/browser/FunnelStartedFields.d.ts +0 -6
- package/dist/browser/FunnelStartedFields.d.ts.map +0 -1
- package/dist/browser/Pixel.d.ts +0 -47
- package/dist/browser/Pixel.d.ts.map +0 -1
- package/dist/browser/PurchaseFields.d.ts +0 -9
- package/dist/browser/PurchaseFields.d.ts.map +0 -1
- package/dist/browser/Referrer.d.ts +0 -18
- package/dist/browser/Referrer.d.ts.map +0 -1
- package/dist/browser/TestStartedFields.d.ts +0 -6
- package/dist/browser/TestStartedFields.d.ts.map +0 -1
- package/dist/browser/UniqueUserId.d.ts +0 -10
- package/dist/browser/UniqueUserId.d.ts.map +0 -1
- package/dist/browser/UserClickFields.d.ts +0 -9
- package/dist/browser/UserClickFields.d.ts.map +0 -1
- package/dist/browser/UserEventHandler.d.ts +0 -18
- package/dist/browser/UserEventHandler.d.ts.map +0 -1
- package/dist/browser/UtmFields.d.ts +0 -19
- package/dist/browser/UtmFields.d.ts.map +0 -1
- package/dist/browser/ViewContentFields.d.ts +0 -7
- package/dist/browser/ViewContentFields.d.ts.map +0 -1
- package/dist/browser/XyLabsTrackingEventJson.d.ts +0 -22
- package/dist/browser/XyLabsTrackingEventJson.d.ts.map +0 -1
- package/dist/browser/XyUserEventHandler.d.ts +0 -22
- package/dist/browser/XyUserEventHandler.d.ts.map +0 -1
- package/dist/browser/getSystemInfo.d.ts +0 -8
- package/dist/browser/getSystemInfo.d.ts.map +0 -1
- package/dist/browser/md5Raw.d.ts +0 -3
- package/dist/browser/md5Raw.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,1419 +1,3 @@
|
|
|
1
|
-
[![logo][]](https://xylabs.com)
|
|
2
|
-
|
|
3
1
|
# @xylabs/pixel
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
[![license][license-badge]][license-link]
|
|
7
|
-
|
|
8
|
-
> Event Client for xylabs ESB
|
|
9
|
-
|
|
10
|
-
## Install
|
|
11
|
-
|
|
12
|
-
Using npm:
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
npm install {{name}}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Using yarn:
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
yarn add {{name}}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Using pnpm:
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
pnpm add {{name}}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Using bun:
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
bun add {{name}}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## License
|
|
38
|
-
|
|
39
|
-
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
|
-
|
|
41
|
-
## Reference
|
|
42
|
-
|
|
43
|
-
### packages
|
|
44
|
-
|
|
45
|
-
### pixel
|
|
46
|
-
|
|
47
|
-
### .temp-typedoc
|
|
48
|
-
|
|
49
|
-
### classes
|
|
50
|
-
|
|
51
|
-
### <a id="PixelApi"></a>PixelApi
|
|
52
|
-
|
|
53
|
-
[**@xylabs/pixel**](#../README)
|
|
54
|
-
|
|
55
|
-
***
|
|
56
|
-
|
|
57
|
-
HTTP client for sending tracking events to the XY Labs pixel API.
|
|
58
|
-
|
|
59
|
-
## Constructors
|
|
60
|
-
|
|
61
|
-
### Constructor
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
new PixelApi(baseUri?): PixelApi;
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Parameters
|
|
68
|
-
|
|
69
|
-
#### baseUri?
|
|
70
|
-
|
|
71
|
-
`string` = `'prod'`
|
|
72
|
-
|
|
73
|
-
### Returns
|
|
74
|
-
|
|
75
|
-
`PixelApi`
|
|
76
|
-
|
|
77
|
-
## Methods
|
|
78
|
-
|
|
79
|
-
### trackEvents()
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
trackEvents(events): Promise<any>;
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Sends an array of user events to the tracking API.
|
|
86
|
-
|
|
87
|
-
### Parameters
|
|
88
|
-
|
|
89
|
-
#### events
|
|
90
|
-
|
|
91
|
-
[`UserEvent`][#../interfaces/UserEvent]()
|
|
92
|
-
|
|
93
|
-
The events to submit
|
|
94
|
-
|
|
95
|
-
### Returns
|
|
96
|
-
|
|
97
|
-
`Promise`\<`any`\>
|
|
98
|
-
|
|
99
|
-
The response data from the API
|
|
100
|
-
|
|
101
|
-
### <a id="Referrer"></a>Referrer
|
|
102
|
-
|
|
103
|
-
[**@xylabs/pixel**](#../README)
|
|
104
|
-
|
|
105
|
-
***
|
|
106
|
-
|
|
107
|
-
Tracks and persists the document referrer in both session and local storage.
|
|
108
|
-
|
|
109
|
-
## Constructors
|
|
110
|
-
|
|
111
|
-
### Constructor
|
|
112
|
-
|
|
113
|
-
```ts
|
|
114
|
-
new Referrer(): Referrer;
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Returns
|
|
118
|
-
|
|
119
|
-
`Referrer`
|
|
120
|
-
|
|
121
|
-
## Properties
|
|
122
|
-
|
|
123
|
-
### local
|
|
124
|
-
|
|
125
|
-
```ts
|
|
126
|
-
local: string;
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
***
|
|
130
|
-
|
|
131
|
-
### session
|
|
132
|
-
|
|
133
|
-
```ts
|
|
134
|
-
session: string;
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Methods
|
|
138
|
-
|
|
139
|
-
### toJson()
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
toJson():
|
|
143
|
-
| {
|
|
144
|
-
local: string;
|
|
145
|
-
session: string;
|
|
146
|
-
}
|
|
147
|
-
| undefined;
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Returns the referrer data as a JSON object, or undefined if both values are empty.
|
|
151
|
-
|
|
152
|
-
### Returns
|
|
153
|
-
|
|
154
|
-
\| \{
|
|
155
|
-
`local`: `string`;
|
|
156
|
-
`session`: `string`;
|
|
157
|
-
\}
|
|
158
|
-
\| `undefined`
|
|
159
|
-
|
|
160
|
-
An object with local and session referrer strings, or undefined
|
|
161
|
-
|
|
162
|
-
### <a id="UniqueUserId"></a>UniqueUserId
|
|
163
|
-
|
|
164
|
-
[**@xylabs/pixel**](#../README)
|
|
165
|
-
|
|
166
|
-
***
|
|
167
|
-
|
|
168
|
-
Generates and persists a unique user identifier in localStorage.
|
|
169
|
-
|
|
170
|
-
## Constructors
|
|
171
|
-
|
|
172
|
-
### Constructor
|
|
173
|
-
|
|
174
|
-
```ts
|
|
175
|
-
new UniqueUserId(): UniqueUserId;
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Returns
|
|
179
|
-
|
|
180
|
-
`UniqueUserId`
|
|
181
|
-
|
|
182
|
-
## Properties
|
|
183
|
-
|
|
184
|
-
### id
|
|
185
|
-
|
|
186
|
-
```ts
|
|
187
|
-
id: string;
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## Methods
|
|
191
|
-
|
|
192
|
-
### toString()
|
|
193
|
-
|
|
194
|
-
```ts
|
|
195
|
-
toString(): string;
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
Returns the unique user ID as a string.
|
|
199
|
-
|
|
200
|
-
### Returns
|
|
201
|
-
|
|
202
|
-
`string`
|
|
203
|
-
|
|
204
|
-
### <a id="UserEventHandler"></a>UserEventHandler
|
|
205
|
-
|
|
206
|
-
[**@xylabs/pixel**](#../README)
|
|
207
|
-
|
|
208
|
-
***
|
|
209
|
-
|
|
210
|
-
Abstract base class for handling user tracking events.
|
|
211
|
-
|
|
212
|
-
## Extended by
|
|
213
|
-
|
|
214
|
-
- [`XyUserEventHandler`](#XyUserEventHandler)
|
|
215
|
-
|
|
216
|
-
## Type Parameters
|
|
217
|
-
|
|
218
|
-
### TData
|
|
219
|
-
|
|
220
|
-
`TData` *extends* `EmptyObject`
|
|
221
|
-
|
|
222
|
-
## Constructors
|
|
223
|
-
|
|
224
|
-
### Constructor
|
|
225
|
-
|
|
226
|
-
```ts
|
|
227
|
-
new UserEventHandler<TData>(): UserEventHandler<TData>;
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Returns
|
|
231
|
-
|
|
232
|
-
`UserEventHandler`\<`TData`\>
|
|
233
|
-
|
|
234
|
-
## Methods
|
|
235
|
-
|
|
236
|
-
### funnelStarted()
|
|
237
|
-
|
|
238
|
-
```ts
|
|
239
|
-
abstract funnelStarted<T>(fields): Promisable<void>;
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
Tracks a funnel-started event.
|
|
243
|
-
|
|
244
|
-
### Type Parameters
|
|
245
|
-
|
|
246
|
-
#### T
|
|
247
|
-
|
|
248
|
-
`T` *extends* `object`
|
|
249
|
-
|
|
250
|
-
### Parameters
|
|
251
|
-
|
|
252
|
-
#### fields
|
|
253
|
-
|
|
254
|
-
[`FunnelStartedFields`](#../interfaces/FunnelStartedFields) \| `T`
|
|
255
|
-
|
|
256
|
-
### Returns
|
|
257
|
-
|
|
258
|
-
`Promisable`\<`void`\>
|
|
259
|
-
|
|
260
|
-
***
|
|
261
|
-
|
|
262
|
-
### testStarted()
|
|
263
|
-
|
|
264
|
-
```ts
|
|
265
|
-
abstract testStarted<T>(fields): Promisable<void>;
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
Tracks a test-started event.
|
|
269
|
-
|
|
270
|
-
### Type Parameters
|
|
271
|
-
|
|
272
|
-
#### T
|
|
273
|
-
|
|
274
|
-
`T` *extends* `object`
|
|
275
|
-
|
|
276
|
-
### Parameters
|
|
277
|
-
|
|
278
|
-
#### fields
|
|
279
|
-
|
|
280
|
-
[`TestStartedFields`](#../interfaces/TestStartedFields) \| `T`
|
|
281
|
-
|
|
282
|
-
### Returns
|
|
283
|
-
|
|
284
|
-
`Promisable`\<`void`\>
|
|
285
|
-
|
|
286
|
-
***
|
|
287
|
-
|
|
288
|
-
### userClick()
|
|
289
|
-
|
|
290
|
-
```ts
|
|
291
|
-
abstract userClick<T>(fields): Promisable<void>;
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
Tracks a user click event.
|
|
295
|
-
|
|
296
|
-
### Type Parameters
|
|
297
|
-
|
|
298
|
-
#### T
|
|
299
|
-
|
|
300
|
-
`T` *extends* `object`
|
|
301
|
-
|
|
302
|
-
### Parameters
|
|
303
|
-
|
|
304
|
-
#### fields
|
|
305
|
-
|
|
306
|
-
[`UserClickFields`](#../interfaces/UserClickFields) \| `T`
|
|
307
|
-
|
|
308
|
-
### Returns
|
|
309
|
-
|
|
310
|
-
`Promisable`\<`void`\>
|
|
311
|
-
|
|
312
|
-
***
|
|
313
|
-
|
|
314
|
-
### viewContent()
|
|
315
|
-
|
|
316
|
-
```ts
|
|
317
|
-
abstract viewContent<T>(fields): Promisable<void>;
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
Tracks a view-content event.
|
|
321
|
-
|
|
322
|
-
### Type Parameters
|
|
323
|
-
|
|
324
|
-
#### T
|
|
325
|
-
|
|
326
|
-
`T` *extends* `object`
|
|
327
|
-
|
|
328
|
-
### Parameters
|
|
329
|
-
|
|
330
|
-
#### fields
|
|
331
|
-
|
|
332
|
-
`T` \| [`ViewContentFields`](#../interfaces/ViewContentFields)
|
|
333
|
-
|
|
334
|
-
### Returns
|
|
335
|
-
|
|
336
|
-
`Promisable`\<`void`\>
|
|
337
|
-
|
|
338
|
-
### <a id="UtmFields"></a>UtmFields
|
|
339
|
-
|
|
340
|
-
[**@xylabs/pixel**](#../README)
|
|
341
|
-
|
|
342
|
-
***
|
|
343
|
-
|
|
344
|
-
Tracks UTM campaign parameters from query strings, persisting history in localStorage.
|
|
345
|
-
|
|
346
|
-
## Constructors
|
|
347
|
-
|
|
348
|
-
### Constructor
|
|
349
|
-
|
|
350
|
-
```ts
|
|
351
|
-
new UtmFields(): UtmFields;
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
### Returns
|
|
355
|
-
|
|
356
|
-
`UtmFields`
|
|
357
|
-
|
|
358
|
-
## Properties
|
|
359
|
-
|
|
360
|
-
### fields
|
|
361
|
-
|
|
362
|
-
```ts
|
|
363
|
-
fields: Record<string, string>[] = [];
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
## Methods
|
|
367
|
-
|
|
368
|
-
### getUtmRecord()
|
|
369
|
-
|
|
370
|
-
```ts
|
|
371
|
-
getUtmRecord(): Record<string, string> | null;
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
Parses UTM parameters from the current URL query string.
|
|
375
|
-
|
|
376
|
-
### Returns
|
|
377
|
-
|
|
378
|
-
`Record`\<`string`, `string`\> \| `null`
|
|
379
|
-
|
|
380
|
-
A record of UTM key-value pairs, or null if none are present
|
|
381
|
-
|
|
382
|
-
***
|
|
383
|
-
|
|
384
|
-
### toString()
|
|
385
|
-
|
|
386
|
-
```ts
|
|
387
|
-
toString(): string;
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
Returns the UTM fields history as a JSON string.
|
|
391
|
-
|
|
392
|
-
### Returns
|
|
393
|
-
|
|
394
|
-
`string`
|
|
395
|
-
|
|
396
|
-
***
|
|
397
|
-
|
|
398
|
-
### update()
|
|
399
|
-
|
|
400
|
-
```ts
|
|
401
|
-
update(): Record<string, string>[];
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
Checks the query string for new UTM values and appends them to the history if changed.
|
|
405
|
-
|
|
406
|
-
### Returns
|
|
407
|
-
|
|
408
|
-
`Record`\<`string`, `string`\>[]
|
|
409
|
-
|
|
410
|
-
The current UTM fields array, or undefined if empty
|
|
411
|
-
|
|
412
|
-
### <a id="XyPixel"></a>XyPixel
|
|
413
|
-
|
|
414
|
-
[**@xylabs/pixel**](#../README)
|
|
415
|
-
|
|
416
|
-
***
|
|
417
|
-
|
|
418
|
-
Singleton pixel tracker that queues and sends user events to the XY Labs tracking API.
|
|
419
|
-
|
|
420
|
-
## Properties
|
|
421
|
-
|
|
422
|
-
### api
|
|
423
|
-
|
|
424
|
-
```ts
|
|
425
|
-
static api: PixelApi;
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
***
|
|
429
|
-
|
|
430
|
-
### cid
|
|
431
|
-
|
|
432
|
-
```ts
|
|
433
|
-
cid: string;
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
***
|
|
437
|
-
|
|
438
|
-
### email?
|
|
439
|
-
|
|
440
|
-
```ts
|
|
441
|
-
optional email?: string;
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
***
|
|
445
|
-
|
|
446
|
-
### email\_hash?
|
|
447
|
-
|
|
448
|
-
```ts
|
|
449
|
-
optional email_hash?: string | null;
|
|
450
|
-
```
|
|
451
|
-
|
|
452
|
-
***
|
|
453
|
-
|
|
454
|
-
### exids?
|
|
455
|
-
|
|
456
|
-
```ts
|
|
457
|
-
optional exids?: ExIds;
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
***
|
|
461
|
-
|
|
462
|
-
### pixelId?
|
|
463
|
-
|
|
464
|
-
```ts
|
|
465
|
-
optional pixelId?: string;
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
***
|
|
469
|
-
|
|
470
|
-
### queue
|
|
471
|
-
|
|
472
|
-
```ts
|
|
473
|
-
queue: UserEvent[] = [];
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
## Accessors
|
|
477
|
-
|
|
478
|
-
### instance
|
|
479
|
-
|
|
480
|
-
### Get Signature
|
|
481
|
-
|
|
482
|
-
```ts
|
|
483
|
-
get static instance(): XyPixel;
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
Returns the singleton XyPixel instance, throwing if not yet initialized.
|
|
487
|
-
|
|
488
|
-
#### Returns
|
|
489
|
-
|
|
490
|
-
`XyPixel`
|
|
491
|
-
|
|
492
|
-
## Methods
|
|
493
|
-
|
|
494
|
-
### init()
|
|
495
|
-
|
|
496
|
-
```ts
|
|
497
|
-
static init(pixelId): XyPixel;
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
Initializes the XyPixel singleton with the given pixel ID.
|
|
501
|
-
|
|
502
|
-
### Parameters
|
|
503
|
-
|
|
504
|
-
#### pixelId
|
|
505
|
-
|
|
506
|
-
`string`
|
|
507
|
-
|
|
508
|
-
The pixel identifier for this tracking instance
|
|
509
|
-
|
|
510
|
-
### Returns
|
|
511
|
-
|
|
512
|
-
`XyPixel`
|
|
513
|
-
|
|
514
|
-
The newly created XyPixel instance
|
|
515
|
-
|
|
516
|
-
***
|
|
517
|
-
|
|
518
|
-
### selectApi()
|
|
519
|
-
|
|
520
|
-
```ts
|
|
521
|
-
static selectApi(api): void;
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
Replaces the default PixelApi instance used for sending events.
|
|
525
|
-
|
|
526
|
-
### Parameters
|
|
527
|
-
|
|
528
|
-
#### api
|
|
529
|
-
|
|
530
|
-
[`PixelApi`](#PixelApi)
|
|
531
|
-
|
|
532
|
-
The PixelApi instance to use
|
|
533
|
-
|
|
534
|
-
### Returns
|
|
535
|
-
|
|
536
|
-
`void`
|
|
537
|
-
|
|
538
|
-
***
|
|
539
|
-
|
|
540
|
-
### identify()
|
|
541
|
-
|
|
542
|
-
```ts
|
|
543
|
-
identify(email?): void;
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
Associates an email address with this pixel instance, hashing it for privacy.
|
|
547
|
-
|
|
548
|
-
### Parameters
|
|
549
|
-
|
|
550
|
-
#### email?
|
|
551
|
-
|
|
552
|
-
`string`
|
|
553
|
-
|
|
554
|
-
The email address to identify the user with
|
|
555
|
-
|
|
556
|
-
### Returns
|
|
557
|
-
|
|
558
|
-
`void`
|
|
559
|
-
|
|
560
|
-
***
|
|
561
|
-
|
|
562
|
-
### send()
|
|
563
|
-
|
|
564
|
-
```ts
|
|
565
|
-
send<T>(
|
|
566
|
-
event,
|
|
567
|
-
fields?,
|
|
568
|
-
eventId?): Promise<void>;
|
|
569
|
-
```
|
|
570
|
-
|
|
571
|
-
Queues a tracking event and attempts to flush the queue to the API.
|
|
572
|
-
|
|
573
|
-
### Type Parameters
|
|
574
|
-
|
|
575
|
-
#### T
|
|
576
|
-
|
|
577
|
-
`T` *extends* `Record`\<`string`, `unknown`\>
|
|
578
|
-
|
|
579
|
-
### Parameters
|
|
580
|
-
|
|
581
|
-
#### event
|
|
582
|
-
|
|
583
|
-
`string`
|
|
584
|
-
|
|
585
|
-
The event name
|
|
586
|
-
|
|
587
|
-
#### fields?
|
|
588
|
-
|
|
589
|
-
`T`
|
|
590
|
-
|
|
591
|
-
Optional event-specific fields
|
|
592
|
-
|
|
593
|
-
#### eventId?
|
|
594
|
-
|
|
595
|
-
`string`
|
|
596
|
-
|
|
597
|
-
Optional unique event identifier
|
|
598
|
-
|
|
599
|
-
### Returns
|
|
600
|
-
|
|
601
|
-
`Promise`\<`void`\>
|
|
602
|
-
|
|
603
|
-
### <a id="XyUserEventHandler"></a>XyUserEventHandler
|
|
604
|
-
|
|
605
|
-
[**@xylabs/pixel**](#../README)
|
|
606
|
-
|
|
607
|
-
***
|
|
608
|
-
|
|
609
|
-
Concrete event handler that sends tracking events through the XyPixel singleton.
|
|
610
|
-
|
|
611
|
-
## Extends
|
|
612
|
-
|
|
613
|
-
- [`UserEventHandler`](#UserEventHandler)\<`T`\>
|
|
614
|
-
|
|
615
|
-
## Type Parameters
|
|
616
|
-
|
|
617
|
-
### T
|
|
618
|
-
|
|
619
|
-
`T` *extends* `EmptyObject` = `EmptyObject`
|
|
620
|
-
|
|
621
|
-
## Constructors
|
|
622
|
-
|
|
623
|
-
### Constructor
|
|
624
|
-
|
|
625
|
-
```ts
|
|
626
|
-
new XyUserEventHandler<T>(): XyUserEventHandler<T>;
|
|
627
|
-
```
|
|
628
|
-
|
|
629
|
-
### Returns
|
|
630
|
-
|
|
631
|
-
`XyUserEventHandler`\<`T`\>
|
|
632
|
-
|
|
633
|
-
### Overrides
|
|
634
|
-
|
|
635
|
-
[`UserEventHandler`](#UserEventHandler).[`constructor`](UserEventHandler.md#constructor)
|
|
636
|
-
|
|
637
|
-
## Methods
|
|
638
|
-
|
|
639
|
-
### funnelStarted()
|
|
640
|
-
|
|
641
|
-
```ts
|
|
642
|
-
funnelStarted(fields): Promise<void>;
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
Sends a funnel-started event via the pixel API.
|
|
646
|
-
|
|
647
|
-
### Parameters
|
|
648
|
-
|
|
649
|
-
#### fields
|
|
650
|
-
|
|
651
|
-
[`FunnelStartedFields`](#../interfaces/FunnelStartedFields) \| `T`
|
|
652
|
-
|
|
653
|
-
### Returns
|
|
654
|
-
|
|
655
|
-
`Promise`\<`void`\>
|
|
656
|
-
|
|
657
|
-
### Overrides
|
|
658
|
-
|
|
659
|
-
[`UserEventHandler`](#UserEventHandler).[`funnelStarted`](UserEventHandler.md#funnelstarted)
|
|
660
|
-
|
|
661
|
-
***
|
|
662
|
-
|
|
663
|
-
### purchase()
|
|
664
|
-
|
|
665
|
-
```ts
|
|
666
|
-
purchase(fields): Promise<void>;
|
|
667
|
-
```
|
|
668
|
-
|
|
669
|
-
Sends a purchase event via the pixel API.
|
|
670
|
-
|
|
671
|
-
### Parameters
|
|
672
|
-
|
|
673
|
-
#### fields
|
|
674
|
-
|
|
675
|
-
[`PurchaseFields`](#../interfaces/PurchaseFields) \| `T`
|
|
676
|
-
|
|
677
|
-
### Returns
|
|
678
|
-
|
|
679
|
-
`Promise`\<`void`\>
|
|
680
|
-
|
|
681
|
-
***
|
|
682
|
-
|
|
683
|
-
### testStarted()
|
|
684
|
-
|
|
685
|
-
```ts
|
|
686
|
-
testStarted(fields): Promise<void>;
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
Sends a test-started event via the pixel API.
|
|
690
|
-
|
|
691
|
-
### Parameters
|
|
692
|
-
|
|
693
|
-
#### fields
|
|
694
|
-
|
|
695
|
-
[`TestStartedFields`](#../interfaces/TestStartedFields) \| `T`
|
|
696
|
-
|
|
697
|
-
### Returns
|
|
698
|
-
|
|
699
|
-
`Promise`\<`void`\>
|
|
700
|
-
|
|
701
|
-
### Overrides
|
|
702
|
-
|
|
703
|
-
[`UserEventHandler`](#UserEventHandler).[`testStarted`](UserEventHandler.md#teststarted)
|
|
704
|
-
|
|
705
|
-
***
|
|
706
|
-
|
|
707
|
-
### userClick()
|
|
708
|
-
|
|
709
|
-
```ts
|
|
710
|
-
userClick(fields): Promise<void>;
|
|
711
|
-
```
|
|
712
|
-
|
|
713
|
-
Sends a user click event via the pixel API.
|
|
714
|
-
|
|
715
|
-
### Parameters
|
|
716
|
-
|
|
717
|
-
#### fields
|
|
718
|
-
|
|
719
|
-
[`UserClickFields`](#../interfaces/UserClickFields) \| `T`
|
|
720
|
-
|
|
721
|
-
### Returns
|
|
722
|
-
|
|
723
|
-
`Promise`\<`void`\>
|
|
724
|
-
|
|
725
|
-
### Overrides
|
|
726
|
-
|
|
727
|
-
[`UserEventHandler`](#UserEventHandler).[`userClick`](UserEventHandler.md#userclick)
|
|
728
|
-
|
|
729
|
-
***
|
|
730
|
-
|
|
731
|
-
### viewContent()
|
|
732
|
-
|
|
733
|
-
```ts
|
|
734
|
-
viewContent(fields): Promise<void>;
|
|
735
|
-
```
|
|
736
|
-
|
|
737
|
-
Sends a view-content event via the pixel API.
|
|
738
|
-
|
|
739
|
-
### Parameters
|
|
740
|
-
|
|
741
|
-
#### fields
|
|
742
|
-
|
|
743
|
-
[`ViewContentFields`](#../interfaces/ViewContentFields) \| `T`
|
|
744
|
-
|
|
745
|
-
### Returns
|
|
746
|
-
|
|
747
|
-
`Promise`\<`void`\>
|
|
748
|
-
|
|
749
|
-
### Overrides
|
|
750
|
-
|
|
751
|
-
[`UserEventHandler`](#UserEventHandler).[`viewContent`](UserEventHandler.md#viewcontent)
|
|
752
|
-
|
|
753
|
-
### interfaces
|
|
754
|
-
|
|
755
|
-
### <a id="CommonFields"></a>CommonFields
|
|
756
|
-
|
|
757
|
-
[**@xylabs/pixel**](#../README)
|
|
758
|
-
|
|
759
|
-
***
|
|
760
|
-
|
|
761
|
-
Common fields shared across all tracking event types.
|
|
762
|
-
|
|
763
|
-
## Extended by
|
|
764
|
-
|
|
765
|
-
- [`FunnelStartedFields`](#FunnelStartedFields)
|
|
766
|
-
- [`PurchaseFields`](#PurchaseFields)
|
|
767
|
-
- [`TestStartedFields`](#TestStartedFields)
|
|
768
|
-
- [`UserClickFields`](#UserClickFields)
|
|
769
|
-
- [`ViewContentFields`](#ViewContentFields)
|
|
770
|
-
|
|
771
|
-
## Properties
|
|
772
|
-
|
|
773
|
-
### funnel?
|
|
774
|
-
|
|
775
|
-
```ts
|
|
776
|
-
optional funnel?: string;
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
***
|
|
780
|
-
|
|
781
|
-
### testData?
|
|
782
|
-
|
|
783
|
-
```ts
|
|
784
|
-
optional testData?: string;
|
|
785
|
-
```
|
|
786
|
-
|
|
787
|
-
### <a id="FunnelStartedFields"></a>FunnelStartedFields
|
|
788
|
-
|
|
789
|
-
[**@xylabs/pixel**](#../README)
|
|
790
|
-
|
|
791
|
-
***
|
|
792
|
-
|
|
793
|
-
Fields for a funnel-started tracking event.
|
|
794
|
-
|
|
795
|
-
## Extends
|
|
796
|
-
|
|
797
|
-
- [`CommonFields`](#CommonFields)
|
|
798
|
-
|
|
799
|
-
## Properties
|
|
800
|
-
|
|
801
|
-
### funnel?
|
|
802
|
-
|
|
803
|
-
```ts
|
|
804
|
-
optional funnel?: string;
|
|
805
|
-
```
|
|
806
|
-
|
|
807
|
-
### Inherited from
|
|
808
|
-
|
|
809
|
-
[`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
|
|
810
|
-
|
|
811
|
-
***
|
|
812
|
-
|
|
813
|
-
### testData?
|
|
814
|
-
|
|
815
|
-
```ts
|
|
816
|
-
optional testData?: string;
|
|
817
|
-
```
|
|
818
|
-
|
|
819
|
-
### Inherited from
|
|
820
|
-
|
|
821
|
-
[`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
|
|
822
|
-
|
|
823
|
-
***
|
|
824
|
-
|
|
825
|
-
### name
|
|
826
|
-
|
|
827
|
-
```ts
|
|
828
|
-
name: string;
|
|
829
|
-
```
|
|
830
|
-
|
|
831
|
-
### <a id="PurchaseFields"></a>PurchaseFields
|
|
832
|
-
|
|
833
|
-
[**@xylabs/pixel**](#../README)
|
|
834
|
-
|
|
835
|
-
***
|
|
836
|
-
|
|
837
|
-
Fields for a purchase tracking event.
|
|
838
|
-
|
|
839
|
-
## Extends
|
|
840
|
-
|
|
841
|
-
- [`CommonFields`](#CommonFields)
|
|
842
|
-
|
|
843
|
-
## Properties
|
|
844
|
-
|
|
845
|
-
### funnel?
|
|
846
|
-
|
|
847
|
-
```ts
|
|
848
|
-
optional funnel?: string;
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
### Inherited from
|
|
852
|
-
|
|
853
|
-
[`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
|
|
854
|
-
|
|
855
|
-
***
|
|
856
|
-
|
|
857
|
-
### testData?
|
|
858
|
-
|
|
859
|
-
```ts
|
|
860
|
-
optional testData?: string;
|
|
861
|
-
```
|
|
862
|
-
|
|
863
|
-
### Inherited from
|
|
864
|
-
|
|
865
|
-
[`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
|
|
866
|
-
|
|
867
|
-
***
|
|
868
|
-
|
|
869
|
-
### id
|
|
870
|
-
|
|
871
|
-
```ts
|
|
872
|
-
id: string;
|
|
873
|
-
```
|
|
874
|
-
|
|
875
|
-
***
|
|
876
|
-
|
|
877
|
-
### name?
|
|
878
|
-
|
|
879
|
-
```ts
|
|
880
|
-
optional name?: string;
|
|
881
|
-
```
|
|
882
|
-
|
|
883
|
-
***
|
|
884
|
-
|
|
885
|
-
### price?
|
|
886
|
-
|
|
887
|
-
```ts
|
|
888
|
-
optional price?: number;
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
***
|
|
892
|
-
|
|
893
|
-
### value?
|
|
894
|
-
|
|
895
|
-
```ts
|
|
896
|
-
optional value?: number;
|
|
897
|
-
```
|
|
898
|
-
|
|
899
|
-
### <a id="TestStartedFields"></a>TestStartedFields
|
|
900
|
-
|
|
901
|
-
[**@xylabs/pixel**](#../README)
|
|
902
|
-
|
|
903
|
-
***
|
|
904
|
-
|
|
905
|
-
Fields for a test-started tracking event (e.g. A/B test).
|
|
906
|
-
|
|
907
|
-
## Extends
|
|
908
|
-
|
|
909
|
-
- [`CommonFields`](#CommonFields)
|
|
910
|
-
|
|
911
|
-
## Properties
|
|
912
|
-
|
|
913
|
-
### funnel?
|
|
914
|
-
|
|
915
|
-
```ts
|
|
916
|
-
optional funnel?: string;
|
|
917
|
-
```
|
|
918
|
-
|
|
919
|
-
### Inherited from
|
|
920
|
-
|
|
921
|
-
[`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
|
|
922
|
-
|
|
923
|
-
***
|
|
924
|
-
|
|
925
|
-
### testData?
|
|
926
|
-
|
|
927
|
-
```ts
|
|
928
|
-
optional testData?: string;
|
|
929
|
-
```
|
|
930
|
-
|
|
931
|
-
### Inherited from
|
|
932
|
-
|
|
933
|
-
[`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
|
|
934
|
-
|
|
935
|
-
***
|
|
936
|
-
|
|
937
|
-
### name
|
|
938
|
-
|
|
939
|
-
```ts
|
|
940
|
-
name: string;
|
|
941
|
-
```
|
|
942
|
-
|
|
943
|
-
### <a id="UserClickFields"></a>UserClickFields
|
|
944
|
-
|
|
945
|
-
[**@xylabs/pixel**](#../README)
|
|
946
|
-
|
|
947
|
-
***
|
|
948
|
-
|
|
949
|
-
Fields for a user click tracking event.
|
|
950
|
-
|
|
951
|
-
## Extends
|
|
952
|
-
|
|
953
|
-
- [`CommonFields`](#CommonFields)
|
|
954
|
-
|
|
955
|
-
## Properties
|
|
956
|
-
|
|
957
|
-
### funnel?
|
|
958
|
-
|
|
959
|
-
```ts
|
|
960
|
-
optional funnel?: string;
|
|
961
|
-
```
|
|
962
|
-
|
|
963
|
-
### Inherited from
|
|
964
|
-
|
|
965
|
-
[`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
|
|
966
|
-
|
|
967
|
-
***
|
|
968
|
-
|
|
969
|
-
### testData?
|
|
970
|
-
|
|
971
|
-
```ts
|
|
972
|
-
optional testData?: string;
|
|
973
|
-
```
|
|
974
|
-
|
|
975
|
-
### Inherited from
|
|
976
|
-
|
|
977
|
-
[`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
|
|
978
|
-
|
|
979
|
-
***
|
|
980
|
-
|
|
981
|
-
### elementName
|
|
982
|
-
|
|
983
|
-
```ts
|
|
984
|
-
elementName: string;
|
|
985
|
-
```
|
|
986
|
-
|
|
987
|
-
***
|
|
988
|
-
|
|
989
|
-
### elementType
|
|
990
|
-
|
|
991
|
-
```ts
|
|
992
|
-
elementType: string;
|
|
993
|
-
```
|
|
994
|
-
|
|
995
|
-
***
|
|
996
|
-
|
|
997
|
-
### intent?
|
|
998
|
-
|
|
999
|
-
```ts
|
|
1000
|
-
optional intent?: string;
|
|
1001
|
-
```
|
|
1002
|
-
|
|
1003
|
-
***
|
|
1004
|
-
|
|
1005
|
-
### placement?
|
|
1006
|
-
|
|
1007
|
-
```ts
|
|
1008
|
-
optional placement?: string;
|
|
1009
|
-
```
|
|
1010
|
-
|
|
1011
|
-
### <a id="UserEvent"></a>UserEvent
|
|
1012
|
-
|
|
1013
|
-
[**@xylabs/pixel**](#../README)
|
|
1014
|
-
|
|
1015
|
-
***
|
|
1016
|
-
|
|
1017
|
-
Represents a single user tracking event to be sent to the pixel API.
|
|
1018
|
-
|
|
1019
|
-
## Properties
|
|
1020
|
-
|
|
1021
|
-
### cid
|
|
1022
|
-
|
|
1023
|
-
```ts
|
|
1024
|
-
cid: string;
|
|
1025
|
-
```
|
|
1026
|
-
|
|
1027
|
-
***
|
|
1028
|
-
|
|
1029
|
-
### create\_time?
|
|
1030
|
-
|
|
1031
|
-
```ts
|
|
1032
|
-
optional create_time?: number;
|
|
1033
|
-
```
|
|
1034
|
-
|
|
1035
|
-
***
|
|
1036
|
-
|
|
1037
|
-
### email?
|
|
1038
|
-
|
|
1039
|
-
```ts
|
|
1040
|
-
optional email?: string;
|
|
1041
|
-
```
|
|
1042
|
-
|
|
1043
|
-
***
|
|
1044
|
-
|
|
1045
|
-
### email\_hash?
|
|
1046
|
-
|
|
1047
|
-
```ts
|
|
1048
|
-
optional email_hash?: string;
|
|
1049
|
-
```
|
|
1050
|
-
|
|
1051
|
-
***
|
|
1052
|
-
|
|
1053
|
-
### event?
|
|
1054
|
-
|
|
1055
|
-
```ts
|
|
1056
|
-
optional event?: string;
|
|
1057
|
-
```
|
|
1058
|
-
|
|
1059
|
-
***
|
|
1060
|
-
|
|
1061
|
-
### event\_id?
|
|
1062
|
-
|
|
1063
|
-
```ts
|
|
1064
|
-
optional event_id?: string;
|
|
1065
|
-
```
|
|
1066
|
-
|
|
1067
|
-
***
|
|
1068
|
-
|
|
1069
|
-
### exids?
|
|
1070
|
-
|
|
1071
|
-
```ts
|
|
1072
|
-
optional exids?: ExIds;
|
|
1073
|
-
```
|
|
1074
|
-
|
|
1075
|
-
***
|
|
1076
|
-
|
|
1077
|
-
### fields?
|
|
1078
|
-
|
|
1079
|
-
```ts
|
|
1080
|
-
optional fields?: Record<string, unknown>;
|
|
1081
|
-
```
|
|
1082
|
-
|
|
1083
|
-
***
|
|
1084
|
-
|
|
1085
|
-
### host?
|
|
1086
|
-
|
|
1087
|
-
```ts
|
|
1088
|
-
optional host?: string;
|
|
1089
|
-
```
|
|
1090
|
-
|
|
1091
|
-
***
|
|
1092
|
-
|
|
1093
|
-
### pathname?
|
|
1094
|
-
|
|
1095
|
-
```ts
|
|
1096
|
-
optional pathname?: string;
|
|
1097
|
-
```
|
|
1098
|
-
|
|
1099
|
-
***
|
|
1100
|
-
|
|
1101
|
-
### pixel?
|
|
1102
|
-
|
|
1103
|
-
```ts
|
|
1104
|
-
optional pixel?: string;
|
|
1105
|
-
```
|
|
1106
|
-
|
|
1107
|
-
***
|
|
1108
|
-
|
|
1109
|
-
### receive\_time?
|
|
1110
|
-
|
|
1111
|
-
```ts
|
|
1112
|
-
optional receive_time?: number;
|
|
1113
|
-
```
|
|
1114
|
-
|
|
1115
|
-
***
|
|
1116
|
-
|
|
1117
|
-
### referrer?
|
|
1118
|
-
|
|
1119
|
-
```ts
|
|
1120
|
-
optional referrer?: object;
|
|
1121
|
-
```
|
|
1122
|
-
|
|
1123
|
-
### local
|
|
1124
|
-
|
|
1125
|
-
```ts
|
|
1126
|
-
local: string;
|
|
1127
|
-
```
|
|
1128
|
-
|
|
1129
|
-
### session
|
|
1130
|
-
|
|
1131
|
-
```ts
|
|
1132
|
-
session: string;
|
|
1133
|
-
```
|
|
1134
|
-
|
|
1135
|
-
***
|
|
1136
|
-
|
|
1137
|
-
### rid?
|
|
1138
|
-
|
|
1139
|
-
```ts
|
|
1140
|
-
optional rid?: string;
|
|
1141
|
-
```
|
|
1142
|
-
|
|
1143
|
-
***
|
|
1144
|
-
|
|
1145
|
-
### system?
|
|
1146
|
-
|
|
1147
|
-
```ts
|
|
1148
|
-
optional system?: ParsedResult;
|
|
1149
|
-
```
|
|
1150
|
-
|
|
1151
|
-
***
|
|
1152
|
-
|
|
1153
|
-
### uid?
|
|
1154
|
-
|
|
1155
|
-
```ts
|
|
1156
|
-
optional uid?: string;
|
|
1157
|
-
```
|
|
1158
|
-
|
|
1159
|
-
***
|
|
1160
|
-
|
|
1161
|
-
### utm?
|
|
1162
|
-
|
|
1163
|
-
```ts
|
|
1164
|
-
optional utm?: Record<string, string>[] | Record<string, string[]>;
|
|
1165
|
-
```
|
|
1166
|
-
|
|
1167
|
-
### <a id="ViewContentFields"></a>ViewContentFields
|
|
1168
|
-
|
|
1169
|
-
[**@xylabs/pixel**](#../README)
|
|
1170
|
-
|
|
1171
|
-
***
|
|
1172
|
-
|
|
1173
|
-
Fields for a view-content tracking event.
|
|
1174
|
-
|
|
1175
|
-
## Extends
|
|
1176
|
-
|
|
1177
|
-
- [`CommonFields`](#CommonFields)
|
|
1178
|
-
|
|
1179
|
-
## Properties
|
|
1180
|
-
|
|
1181
|
-
### funnel?
|
|
1182
|
-
|
|
1183
|
-
```ts
|
|
1184
|
-
optional funnel?: string;
|
|
1185
|
-
```
|
|
1186
|
-
|
|
1187
|
-
### Inherited from
|
|
1188
|
-
|
|
1189
|
-
[`CommonFields`](#CommonFields).[`funnel`](CommonFields.md#funnel)
|
|
1190
|
-
|
|
1191
|
-
***
|
|
1192
|
-
|
|
1193
|
-
### testData?
|
|
1194
|
-
|
|
1195
|
-
```ts
|
|
1196
|
-
optional testData?: string;
|
|
1197
|
-
```
|
|
1198
|
-
|
|
1199
|
-
### Inherited from
|
|
1200
|
-
|
|
1201
|
-
[`CommonFields`](#CommonFields).[`testData`](CommonFields.md#testdata)
|
|
1202
|
-
|
|
1203
|
-
***
|
|
1204
|
-
|
|
1205
|
-
### name
|
|
1206
|
-
|
|
1207
|
-
```ts
|
|
1208
|
-
name: string;
|
|
1209
|
-
```
|
|
1210
|
-
|
|
1211
|
-
***
|
|
1212
|
-
|
|
1213
|
-
### path
|
|
1214
|
-
|
|
1215
|
-
```ts
|
|
1216
|
-
path: string;
|
|
1217
|
-
```
|
|
1218
|
-
|
|
1219
|
-
### <a id="XyLabsTrackingEventJson"></a>XyLabsTrackingEventJson
|
|
1220
|
-
|
|
1221
|
-
[**@xylabs/pixel**](#../README)
|
|
1222
|
-
|
|
1223
|
-
***
|
|
1224
|
-
|
|
1225
|
-
JSON structure for an XY Labs tracking event as stored or transmitted.
|
|
1226
|
-
|
|
1227
|
-
## Properties
|
|
1228
|
-
|
|
1229
|
-
### cid
|
|
1230
|
-
|
|
1231
|
-
```ts
|
|
1232
|
-
cid: string;
|
|
1233
|
-
```
|
|
1234
|
-
|
|
1235
|
-
***
|
|
1236
|
-
|
|
1237
|
-
### create\_time?
|
|
1238
|
-
|
|
1239
|
-
```ts
|
|
1240
|
-
optional create_time?: number;
|
|
1241
|
-
```
|
|
1242
|
-
|
|
1243
|
-
***
|
|
1244
|
-
|
|
1245
|
-
### email?
|
|
1246
|
-
|
|
1247
|
-
```ts
|
|
1248
|
-
optional email?: string;
|
|
1249
|
-
```
|
|
1250
|
-
|
|
1251
|
-
***
|
|
1252
|
-
|
|
1253
|
-
### email\_hash?
|
|
1254
|
-
|
|
1255
|
-
```ts
|
|
1256
|
-
optional email_hash?: string;
|
|
1257
|
-
```
|
|
1258
|
-
|
|
1259
|
-
***
|
|
1260
|
-
|
|
1261
|
-
### event?
|
|
1262
|
-
|
|
1263
|
-
```ts
|
|
1264
|
-
optional event?: string;
|
|
1265
|
-
```
|
|
1266
|
-
|
|
1267
|
-
***
|
|
1268
|
-
|
|
1269
|
-
### event\_id?
|
|
1270
|
-
|
|
1271
|
-
```ts
|
|
1272
|
-
optional event_id?: string;
|
|
1273
|
-
```
|
|
1274
|
-
|
|
1275
|
-
***
|
|
1276
|
-
|
|
1277
|
-
### exids?
|
|
1278
|
-
|
|
1279
|
-
```ts
|
|
1280
|
-
optional exids?: Record<string, string>;
|
|
1281
|
-
```
|
|
1282
|
-
|
|
1283
|
-
***
|
|
1284
|
-
|
|
1285
|
-
### fields?
|
|
1286
|
-
|
|
1287
|
-
```ts
|
|
1288
|
-
optional fields?: Record<string, unknown>;
|
|
1289
|
-
```
|
|
1290
|
-
|
|
1291
|
-
***
|
|
1292
|
-
|
|
1293
|
-
### host?
|
|
1294
|
-
|
|
1295
|
-
```ts
|
|
1296
|
-
optional host?: string;
|
|
1297
|
-
```
|
|
1298
|
-
|
|
1299
|
-
***
|
|
1300
|
-
|
|
1301
|
-
### ip?
|
|
1302
|
-
|
|
1303
|
-
```ts
|
|
1304
|
-
optional ip?: string;
|
|
1305
|
-
```
|
|
1306
|
-
|
|
1307
|
-
***
|
|
1308
|
-
|
|
1309
|
-
### pathname?
|
|
1310
|
-
|
|
1311
|
-
```ts
|
|
1312
|
-
optional pathname?: string;
|
|
1313
|
-
```
|
|
1314
|
-
|
|
1315
|
-
***
|
|
1316
|
-
|
|
1317
|
-
### pixel?
|
|
1318
|
-
|
|
1319
|
-
```ts
|
|
1320
|
-
optional pixel?: string;
|
|
1321
|
-
```
|
|
1322
|
-
|
|
1323
|
-
***
|
|
1324
|
-
|
|
1325
|
-
### receive\_time?
|
|
1326
|
-
|
|
1327
|
-
```ts
|
|
1328
|
-
optional receive_time?: number;
|
|
1329
|
-
```
|
|
1330
|
-
|
|
1331
|
-
***
|
|
1332
|
-
|
|
1333
|
-
### rid?
|
|
1334
|
-
|
|
1335
|
-
```ts
|
|
1336
|
-
optional rid?: string;
|
|
1337
|
-
```
|
|
1338
|
-
|
|
1339
|
-
***
|
|
1340
|
-
|
|
1341
|
-
### system?
|
|
1342
|
-
|
|
1343
|
-
```ts
|
|
1344
|
-
optional system?: unknown;
|
|
1345
|
-
```
|
|
1346
|
-
|
|
1347
|
-
***
|
|
1348
|
-
|
|
1349
|
-
### ua?
|
|
1350
|
-
|
|
1351
|
-
```ts
|
|
1352
|
-
optional ua?: string;
|
|
1353
|
-
```
|
|
1354
|
-
|
|
1355
|
-
***
|
|
1356
|
-
|
|
1357
|
-
### uid?
|
|
1358
|
-
|
|
1359
|
-
```ts
|
|
1360
|
-
optional uid?: string;
|
|
1361
|
-
```
|
|
1362
|
-
|
|
1363
|
-
***
|
|
1364
|
-
|
|
1365
|
-
### utm?
|
|
1366
|
-
|
|
1367
|
-
```ts
|
|
1368
|
-
optional utm?: Record<string, string>[] | Record<string, string[]>;
|
|
1369
|
-
```
|
|
1370
|
-
|
|
1371
|
-
### interfaces
|
|
1372
|
-
|
|
1373
|
-
### <a id="UserEventSystem"></a>UserEventSystem
|
|
1374
|
-
|
|
1375
|
-
[**@xylabs/pixel**](#../README)
|
|
1376
|
-
|
|
1377
|
-
***
|
|
1378
|
-
|
|
1379
|
-
```ts
|
|
1380
|
-
interface UserEventSystem
|
|
1381
|
-
```
|
|
1382
|
-
|
|
1383
|
-
Parsed browser/OS/engine information from the user agent string.
|
|
1384
|
-
|
|
1385
|
-
#### Properties
|
|
1386
|
-
|
|
1387
|
-
### browser?
|
|
1388
|
-
|
|
1389
|
-
```ts
|
|
1390
|
-
optional browser: UserEventSystemBrowser;
|
|
1391
|
-
```
|
|
1392
|
-
|
|
1393
|
-
### engine?
|
|
1394
|
-
|
|
1395
|
-
```ts
|
|
1396
|
-
optional engine: UserEventSystemEngine;
|
|
1397
|
-
```
|
|
1398
|
-
|
|
1399
|
-
### os?
|
|
1400
|
-
|
|
1401
|
-
```ts
|
|
1402
|
-
optional os: UserEventSystemOS;
|
|
1403
|
-
```
|
|
1404
|
-
|
|
1405
|
-
### platform?
|
|
1406
|
-
|
|
1407
|
-
```ts
|
|
1408
|
-
optional platform: UserEventSystemPlatform;
|
|
1409
|
-
```
|
|
1410
|
-
|
|
1411
|
-
## Credits
|
|
1412
|
-
|
|
1413
|
-
[Made with 🔥 and ❄️ by XY Labs](https://xylabs.com)
|
|
1414
|
-
|
|
1415
|
-
[npm-badge]: https://img.shields.io/npm/v/@xylabs/pixel.svg
|
|
1416
|
-
[npm-link]: https://www.npmjs.com/package/@xylabs/pixel
|
|
1417
|
-
[license-badge]: https://img.shields.io/npm/l/@xylabs/pixel.svg
|
|
1418
|
-
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
|
1419
|
-
[logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
|
|
3
|
+
DEPRECATED — use `@ariestools/pixel` instead.
|