@inspira-npm/events 0.0.0-stage → 0.3.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.
- package/dist/catalog.d.ts +2 -0
- package/dist/catalog.js +246 -0
- package/dist/catalog.json +665 -0
- package/dist/click-record-B8KyALZZ.d.ts +31 -0
- package/dist/index-BShrVaIU.d.ts +203 -0
- package/dist/index.d.ts +202 -0
- package/dist/index.js +753 -0
- package/dist/server.d.ts +141 -0
- package/dist/server.js +445 -0
- package/dist/shared-D2s2QSYg.js +23 -0
- package/dist/version-DPt-j93d.js +4 -0
- package/package.json +39 -4
- package/README.md +0 -3
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sdk_version": "0.3.0",
|
|
3
|
+
"events": {
|
|
4
|
+
"page_view": {
|
|
5
|
+
"description": "Vista de página. Se dispara al cargar y en cada navegación del router (SPA). La URL ya va en el contexto del evento.",
|
|
6
|
+
"domain": "page",
|
|
7
|
+
"source": "browser",
|
|
8
|
+
"since": "0.1.0",
|
|
9
|
+
"schema": {
|
|
10
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"page_type": {
|
|
14
|
+
"description": "Tipo de página estable: home, hotels-srp, hotel-details, checkout, landing…",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"maxLength": 50
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"additionalProperties": false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"ad_impression": {
|
|
23
|
+
"description": "Impresión VISIBLE de un ad: ≥50% del ad en pantalla durante ≥1 s (estándar IAB). Una por ad y montaje.",
|
|
24
|
+
"domain": "ads",
|
|
25
|
+
"source": "browser",
|
|
26
|
+
"since": "0.1.0",
|
|
27
|
+
"schema": {
|
|
28
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"ad_id": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1,
|
|
34
|
+
"maxLength": 100,
|
|
35
|
+
"description": "`id` del ad tal como lo devuelve el ads engine"
|
|
36
|
+
},
|
|
37
|
+
"ad_type": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"minLength": 1,
|
|
40
|
+
"maxLength": 50,
|
|
41
|
+
"description": "`adType` del engine: resort, hotel, destinations, promotions, banner…"
|
|
42
|
+
},
|
|
43
|
+
"placement": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"maxLength": 100,
|
|
46
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
47
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
48
|
+
},
|
|
49
|
+
"position": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 0,
|
|
52
|
+
"maximum": 9007199254740991,
|
|
53
|
+
"description": "Posición 0-based en la lista o carrusel"
|
|
54
|
+
},
|
|
55
|
+
"campaign_id": {
|
|
56
|
+
"description": "Campaña que sirvió el ad, si se conoce",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"maxLength": 100
|
|
59
|
+
},
|
|
60
|
+
"token": {
|
|
61
|
+
"description": "Token firmado que el engine devuelve con cada ad (cuando exista); valida el evento",
|
|
62
|
+
"type": "string",
|
|
63
|
+
"maxLength": 2000
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": [
|
|
67
|
+
"ad_id",
|
|
68
|
+
"ad_type",
|
|
69
|
+
"placement"
|
|
70
|
+
],
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"ad_click": {
|
|
75
|
+
"description": "Click en un ad. `click_id` viaja en la URL de destino (`?ipc=`) para atribuir conversiones.",
|
|
76
|
+
"domain": "ads",
|
|
77
|
+
"source": "browser",
|
|
78
|
+
"since": "0.1.0",
|
|
79
|
+
"schema": {
|
|
80
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"ad_id": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1,
|
|
86
|
+
"maxLength": 100,
|
|
87
|
+
"description": "`id` del ad tal como lo devuelve el ads engine"
|
|
88
|
+
},
|
|
89
|
+
"ad_type": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"minLength": 1,
|
|
92
|
+
"maxLength": 50,
|
|
93
|
+
"description": "`adType` del engine: resort, hotel, destinations, promotions, banner…"
|
|
94
|
+
},
|
|
95
|
+
"placement": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"maxLength": 100,
|
|
98
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
99
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
100
|
+
},
|
|
101
|
+
"position": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"minimum": 0,
|
|
104
|
+
"maximum": 9007199254740991,
|
|
105
|
+
"description": "Posición 0-based en la lista o carrusel"
|
|
106
|
+
},
|
|
107
|
+
"campaign_id": {
|
|
108
|
+
"description": "Campaña que sirvió el ad, si se conoce",
|
|
109
|
+
"type": "string",
|
|
110
|
+
"maxLength": 100
|
|
111
|
+
},
|
|
112
|
+
"token": {
|
|
113
|
+
"description": "Token firmado que el engine devuelve con cada ad (cuando exista); valida el evento",
|
|
114
|
+
"type": "string",
|
|
115
|
+
"maxLength": 2000
|
|
116
|
+
},
|
|
117
|
+
"click_id": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"format": "uuid",
|
|
120
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
121
|
+
"description": "Id único del click; también va en la URL de destino como ?ipc="
|
|
122
|
+
},
|
|
123
|
+
"destination_url": {
|
|
124
|
+
"description": "URL a la que lleva el ad",
|
|
125
|
+
"type": "string",
|
|
126
|
+
"maxLength": 2000
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"required": [
|
|
130
|
+
"ad_id",
|
|
131
|
+
"ad_type",
|
|
132
|
+
"placement",
|
|
133
|
+
"click_id"
|
|
134
|
+
],
|
|
135
|
+
"additionalProperties": false
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"card_impression": {
|
|
139
|
+
"description": "Impresión VISIBLE de una card (≥50% en pantalla durante ≥1 s). Una por card y montaje.",
|
|
140
|
+
"domain": "cards",
|
|
141
|
+
"source": "browser",
|
|
142
|
+
"since": "0.1.0",
|
|
143
|
+
"schema": {
|
|
144
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
145
|
+
"type": "object",
|
|
146
|
+
"properties": {
|
|
147
|
+
"card_type": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"minLength": 1,
|
|
150
|
+
"maxLength": 50,
|
|
151
|
+
"description": "Qué representa la card: hotel, resort, destination, activity, car, promotion…"
|
|
152
|
+
},
|
|
153
|
+
"item_id": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"minLength": 1,
|
|
156
|
+
"maxLength": 200,
|
|
157
|
+
"description": "Id del ítem que representa la card"
|
|
158
|
+
},
|
|
159
|
+
"placement": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"maxLength": 100,
|
|
162
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
163
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
164
|
+
},
|
|
165
|
+
"position": {
|
|
166
|
+
"type": "integer",
|
|
167
|
+
"minimum": 0,
|
|
168
|
+
"maximum": 9007199254740991,
|
|
169
|
+
"description": "Posición 0-based en la lista o carrusel"
|
|
170
|
+
},
|
|
171
|
+
"list_id": {
|
|
172
|
+
"description": "Id de la lista o búsqueda que la contiene",
|
|
173
|
+
"type": "string",
|
|
174
|
+
"maxLength": 100
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"required": [
|
|
178
|
+
"card_type",
|
|
179
|
+
"item_id",
|
|
180
|
+
"placement"
|
|
181
|
+
],
|
|
182
|
+
"additionalProperties": false
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"card_click": {
|
|
186
|
+
"description": "Click en una card o en una de sus acciones.",
|
|
187
|
+
"domain": "cards",
|
|
188
|
+
"source": "browser",
|
|
189
|
+
"since": "0.1.0",
|
|
190
|
+
"schema": {
|
|
191
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"properties": {
|
|
194
|
+
"card_type": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"minLength": 1,
|
|
197
|
+
"maxLength": 50,
|
|
198
|
+
"description": "Qué representa la card: hotel, resort, destination, activity, car, promotion…"
|
|
199
|
+
},
|
|
200
|
+
"item_id": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"minLength": 1,
|
|
203
|
+
"maxLength": 200,
|
|
204
|
+
"description": "Id del ítem que representa la card"
|
|
205
|
+
},
|
|
206
|
+
"placement": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"maxLength": 100,
|
|
209
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
210
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
211
|
+
},
|
|
212
|
+
"position": {
|
|
213
|
+
"type": "integer",
|
|
214
|
+
"minimum": 0,
|
|
215
|
+
"maximum": 9007199254740991,
|
|
216
|
+
"description": "Posición 0-based en la lista o carrusel"
|
|
217
|
+
},
|
|
218
|
+
"list_id": {
|
|
219
|
+
"description": "Id de la lista o búsqueda que la contiene",
|
|
220
|
+
"type": "string",
|
|
221
|
+
"maxLength": 100
|
|
222
|
+
},
|
|
223
|
+
"action": {
|
|
224
|
+
"description": "Qué parte de la card se clickeó; sin valor = la card completa (open)",
|
|
225
|
+
"type": "string",
|
|
226
|
+
"enum": [
|
|
227
|
+
"open",
|
|
228
|
+
"book",
|
|
229
|
+
"favorite",
|
|
230
|
+
"share",
|
|
231
|
+
"map"
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"required": [
|
|
236
|
+
"card_type",
|
|
237
|
+
"item_id",
|
|
238
|
+
"placement"
|
|
239
|
+
],
|
|
240
|
+
"additionalProperties": false
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"map_marker_click": {
|
|
244
|
+
"description": "Click en un marcador del mapa (hotel, resort, punto de interés…).",
|
|
245
|
+
"domain": "map",
|
|
246
|
+
"source": "browser",
|
|
247
|
+
"since": "0.1.0",
|
|
248
|
+
"schema": {
|
|
249
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
250
|
+
"type": "object",
|
|
251
|
+
"properties": {
|
|
252
|
+
"placement": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"maxLength": 100,
|
|
255
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
256
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
257
|
+
},
|
|
258
|
+
"item_type": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"minLength": 1,
|
|
261
|
+
"maxLength": 50,
|
|
262
|
+
"description": "Qué representa el marcador: hotel, resort, poi…"
|
|
263
|
+
},
|
|
264
|
+
"item_id": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"minLength": 1,
|
|
267
|
+
"maxLength": 200,
|
|
268
|
+
"description": "Id del ítem que representa el marcador"
|
|
269
|
+
},
|
|
270
|
+
"zoom": {
|
|
271
|
+
"type": "number",
|
|
272
|
+
"minimum": 0,
|
|
273
|
+
"maximum": 22,
|
|
274
|
+
"description": "Nivel de zoom del mapa al momento del evento"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"required": [
|
|
278
|
+
"placement",
|
|
279
|
+
"item_type",
|
|
280
|
+
"item_id"
|
|
281
|
+
],
|
|
282
|
+
"additionalProperties": false
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"map_interaction": {
|
|
286
|
+
"description": "Interacción con el mapa que no es click en marcador. No se trackea el paneo (demasiado ruido).",
|
|
287
|
+
"domain": "map",
|
|
288
|
+
"source": "browser",
|
|
289
|
+
"since": "0.1.0",
|
|
290
|
+
"schema": {
|
|
291
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
292
|
+
"type": "object",
|
|
293
|
+
"properties": {
|
|
294
|
+
"placement": {
|
|
295
|
+
"type": "string",
|
|
296
|
+
"maxLength": 100,
|
|
297
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
298
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
299
|
+
},
|
|
300
|
+
"action": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"enum": [
|
|
303
|
+
"zoom",
|
|
304
|
+
"cluster_click",
|
|
305
|
+
"search_area",
|
|
306
|
+
"popup_open",
|
|
307
|
+
"fullscreen"
|
|
308
|
+
],
|
|
309
|
+
"description": "search_area = botón 'buscar en esta zona'"
|
|
310
|
+
},
|
|
311
|
+
"zoom": {
|
|
312
|
+
"type": "number",
|
|
313
|
+
"minimum": 0,
|
|
314
|
+
"maximum": 22,
|
|
315
|
+
"description": "Nivel de zoom del mapa al momento del evento"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"required": [
|
|
319
|
+
"placement",
|
|
320
|
+
"action"
|
|
321
|
+
],
|
|
322
|
+
"additionalProperties": false
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"search_performed": {
|
|
326
|
+
"description": "Búsqueda ejecutada (al recibir resultados). Una por búsqueda; un cambio de filtros que vuelve a buscar es otra.",
|
|
327
|
+
"domain": "search",
|
|
328
|
+
"source": "browser",
|
|
329
|
+
"since": "0.1.0",
|
|
330
|
+
"schema": {
|
|
331
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
332
|
+
"type": "object",
|
|
333
|
+
"properties": {
|
|
334
|
+
"search_id": {
|
|
335
|
+
"type": "string",
|
|
336
|
+
"format": "uuid",
|
|
337
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
338
|
+
"description": "Id de la búsqueda (generado en el cliente); une resultados y clicks de la misma búsqueda"
|
|
339
|
+
},
|
|
340
|
+
"service": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"enum": [
|
|
343
|
+
"hotels",
|
|
344
|
+
"resorts",
|
|
345
|
+
"flights",
|
|
346
|
+
"cars",
|
|
347
|
+
"activities",
|
|
348
|
+
"transfers",
|
|
349
|
+
"cruises"
|
|
350
|
+
],
|
|
351
|
+
"description": "Servicio de la plataforma"
|
|
352
|
+
},
|
|
353
|
+
"destination": {
|
|
354
|
+
"type": "object",
|
|
355
|
+
"properties": {
|
|
356
|
+
"id": {
|
|
357
|
+
"description": "Id del destino/origen en el proveedor",
|
|
358
|
+
"type": "string",
|
|
359
|
+
"maxLength": 100
|
|
360
|
+
},
|
|
361
|
+
"name": {
|
|
362
|
+
"description": "Nombre de la sugerencia SELECCIONADA",
|
|
363
|
+
"type": "string",
|
|
364
|
+
"maxLength": 200
|
|
365
|
+
},
|
|
366
|
+
"type": {
|
|
367
|
+
"description": "Tipo de lugar de la sugerencia",
|
|
368
|
+
"type": "string",
|
|
369
|
+
"enum": [
|
|
370
|
+
"city",
|
|
371
|
+
"region",
|
|
372
|
+
"country",
|
|
373
|
+
"hotel",
|
|
374
|
+
"airport",
|
|
375
|
+
"poi"
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"additionalProperties": false,
|
|
380
|
+
"description": "Destino u origen elegido de las sugerencias"
|
|
381
|
+
},
|
|
382
|
+
"origin": {
|
|
383
|
+
"description": "Solo vuelos/traslados",
|
|
384
|
+
"type": "object",
|
|
385
|
+
"properties": {
|
|
386
|
+
"id": {
|
|
387
|
+
"description": "Id del destino/origen en el proveedor",
|
|
388
|
+
"type": "string",
|
|
389
|
+
"maxLength": 100
|
|
390
|
+
},
|
|
391
|
+
"name": {
|
|
392
|
+
"description": "Nombre de la sugerencia SELECCIONADA",
|
|
393
|
+
"type": "string",
|
|
394
|
+
"maxLength": 200
|
|
395
|
+
},
|
|
396
|
+
"type": {
|
|
397
|
+
"description": "Tipo de lugar de la sugerencia",
|
|
398
|
+
"type": "string",
|
|
399
|
+
"enum": [
|
|
400
|
+
"city",
|
|
401
|
+
"region",
|
|
402
|
+
"country",
|
|
403
|
+
"hotel",
|
|
404
|
+
"airport",
|
|
405
|
+
"poi"
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"additionalProperties": false
|
|
410
|
+
},
|
|
411
|
+
"check_in": {
|
|
412
|
+
"description": "YYYY-MM-DD (o fecha de salida)",
|
|
413
|
+
"type": "string",
|
|
414
|
+
"format": "date",
|
|
415
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
|
|
416
|
+
},
|
|
417
|
+
"check_out": {
|
|
418
|
+
"description": "YYYY-MM-DD (o fecha de regreso)",
|
|
419
|
+
"type": "string",
|
|
420
|
+
"format": "date",
|
|
421
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
|
|
422
|
+
},
|
|
423
|
+
"rooms": {
|
|
424
|
+
"description": "Habitaciones pedidas",
|
|
425
|
+
"type": "integer",
|
|
426
|
+
"minimum": 1,
|
|
427
|
+
"maximum": 20
|
|
428
|
+
},
|
|
429
|
+
"adults": {
|
|
430
|
+
"description": "Adultos (total de la búsqueda)",
|
|
431
|
+
"type": "integer",
|
|
432
|
+
"minimum": 0,
|
|
433
|
+
"maximum": 50
|
|
434
|
+
},
|
|
435
|
+
"children": {
|
|
436
|
+
"description": "Menores (total de la búsqueda)",
|
|
437
|
+
"type": "integer",
|
|
438
|
+
"minimum": 0,
|
|
439
|
+
"maximum": 50
|
|
440
|
+
},
|
|
441
|
+
"results_count": {
|
|
442
|
+
"description": "Resultados devueltos; 0 = sin resultados",
|
|
443
|
+
"type": "integer",
|
|
444
|
+
"minimum": 0,
|
|
445
|
+
"maximum": 9007199254740991
|
|
446
|
+
},
|
|
447
|
+
"filters": {
|
|
448
|
+
"description": "Filtros activos: { stars: [4,5] → ['4','5'], price_max: 300, all_inclusive: true }",
|
|
449
|
+
"type": "object",
|
|
450
|
+
"propertyNames": {
|
|
451
|
+
"type": "string",
|
|
452
|
+
"maxLength": 50
|
|
453
|
+
},
|
|
454
|
+
"additionalProperties": {
|
|
455
|
+
"anyOf": [
|
|
456
|
+
{
|
|
457
|
+
"type": "string",
|
|
458
|
+
"maxLength": 100
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"type": "number"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"type": "boolean"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"maxItems": 50,
|
|
468
|
+
"type": "array",
|
|
469
|
+
"items": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"maxLength": 100
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"sort": {
|
|
478
|
+
"description": "Orden aplicado: price_asc, rating_desc…",
|
|
479
|
+
"type": "string",
|
|
480
|
+
"maxLength": 50
|
|
481
|
+
},
|
|
482
|
+
"page": {
|
|
483
|
+
"description": "Página de resultados (1-based)",
|
|
484
|
+
"type": "integer",
|
|
485
|
+
"minimum": 1,
|
|
486
|
+
"maximum": 9007199254740991
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"required": [
|
|
490
|
+
"search_id",
|
|
491
|
+
"service"
|
|
492
|
+
],
|
|
493
|
+
"additionalProperties": false
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"search_result_click": {
|
|
497
|
+
"description": "Click en un resultado de búsqueda.",
|
|
498
|
+
"domain": "search",
|
|
499
|
+
"source": "browser",
|
|
500
|
+
"since": "0.1.0",
|
|
501
|
+
"schema": {
|
|
502
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
503
|
+
"type": "object",
|
|
504
|
+
"properties": {
|
|
505
|
+
"search_id": {
|
|
506
|
+
"type": "string",
|
|
507
|
+
"format": "uuid",
|
|
508
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
509
|
+
"description": "Id de la búsqueda (generado en el cliente); une resultados y clicks de la misma búsqueda"
|
|
510
|
+
},
|
|
511
|
+
"service": {
|
|
512
|
+
"type": "string",
|
|
513
|
+
"enum": [
|
|
514
|
+
"hotels",
|
|
515
|
+
"resorts",
|
|
516
|
+
"flights",
|
|
517
|
+
"cars",
|
|
518
|
+
"activities",
|
|
519
|
+
"transfers",
|
|
520
|
+
"cruises"
|
|
521
|
+
],
|
|
522
|
+
"description": "Servicio de la plataforma"
|
|
523
|
+
},
|
|
524
|
+
"item_id": {
|
|
525
|
+
"type": "string",
|
|
526
|
+
"minLength": 1,
|
|
527
|
+
"maxLength": 200,
|
|
528
|
+
"description": "Id del resultado clickeado (hotel, vuelo, auto…)"
|
|
529
|
+
},
|
|
530
|
+
"position": {
|
|
531
|
+
"type": "integer",
|
|
532
|
+
"minimum": 0,
|
|
533
|
+
"maximum": 9007199254740991,
|
|
534
|
+
"description": "Posición 0-based en la lista o carrusel"
|
|
535
|
+
},
|
|
536
|
+
"price": {
|
|
537
|
+
"description": "Precio mostrado en el resultado",
|
|
538
|
+
"type": "number",
|
|
539
|
+
"minimum": 0
|
|
540
|
+
},
|
|
541
|
+
"currency": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"pattern": "^[A-Z]{3}$",
|
|
544
|
+
"description": "Código ISO 4217, p. ej. USD"
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
"required": [
|
|
548
|
+
"search_id",
|
|
549
|
+
"service",
|
|
550
|
+
"item_id",
|
|
551
|
+
"position"
|
|
552
|
+
],
|
|
553
|
+
"additionalProperties": false
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
"outbound_click": {
|
|
557
|
+
"description": "Click en un link o CTA medido que lleva a otro sitio o página (p. ej. CTA de una landing → sitio principal). `click_id` viaja en la URL de destino (`?ipc=`); `via_click_id` encadena la atribución con el click por el que llegó el visitante.",
|
|
558
|
+
"domain": "navigation",
|
|
559
|
+
"source": "browser",
|
|
560
|
+
"since": "0.2.0",
|
|
561
|
+
"schema": {
|
|
562
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
563
|
+
"type": "object",
|
|
564
|
+
"properties": {
|
|
565
|
+
"placement": {
|
|
566
|
+
"type": "string",
|
|
567
|
+
"maxLength": 100,
|
|
568
|
+
"pattern": "^[a-z0-9_-]+(\\.[a-z0-9_-]+)*$",
|
|
569
|
+
"description": "Dónde se mostró: <pagina>.<seccion>, p. ej. home.resorts-carousel"
|
|
570
|
+
},
|
|
571
|
+
"item_id": {
|
|
572
|
+
"description": "Id del ítem al que lleva el CTA (hotel, resort, oferta…), si lo hay",
|
|
573
|
+
"type": "string",
|
|
574
|
+
"minLength": 1,
|
|
575
|
+
"maxLength": 200
|
|
576
|
+
},
|
|
577
|
+
"click_id": {
|
|
578
|
+
"type": "string",
|
|
579
|
+
"format": "uuid",
|
|
580
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
|
|
581
|
+
"description": "Id único del click; también va en la URL de destino como ?ipc="
|
|
582
|
+
},
|
|
583
|
+
"via_click_id": {
|
|
584
|
+
"description": "Click id con el que LLEGÓ el visitante (`?ipc=` capturado en este sitio); lo pone el SDK",
|
|
585
|
+
"type": "string",
|
|
586
|
+
"format": "uuid",
|
|
587
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
588
|
+
},
|
|
589
|
+
"destination_url": {
|
|
590
|
+
"description": "URL a la que lleva el click",
|
|
591
|
+
"type": "string",
|
|
592
|
+
"maxLength": 2000
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
"required": [
|
|
596
|
+
"placement",
|
|
597
|
+
"click_id"
|
|
598
|
+
],
|
|
599
|
+
"additionalProperties": false
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"conversion": {
|
|
603
|
+
"description": "Conversión confirmada (reserva, lead, registro). La envía un BACKEND server-to-server, nunca el navegador. Idempotente por `conversion_id`.",
|
|
604
|
+
"domain": "conversions",
|
|
605
|
+
"source": "server",
|
|
606
|
+
"since": "0.1.0",
|
|
607
|
+
"schema": {
|
|
608
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
609
|
+
"type": "object",
|
|
610
|
+
"properties": {
|
|
611
|
+
"conversion_id": {
|
|
612
|
+
"type": "string",
|
|
613
|
+
"minLength": 1,
|
|
614
|
+
"maxLength": 100,
|
|
615
|
+
"description": "Referencia única (n.º de reserva/lead); reenviar el mismo id no duplica"
|
|
616
|
+
},
|
|
617
|
+
"type": {
|
|
618
|
+
"type": "string",
|
|
619
|
+
"enum": [
|
|
620
|
+
"booking",
|
|
621
|
+
"lead",
|
|
622
|
+
"signup",
|
|
623
|
+
"purchase"
|
|
624
|
+
],
|
|
625
|
+
"description": "Qué se convirtió: reserva, lead, registro o compra"
|
|
626
|
+
},
|
|
627
|
+
"service": {
|
|
628
|
+
"type": "string",
|
|
629
|
+
"enum": [
|
|
630
|
+
"hotels",
|
|
631
|
+
"resorts",
|
|
632
|
+
"flights",
|
|
633
|
+
"cars",
|
|
634
|
+
"activities",
|
|
635
|
+
"transfers",
|
|
636
|
+
"cruises"
|
|
637
|
+
],
|
|
638
|
+
"description": "Servicio de la plataforma"
|
|
639
|
+
},
|
|
640
|
+
"value": {
|
|
641
|
+
"description": "Monto de la conversión",
|
|
642
|
+
"type": "number",
|
|
643
|
+
"minimum": 0
|
|
644
|
+
},
|
|
645
|
+
"currency": {
|
|
646
|
+
"type": "string",
|
|
647
|
+
"pattern": "^[A-Z]{3}$",
|
|
648
|
+
"description": "Código ISO 4217, p. ej. USD"
|
|
649
|
+
},
|
|
650
|
+
"click_id": {
|
|
651
|
+
"description": "`tracker.getClickId()` del front; atribuye la conversión al click (`ad_click` u `outbound_click`) con ese id",
|
|
652
|
+
"type": "string",
|
|
653
|
+
"format": "uuid",
|
|
654
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
"required": [
|
|
658
|
+
"conversion_id",
|
|
659
|
+
"type"
|
|
660
|
+
],
|
|
661
|
+
"additionalProperties": false
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Opciones de `TrackerConfig.clickRecord`. */
|
|
2
|
+
interface ClickRecordOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Ruta del mismo origen que expone el sitio con `createAdClickRoute`, p. ej. `/api/ad-click`.
|
|
5
|
+
* Una URL de otro origen se ignora (con un aviso en consola): la ruta necesita la cookie de
|
|
6
|
+
* sesión del sitio.
|
|
7
|
+
*/
|
|
8
|
+
endpoint: string;
|
|
9
|
+
/**
|
|
10
|
+
* `true`: solo se registra el click con consentimiento de estadísticas `granted`. Default
|
|
11
|
+
* `false`: se registran todos los clicks, con o sin consentimiento (lo pidió negocio; legal
|
|
12
|
+
* puede pedir activarlo).
|
|
13
|
+
*/
|
|
14
|
+
requireConsent?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Body que el SDK manda a la ruta del sitio por cada `ad_click` (ver docs/protocol.md). */
|
|
17
|
+
interface AdClickRecordPayload {
|
|
18
|
+
/** Versión del payload. */
|
|
19
|
+
v: 1;
|
|
20
|
+
/** El mismo `click_id` del evento `ad_click` (y del `?ipc=`): une el registro con el evento. */
|
|
21
|
+
click_id: string;
|
|
22
|
+
ad_id: string;
|
|
23
|
+
token?: string;
|
|
24
|
+
placement: string;
|
|
25
|
+
position?: number;
|
|
26
|
+
/** Página donde ocurrió el click, saneada igual que `ctx.url` (origin + path + allowlist). */
|
|
27
|
+
page_url: string;
|
|
28
|
+
/** Hora del click según el reloj del cliente (ISO 8601). */
|
|
29
|
+
ts: string;
|
|
30
|
+
}
|
|
31
|
+
export { ClickRecordOptions as n, AdClickRecordPayload as t };
|