-
Notifications
You must be signed in to change notification settings - Fork 0
/
analytics-event-v1.json
620 lines (620 loc) · 21 KB
/
analytics-event-v1.json
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.yext.com/api/analytics/event",
"$version": "1",
"type": "object",
"title": "Analytics Event",
"description": "Represents an event for analytics purposes.",
"required": [
"action"
],
"additionalProperties": false,
"properties": {
"$schema": {
"const": "https://schema.yext.com/api/analytics/event/v1"
},
"action": {
"description": "The action which caused the event.",
"oneOf": [
{
"type": "string",
"title": "Standard",
"caseSensitive": false,
"description": "The action which caused the event. `caseSensitive: false`",
"enum": [
"ADD_TO_CART",
"ALL_TAB_NAVIGATION",
"APPLY",
"AUTO_COMPLETE_SELECTION",
"BACKWARD_PAGINATE",
"BOOK",
"BRAND_ICON",
"CALL_TO_ACTION",
"CASE_START",
"CASE_SUBMITTED",
"CHAT_IMPRESSION",
"CHAT_LINK_CLICK",
"CHAT_RESPONSE",
"COLLAPSE",
"DIRECTIONS",
"EVENT",
"EXPAND",
"FEATURED_MESSAGE",
"FILTERING_WITHIN_SECTION",
"FORWARD_PAGINATE",
"HEADER_LINKS",
"ITEM_IN_LIST",
"MAP_CARD",
"MAP_PIN",
"MENU",
"MESSAGE",
"ORDER",
"PAGINATE",
"PHONE",
"POST",
"PRESET_PROMPT",
"PRODUCT",
"PROFILE",
"QUESTION_FOCUS",
"QUESTION_SUBMIT",
"REMOVED_FILTER",
"REVIEW",
"SCROLL_TO_BOTTOM_OF_PAGE",
"SEARCH_BAR_IMPRESSION",
"SEARCH_CLEAR_BUTTON",
"THUMBS_DOWN",
"THUMBS_UP",
"TICKET_URL",
"TITLE",
"VERTICAL_TAB_NAVIGATION",
"VERTICAL_VIEW_ALL",
"VOICE_START",
"VOICE_STOP",
"WEBSITE"
]
},
{
"type": "string",
"pattern": "^[Cc]_[a-zA-Z0-9_-]{1,30}$",
"title": "Custom",
"caseSensitive": false,
"description": "Specifies a custom action for the event, which must start with \"`C_`\". `caseSensitive: false`, `pattern: \"^[Cc]_[a-zA-Z0-9_-]{1,30}$\"`"
}
]
},
"authorization": {
"type": "string",
"description": "An alternative to using the Authorization HTTP header. If a value is provided, it will override any Authorization header. Api keys should be formatted like \"KEY <apiKey>\", access tokens should be formatted like \"Bearer <bearerToken>\"",
"minLength": 1,
"maxLength": 8192,
"pattern": "^(KEY|Bearer)\\s.+$"
},
"bot": {
"description": "Whether the event is the result of bot activity.",
"default": "$auto",
"oneOf": [
{
"type": "boolean",
"description": "Specifies that the event should not be considered bot traffic."
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically detect whether this event originates from a bot."
}
]
},
"browserAgent": {
"type": "object",
"additionalProperties": false,
"description": "Information about the visitors device and browser.",
"default": {
"browser": "$auto",
"browserVersion": "$auto",
"device": "$auto",
"deviceClass": "$auto",
"os": "$auto",
"osVersion": "$auto",
"userAgent" : "$auto"
},
"properties": {
"browser": {
"default": "$auto",
"description": "The browser associated with the event.",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,128}$)",
"title": "string",
"description": "Specifies the browser for the event. `pattern: \"^[\\x20-\\x7E]{1,128}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the browser from request headers, or the value of the `userAgent` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no browser should be stored with the event."
}
]
},
"browserVersion": {
"default": "$auto",
"description": "The browser version associated with the event.",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,128}$)",
"title": "string",
"description": "Specifies the browser version for the event. `pattern: \"^[\\x20-\\x7E]{1,128}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the browser version from request headers, or the value of the `userAgent` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no browser version should be stored with the event."
}
]
},
"device": {
"default": "$auto",
"description": "The device associated with the event.",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,128}$)",
"title": "string",
"description": "Specifies the device for the event. `pattern: \"^[\\x20-\\x7E]{1,128}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the device from request headers, or the value of the `userAgent` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no device should be stored with the event."
}
]
},
"deviceClass": {
"default": "$auto",
"description": "The class of device associated with the event.",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,32}$)",
"caseSensitive": false,
"title": "string",
"description": "Specifies the device class for the event. `caseSensitive: false`, `pattern: \"^[\\x20-\\x7E]{1,32}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the device class from request headers, or the value of the `userAgent` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no device class should be stored with the event."
}
]
},
"os": {
"default": "$auto",
"description": "The operating system associated with the event.",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,128}$)",
"title": "string",
"description": "Specifies the operating system for the event. `pattern: \"^[\\x20-\\x7E]{1,128}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the operating system from request headers, or the value of the `userAgent` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no operating system should be stored with the event."
}
]
},
"osVersion": {
"default": "$auto",
"description": "The operating system version associated with the event.",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,128}$)",
"title": "string",
"description": "Specifies the operating system version for the event. `pattern: \"^[\\x20-\\x7E]{1,128}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the operating system version from request headers, or the value of the `userAgent` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no operating system version should be stored with the event."
}
]
},
"userAgent": {
"description": "The user agent string for the event.",
"default": "$auto",
"oneOf": [
{
"type": "string",
"pattern": "(?!\\$auto$)(^[\\x20-\\x7E]{1,8192}$)",
"title": "string",
"description": "Specifies the user agent string for the event. `pattern: \"^[\\x20-\\x7E]{1,8192}$\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to use the `User-Agent` header of the request."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no user agent should be stored with the event."
}
]
}
}
},
"chat": {
"type": "object",
"title": "Chat",
"description": "The Yext Chat properties of the event.",
"properties": {
"botId": {
"type": "string",
"minLength": 1,
"maxLength": 50,
"description": "The ID of the chat bot an event was tied to."
},
"conversationId": {
"type": "string",
"minLength": 48,
"maxLength": 48,
"description": "The ID of a conversation an event was tied to. Not all events are tied to a specific conversation. For example, both impressions are registered before the conversation begins. Must be 48 chars long"
},
"responseId": {
"type": "string",
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$",
"description": "The ID of the response an event was tied to. Not all events are tied to a specific response, but if present it must be a valid ULID. This is analogous to queryId in Search. `pattern: \"^[0-9A-HJKMNP-TV-Z]{26}$\"`"
}
},
"required": [
"botId"
],
"additionalProperties": false
},
"clientSdk": {
"type": "object",
"description": "For the Yext client SDKs involved in the event, this is an object mapping the names of those SDKs to the version labels of those SDKs.",
"maxProperties": 10,
"additionalProperties": {
"type": "string",
"maxLength": 32
},
"propertyNames": {
"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,31}$"
}
},
"count": {
"type": "integer",
"minimum": 1,
"maximum": 1000000000,
"default": 1,
"description": "When one record summarizes multiple events, this is the number of events the record represents. The event is treated as if it is duplicated this many times."
},
"customTags": {
"type": "object",
"description": "Up to 10 pairs matching custom string keys to string values to associate with the event. Keys are case-insensitive; values are case-sensitive. Property Name`pattern: \"^[a-zA-Z][a-zA-Z0-9_]{0,31}$\"`",
"maxProperties": 10,
"additionalProperties": {
"type": "string",
"maxLength": 64
},
"propertyNames": {
"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,31}$"
}
},
"customValues": {
"type": "object",
"description": "Up to 10 pairs matching custom string keys to number values to associate with the event. Keys are case-insensitive. Property Name `pattern: \"^[a-zA-Z][a-zA-Z0-9_]{0,31}$\"`",
"maxProperties": 10,
"additionalProperties": {
"type": "string",
"maxLength": 64
},
"propertyNames": {
"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,31}$"
}
},
"destinationUrl": {
"type": "string",
"format": "uri",
"title": "URL",
"description": "The URL of the page the event is directing the visitor to. `format: uri`"
},
"entity": {
"type": ["string","integer"],
"oneOf": [
{
"type": "string",
"title": "entityId",
"minLength": 1,
"maxLength": 38,
"description": "The mutable, customer-settable entity ID for the entity associated with the event. "
},
{
"type": "integer",
"title": "entityUid",
"minimum": 0,
"description": "The immutable entity ID set by the system. This is an internal ID."
}
]
},
"internalUser": {
"type": "boolean",
"default":false,
"description": "Indicates whether the event is the result of internal activity."
},
"ip": {
"type": ["object","null"],
"description": "The IP address for the event.",
"default": {
"address": "$auto",
"algorithm": "HASH"
},
"oneOf": [
{
"type": "object",
"title": "IP",
"properties": {
"address": {
"oneOf": [
{
"type": "string",
"format": "ipv4",
"title": "IPv4",
"description": "Specifies the IPv4 address associated with the event. `format: \"ipv4\"`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to use the Source IP address from the IP header of the request. This IP address is only used if the `Yext-Opt-In: ip` header is present."
}
]
},
"algorithm": {
"type": "string",
"enum": [
"HASH"
],
"description": "The algorithm to use to anonymize the IP address after collection."
}
},
"required": [
"address",
"algorithm"
],
"additionalProperties": false
},
{
"type": "null",
"title": "null",
"description": "Specifies that no IP address should be associated with the event."
}
]
},
"label": {
"type": "string",
"description": "A label assigned to the event, e.g. a CTA label.",
"minLength": 1,
"maxLength": 16777216
},
"locale": {
"default": "$auto",
"description": "The locale of the user who generated the event.",
"oneOf": [
{
"type": "string",
"title": "Locale",
"minLength": 1,
"maxLength": 16,
"pattern": "^(?!(\\$auto)$).*$",
"description": "Specifies the locale of the visitor for the event, e.g. `en-US`."
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine the locale from the Accept-Language header."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no locale information should be stored with the event."
}
]
},
"location": {
"default": "$auto",
"description": "The location information of the visitor for the event.",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"title": "Location",
"description": "Specifies the location information of visitor for the event.",
"properties": {
"coordinates": {
"type": "object",
"description": "The geographic coordinates of the visitor for the event.",
"properties": {
"latitude": {
"type": "number",
"minimum": -90,
"maximum": 90,
"description": "The latitude, in degrees North."
},
"longitude": {
"type": "number",
"minimum": -180,
"maximum": 180,
"description": "The longitude, in degrees East."
}
},
"required": [
"latitude",
"longitude"
],
"additionalProperties": false
},
"country": {
"type": "string",
"minLength": 2,
"maxLength": 2,
"caseSensitive": false,
"description": "The country of the visitor for the event, as a ISO 3166-1 alpha-2 country code. `caseSensitive: false`"
}
}
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to automatically determine all location information from the request's IP address, or the value of the `ip` property if specified."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no location information should be stored with the event."
}
]
},
"nonce": {
"type": "string",
"pattern": "^[\\x20-\\x7E]{1,36}$",
"description": "Deduplication ID for the event. Events from the same app for the same business with the same nonce will get de-duplicated. `pattern: \"^[\\x20-\\x7E]{1,36}$\"`"
},
"pageUrl": {
"description": "The URL of the page the event occurred on.",
"default": "$auto",
"oneOf": [
{
"type": "string",
"format": "uri",
"title": "URL",
"description": "Specifies the URL of the page the event occurred on. `format: uri`"
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to use the `Referer` header of the request."
},
{
"type": "null",
"title": "null",
"description": "Specifies that no page URL should be stored with the event."
}
]
},
"referrerUrl": {
"type": "string",
"format": "uri",
"description": "The URL of the page which the visitor came from prior to the event."
},
"searchTerm": {
"type": "string",
"description": "The query entered by the user.",
"minLength": 1,
"maxLength": 16777216
},
"sessionId": {
"type": "string",
"pattern": "^[\\x20-\\x7E]{1,36}$",
"description": "ID of the user session associated with event. `pattern: \"^[\\x20-\\x7E]{1,36}$\"`"
},
"timestamp": {
"description": "The timestamp at which the event occurred.",
"default": "$auto",
"oneOf": [
{
"type": "string",
"format": "date-time",
"title": "ISO Timestamp",
"description": "Specifies the timestamp at which the event occurred. `format: \"date-time\"`"
},
{
"type": "number",
"minimum": 0,
"maximum": 3250091520000,
"title": "Epoch millisecond",
"description": "Specifies the timestamp at which the event occurred as the number of milliseconds since 1970-01-01T00:00:00Z UTC, ignoring leap seconds."
},
{
"const": "$auto",
"title": "$auto",
"description": "Indicates to use the time when the request was received as the event timestamp."
}
]
},
"value": {
"type": "object",
"title": "Value",
"description": "The monetary value of the event",
"properties": {
"amount": {
"type": "number",
"multipleOf": 0.0001,
"description": "The monetary value of the event."
},
"currency": {
"type": "string",
"minLength": 3,
"maxLength": 3,
"pattern": "^[A-Z]{3}$",
"description": "The ISO 4217 currency code of the currency the value is expressed in. `pattern: \"^[A-Z]{3}$\"`"
}
},
"required": [
"amount",
"currency"
],
"additionalProperties": false
},
"visitor": {
"type": "object",
"description": "The visitor related to the event. Keys are visitor methods and values are visitor IDs. PropertyName pattern: \"^[a-zA-Z0-9_-]{1,16}$\". Value pattern: \"^[\\x20-\\x7E]{1,64}$\"",
"patternProperties": {
"^[a-zA-Z0-9_-]{1,16}$": {
"type": "string",
"pattern": "^[\\x20-\\x7E]{1,64}$"
}
},
"maxProperties": 1
}
},
"if": {
"properties": { "action": { "const": "CHAT_RESPONSE" } }
},
"then": {
"properties": { "chat": { "required": ["botId", "responseId"] } },
"required": ["chat"]
}
}