@oursprivacy/platform-sdk 1.61.0 → 1.62.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/attribution-reports.d.mts +1400 -0
  12. package/resources/attribution-reports.d.mts.map +1 -0
  13. package/resources/attribution-reports.d.ts +1400 -0
  14. package/resources/attribution-reports.d.ts.map +1 -0
  15. package/resources/attribution-reports.js +116 -0
  16. package/resources/attribution-reports.js.map +1 -0
  17. package/resources/attribution-reports.mjs +112 -0
  18. package/resources/attribution-reports.mjs.map +1 -0
  19. package/resources/experiment-variants.d.mts +84 -93
  20. package/resources/experiment-variants.d.mts.map +1 -1
  21. package/resources/experiment-variants.d.ts +84 -93
  22. package/resources/experiment-variants.d.ts.map +1 -1
  23. package/resources/experiment-variants.js +3 -1
  24. package/resources/experiment-variants.js.map +1 -1
  25. package/resources/experiment-variants.mjs +3 -1
  26. package/resources/experiment-variants.mjs.map +1 -1
  27. package/resources/experiments.d.mts +50 -65
  28. package/resources/experiments.d.mts.map +1 -1
  29. package/resources/experiments.d.ts +50 -65
  30. package/resources/experiments.d.ts.map +1 -1
  31. package/resources/index.d.mts +2 -1
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +2 -1
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/videos.d.mts +17 -5
  40. package/resources/videos.d.mts.map +1 -1
  41. package/resources/videos.d.ts +17 -5
  42. package/resources/videos.d.ts.map +1 -1
  43. package/resources/videos.js +2 -2
  44. package/resources/videos.mjs +2 -2
  45. package/resources/web-scanners.d.mts +84 -32
  46. package/resources/web-scanners.d.mts.map +1 -1
  47. package/resources/web-scanners.d.ts +84 -32
  48. package/resources/web-scanners.d.ts.map +1 -1
  49. package/resources/web-scanners.js +34 -18
  50. package/resources/web-scanners.js.map +1 -1
  51. package/resources/web-scanners.mjs +34 -18
  52. package/resources/web-scanners.mjs.map +1 -1
  53. package/src/client.ts +49 -0
  54. package/src/resources/attribution-reports.ts +2294 -0
  55. package/src/resources/experiment-variants.ts +84 -93
  56. package/src/resources/experiments.ts +50 -65
  57. package/src/resources/index.ts +23 -0
  58. package/src/resources/videos.ts +243 -5
  59. package/src/resources/web-scanners.ts +100 -31
  60. package/src/version.ts +1 -1
  61. package/version.d.mts +1 -1
  62. package/version.d.ts +1 -1
  63. package/version.js +1 -1
  64. package/version.mjs +1 -1
@@ -0,0 +1,2294 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class AttributionReports extends APIResource {
10
+ /**
11
+ * List saved attribution reports in stable ID order with case-insensitive name
12
+ * search. Defaults to 20 results; each request scans at most 100 reports. Search
13
+ * and unavailable or deleted entries can yield short pages. Continue with
14
+ * pagination.nextCursor while hasMore is true and preserve unavailableCount.
15
+ * Requires Analytics Suite access. Requires API-key scope or current OAuth user
16
+ * permission: web-analytics:view
17
+ */
18
+ list(
19
+ query: AttributionReportListParams | null | undefined = {},
20
+ options?: RequestOptions,
21
+ ): PagePromise<AttributionReportListResponsesCursor, AttributionReportListResponse> {
22
+ return this._client.getAPIList('/rest/v1/attribution-reports', Cursor<AttributionReportListResponse>, {
23
+ query,
24
+ ...options,
25
+ });
26
+ }
27
+
28
+ /**
29
+ * Save an attribution report with a default date context and a definition of up to
30
+ * five conversion outcomes, the credit model, counting unit, lookback window, and
31
+ * currency. Use GET /rest/v1/attribution-reports/preview to compute results.
32
+ * Requires Analytics Suite access. Requires API-key scope or current OAuth user
33
+ * permission: web-analytics:write
34
+ */
35
+ create(
36
+ body: AttributionReportCreateParams,
37
+ options?: RequestOptions,
38
+ ): APIPromise<AttributionReportCreateResponse> {
39
+ return this._client.post('/rest/v1/attribution-reports', { body, ...options });
40
+ }
41
+
42
+ /**
43
+ * Get a saved attribution report including its revision, default date context, and
44
+ * attribution definition. Requires Analytics Suite access; unavailable reports
45
+ * return 404. Requires API-key scope or current OAuth user permission:
46
+ * web-analytics:view
47
+ */
48
+ retrieve(id: string, options?: RequestOptions): APIPromise<AttributionReportRetrieveResponse> {
49
+ return this._client.get(path`/rest/v1/attribution-reports/${id}`, options);
50
+ }
51
+
52
+ /**
53
+ * Update an attribution report using expectedRevision. Omitted fields remain
54
+ * unchanged; null clears the description. Supplied reportContext and definition
55
+ * replace the entire saved value. Requires Analytics Suite access. Requires
56
+ * API-key scope or current OAuth user permission: web-analytics:write
57
+ */
58
+ update(
59
+ id: string,
60
+ body: AttributionReportUpdateParams,
61
+ options?: RequestOptions,
62
+ ): APIPromise<AttributionReportUpdateResponse> {
63
+ return this._client.patch(path`/rest/v1/attribution-reports/${id}`, { body, ...options });
64
+ }
65
+
66
+ /**
67
+ * Delete an attribution report using expectedRevision. Requires Analytics Suite
68
+ * access. Requires API-key scope or current OAuth user permission:
69
+ * web-analytics:write
70
+ */
71
+ delete(
72
+ id: string,
73
+ params: AttributionReportDeleteParams,
74
+ options?: RequestOptions,
75
+ ): APIPromise<AttributionReportDeleteResponse> {
76
+ const { expectedRevision } = params;
77
+ return this._client.delete(path`/rest/v1/attribution-reports/${id}`, {
78
+ query: { expectedRevision },
79
+ ...options,
80
+ });
81
+ }
82
+
83
+ /**
84
+ * Duplicate an attribution report using the expectedRevision in the request body.
85
+ * Copies the description, date context, and definition under a new id with
86
+ * "(copy)" appended to the name. Requires Analytics Suite access. Requires API-key
87
+ * scope or current OAuth user permission: web-analytics:write, web-analytics:view
88
+ */
89
+ duplicate(
90
+ id: string,
91
+ body: AttributionReportDuplicateParams,
92
+ options?: RequestOptions,
93
+ ): APIPromise<AttributionReportDuplicateResponse> {
94
+ return this._client.post(path`/rest/v1/attribution-reports/${id}/duplicate`, { body, ...options });
95
+ }
96
+
97
+ /**
98
+ * Compute attribution credit for a saved or draft definition without saving it.
99
+ * JSON-encode input as {definition,from,to,comparison?,interval?}; dates are
100
+ * inclusive UTC calendar strings spanning at most 92 days. Results include a total
101
+ * row, channel, source/medium, campaign, and term breakdowns, and a time series,
102
+ * with credit under every model. Maximum 16384 bytes before URL encoding. Requires
103
+ * Analytics Suite access. Requires API-key scope or current OAuth user permission:
104
+ * web-analytics:view
105
+ */
106
+ preview(
107
+ query: AttributionReportPreviewParams,
108
+ options?: RequestOptions,
109
+ ): APIPromise<AttributionReportPreviewResponse> {
110
+ return this._client.get('/rest/v1/attribution-reports/preview', { query, ...options });
111
+ }
112
+
113
+ /**
114
+ * List the visitors behind one number in an attribution result: an outcome,
115
+ * period, row, touch role (first, last, any, or assist), and optional interval
116
+ * bucket. Send the same definition, dates, comparison, and interval that produced
117
+ * the result. Each visitor includes the credit and value they give that row, their
118
+ * credited first and last touch, conversion time, sessions in the lookback window,
119
+ * and up to three recent session replays. totalUnits equals the first- or
120
+ * last-touch credit for those roles and the row creditedUnits for any. Ordered
121
+ * newest conversion first; continue with pagination.nextCursor while hasMore is
122
+ * true. Requires Analytics Suite access and permission to view visitor data.
123
+ * Requires API-key scope or current OAuth user permission: web-analytics:view,
124
+ * report:view-visitor
125
+ */
126
+ visitors(
127
+ query: AttributionReportVisitorsParams,
128
+ options?: RequestOptions,
129
+ ): APIPromise<AttributionReportVisitorsResponse> {
130
+ return this._client.get('/rest/v1/attribution-reports/visitors', { query, ...options });
131
+ }
132
+
133
+ /**
134
+ * Explain what moved in an attribution result: new sources, campaigns, and terms
135
+ * with credited conversions and no sessions in the prior 180 days; the largest
136
+ * share-adjusted credit changes against the comparison period; channels credited
137
+ * very differently by first and last touch; and rows that went quiet. Takes the
138
+ * same JSON input as the preview. Without a comparison only new values are
139
+ * returned. Returns at most 8 aggregate findings with their baselines and sample
140
+ * sizes, ranked by effect size and not tested for significance. Requires Analytics
141
+ * Suite access. Requires API-key scope or current OAuth user permission:
142
+ * web-analytics:view
143
+ */
144
+ insights(
145
+ query: AttributionReportInsightsParams,
146
+ options?: RequestOptions,
147
+ ): APIPromise<AttributionReportInsightsResponse> {
148
+ return this._client.get('/rest/v1/attribution-reports/insights', { query, ...options });
149
+ }
150
+ }
151
+
152
+ export type AttributionReportListResponsesCursor = Cursor<AttributionReportListResponse>;
153
+
154
+ export interface AttributionReportListResponse {
155
+ id: string;
156
+
157
+ createdAt: string;
158
+
159
+ createdByUserId: string;
160
+
161
+ /**
162
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
163
+ * to ten unique event names, an optional filter, and an optional numeric event
164
+ * property summed as value. Set the credit model (default last_touch), counting
165
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
166
+ * 30), an optional filter applied to every outcome, and the value currency
167
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
168
+ * definition on PATCH.
169
+ */
170
+ definition: AttributionReportListResponse.Definition;
171
+
172
+ /**
173
+ * Display name for the saved attribution report.
174
+ */
175
+ name: string;
176
+
177
+ /**
178
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
179
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
180
+ */
181
+ reportContext: AttributionReportListResponse.ReportContext;
182
+
183
+ revision: string;
184
+
185
+ updatedAt: string;
186
+
187
+ updatedByUserId: string;
188
+
189
+ /**
190
+ * Optional description; null clears it.
191
+ */
192
+ description?: string | null;
193
+ }
194
+
195
+ export namespace AttributionReportListResponse {
196
+ /**
197
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
198
+ * to ten unique event names, an optional filter, and an optional numeric event
199
+ * property summed as value. Set the credit model (default last_touch), counting
200
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
201
+ * 30), an optional filter applied to every outcome, and the value currency
202
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
203
+ * definition on PATCH.
204
+ */
205
+ export interface Definition {
206
+ kind: 'attribution';
207
+
208
+ outcomes: Array<Definition.Outcome>;
209
+
210
+ version: 1;
211
+
212
+ counting?: 'unique' | 'totals' | 'sessions';
213
+
214
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
215
+
216
+ filter?: Definition.Filter;
217
+
218
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
219
+
220
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
221
+ }
222
+
223
+ export namespace Definition {
224
+ export interface Outcome {
225
+ id: string;
226
+
227
+ eventNames: Array<string>;
228
+
229
+ label: string;
230
+
231
+ filter?: Outcome.Filter;
232
+
233
+ value?: Outcome.Value;
234
+ }
235
+
236
+ export namespace Outcome {
237
+ export interface Filter {
238
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
239
+
240
+ version: 1;
241
+ }
242
+
243
+ export namespace Filter {
244
+ export interface UnionMember0 {
245
+ children: Array<unknown>;
246
+
247
+ kind: 'and' | 'or';
248
+ }
249
+
250
+ export interface UnionMember1 {
251
+ child: unknown;
252
+
253
+ kind: 'not';
254
+ }
255
+
256
+ export interface UnionMember2 {
257
+ kind: 'predicate';
258
+
259
+ operator:
260
+ | 'eq'
261
+ | 'neq'
262
+ | 'gt'
263
+ | 'gte'
264
+ | 'lt'
265
+ | 'lte'
266
+ | 'contains'
267
+ | 'not_contains'
268
+ | 'contains_ci'
269
+ | 'not_contains_ci'
270
+ | 'starts_with'
271
+ | 'ends_with'
272
+ | 'in'
273
+ | 'not_in'
274
+ | 'exists'
275
+ | 'missing'
276
+ | 'is_null';
277
+
278
+ property: string;
279
+
280
+ path?: Array<string>;
281
+
282
+ type?: 'string' | 'number' | 'boolean';
283
+
284
+ value?: string | number | boolean | Array<string | number | boolean>;
285
+ }
286
+ }
287
+
288
+ export interface Value {
289
+ path: Array<string>;
290
+
291
+ property: 'event.properties';
292
+
293
+ type?: 'number';
294
+ }
295
+ }
296
+
297
+ export interface Filter {
298
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
299
+
300
+ version: 1;
301
+ }
302
+
303
+ export namespace Filter {
304
+ export interface UnionMember0 {
305
+ children: Array<unknown>;
306
+
307
+ kind: 'and' | 'or';
308
+ }
309
+
310
+ export interface UnionMember1 {
311
+ child: unknown;
312
+
313
+ kind: 'not';
314
+ }
315
+
316
+ export interface UnionMember2 {
317
+ kind: 'predicate';
318
+
319
+ operator:
320
+ | 'eq'
321
+ | 'neq'
322
+ | 'gt'
323
+ | 'gte'
324
+ | 'lt'
325
+ | 'lte'
326
+ | 'contains'
327
+ | 'not_contains'
328
+ | 'contains_ci'
329
+ | 'not_contains_ci'
330
+ | 'starts_with'
331
+ | 'ends_with'
332
+ | 'in'
333
+ | 'not_in'
334
+ | 'exists'
335
+ | 'missing'
336
+ | 'is_null';
337
+
338
+ property: string;
339
+
340
+ path?: Array<string>;
341
+
342
+ type?: 'string' | 'number' | 'boolean';
343
+
344
+ value?: string | number | boolean | Array<string | number | boolean>;
345
+ }
346
+ }
347
+ }
348
+
349
+ /**
350
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
351
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
352
+ */
353
+ export interface ReportContext {
354
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
355
+ }
356
+
357
+ export namespace ReportContext {
358
+ export interface UnionMember0 {
359
+ from: string;
360
+
361
+ to: string;
362
+
363
+ timeZone?: 'UTC';
364
+ }
365
+
366
+ export interface UnionMember1 {
367
+ preset:
368
+ | 'today'
369
+ | 'yesterday'
370
+ | 'last_7_days'
371
+ | 'last_30_days'
372
+ | 'last_90_days'
373
+ | 'last_12_months'
374
+ | 'week_to_date'
375
+ | 'month_to_date'
376
+ | 'year_to_date';
377
+
378
+ timeZone?: 'UTC';
379
+ }
380
+ }
381
+ }
382
+
383
+ export interface AttributionReportCreateResponse {
384
+ id: string;
385
+
386
+ createdAt: string;
387
+
388
+ createdByUserId: string;
389
+
390
+ /**
391
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
392
+ * to ten unique event names, an optional filter, and an optional numeric event
393
+ * property summed as value. Set the credit model (default last_touch), counting
394
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
395
+ * 30), an optional filter applied to every outcome, and the value currency
396
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
397
+ * definition on PATCH.
398
+ */
399
+ definition: AttributionReportCreateResponse.Definition;
400
+
401
+ /**
402
+ * Display name for the saved attribution report.
403
+ */
404
+ name: string;
405
+
406
+ /**
407
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
408
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
409
+ */
410
+ reportContext: AttributionReportCreateResponse.ReportContext;
411
+
412
+ revision: string;
413
+
414
+ updatedAt: string;
415
+
416
+ updatedByUserId: string;
417
+
418
+ /**
419
+ * Optional description; null clears it.
420
+ */
421
+ description?: string | null;
422
+ }
423
+
424
+ export namespace AttributionReportCreateResponse {
425
+ /**
426
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
427
+ * to ten unique event names, an optional filter, and an optional numeric event
428
+ * property summed as value. Set the credit model (default last_touch), counting
429
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
430
+ * 30), an optional filter applied to every outcome, and the value currency
431
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
432
+ * definition on PATCH.
433
+ */
434
+ export interface Definition {
435
+ kind: 'attribution';
436
+
437
+ outcomes: Array<Definition.Outcome>;
438
+
439
+ version: 1;
440
+
441
+ counting?: 'unique' | 'totals' | 'sessions';
442
+
443
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
444
+
445
+ filter?: Definition.Filter;
446
+
447
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
448
+
449
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
450
+ }
451
+
452
+ export namespace Definition {
453
+ export interface Outcome {
454
+ id: string;
455
+
456
+ eventNames: Array<string>;
457
+
458
+ label: string;
459
+
460
+ filter?: Outcome.Filter;
461
+
462
+ value?: Outcome.Value;
463
+ }
464
+
465
+ export namespace Outcome {
466
+ export interface Filter {
467
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
468
+
469
+ version: 1;
470
+ }
471
+
472
+ export namespace Filter {
473
+ export interface UnionMember0 {
474
+ children: Array<unknown>;
475
+
476
+ kind: 'and' | 'or';
477
+ }
478
+
479
+ export interface UnionMember1 {
480
+ child: unknown;
481
+
482
+ kind: 'not';
483
+ }
484
+
485
+ export interface UnionMember2 {
486
+ kind: 'predicate';
487
+
488
+ operator:
489
+ | 'eq'
490
+ | 'neq'
491
+ | 'gt'
492
+ | 'gte'
493
+ | 'lt'
494
+ | 'lte'
495
+ | 'contains'
496
+ | 'not_contains'
497
+ | 'contains_ci'
498
+ | 'not_contains_ci'
499
+ | 'starts_with'
500
+ | 'ends_with'
501
+ | 'in'
502
+ | 'not_in'
503
+ | 'exists'
504
+ | 'missing'
505
+ | 'is_null';
506
+
507
+ property: string;
508
+
509
+ path?: Array<string>;
510
+
511
+ type?: 'string' | 'number' | 'boolean';
512
+
513
+ value?: string | number | boolean | Array<string | number | boolean>;
514
+ }
515
+ }
516
+
517
+ export interface Value {
518
+ path: Array<string>;
519
+
520
+ property: 'event.properties';
521
+
522
+ type?: 'number';
523
+ }
524
+ }
525
+
526
+ export interface Filter {
527
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
528
+
529
+ version: 1;
530
+ }
531
+
532
+ export namespace Filter {
533
+ export interface UnionMember0 {
534
+ children: Array<unknown>;
535
+
536
+ kind: 'and' | 'or';
537
+ }
538
+
539
+ export interface UnionMember1 {
540
+ child: unknown;
541
+
542
+ kind: 'not';
543
+ }
544
+
545
+ export interface UnionMember2 {
546
+ kind: 'predicate';
547
+
548
+ operator:
549
+ | 'eq'
550
+ | 'neq'
551
+ | 'gt'
552
+ | 'gte'
553
+ | 'lt'
554
+ | 'lte'
555
+ | 'contains'
556
+ | 'not_contains'
557
+ | 'contains_ci'
558
+ | 'not_contains_ci'
559
+ | 'starts_with'
560
+ | 'ends_with'
561
+ | 'in'
562
+ | 'not_in'
563
+ | 'exists'
564
+ | 'missing'
565
+ | 'is_null';
566
+
567
+ property: string;
568
+
569
+ path?: Array<string>;
570
+
571
+ type?: 'string' | 'number' | 'boolean';
572
+
573
+ value?: string | number | boolean | Array<string | number | boolean>;
574
+ }
575
+ }
576
+ }
577
+
578
+ /**
579
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
580
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
581
+ */
582
+ export interface ReportContext {
583
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
584
+ }
585
+
586
+ export namespace ReportContext {
587
+ export interface UnionMember0 {
588
+ from: string;
589
+
590
+ to: string;
591
+
592
+ timeZone?: 'UTC';
593
+ }
594
+
595
+ export interface UnionMember1 {
596
+ preset:
597
+ | 'today'
598
+ | 'yesterday'
599
+ | 'last_7_days'
600
+ | 'last_30_days'
601
+ | 'last_90_days'
602
+ | 'last_12_months'
603
+ | 'week_to_date'
604
+ | 'month_to_date'
605
+ | 'year_to_date';
606
+
607
+ timeZone?: 'UTC';
608
+ }
609
+ }
610
+ }
611
+
612
+ export interface AttributionReportRetrieveResponse {
613
+ id: string;
614
+
615
+ createdAt: string;
616
+
617
+ createdByUserId: string;
618
+
619
+ /**
620
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
621
+ * to ten unique event names, an optional filter, and an optional numeric event
622
+ * property summed as value. Set the credit model (default last_touch), counting
623
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
624
+ * 30), an optional filter applied to every outcome, and the value currency
625
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
626
+ * definition on PATCH.
627
+ */
628
+ definition: AttributionReportRetrieveResponse.Definition;
629
+
630
+ /**
631
+ * Display name for the saved attribution report.
632
+ */
633
+ name: string;
634
+
635
+ /**
636
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
637
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
638
+ */
639
+ reportContext: AttributionReportRetrieveResponse.ReportContext;
640
+
641
+ revision: string;
642
+
643
+ updatedAt: string;
644
+
645
+ updatedByUserId: string;
646
+
647
+ /**
648
+ * Optional description; null clears it.
649
+ */
650
+ description?: string | null;
651
+ }
652
+
653
+ export namespace AttributionReportRetrieveResponse {
654
+ /**
655
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
656
+ * to ten unique event names, an optional filter, and an optional numeric event
657
+ * property summed as value. Set the credit model (default last_touch), counting
658
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
659
+ * 30), an optional filter applied to every outcome, and the value currency
660
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
661
+ * definition on PATCH.
662
+ */
663
+ export interface Definition {
664
+ kind: 'attribution';
665
+
666
+ outcomes: Array<Definition.Outcome>;
667
+
668
+ version: 1;
669
+
670
+ counting?: 'unique' | 'totals' | 'sessions';
671
+
672
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
673
+
674
+ filter?: Definition.Filter;
675
+
676
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
677
+
678
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
679
+ }
680
+
681
+ export namespace Definition {
682
+ export interface Outcome {
683
+ id: string;
684
+
685
+ eventNames: Array<string>;
686
+
687
+ label: string;
688
+
689
+ filter?: Outcome.Filter;
690
+
691
+ value?: Outcome.Value;
692
+ }
693
+
694
+ export namespace Outcome {
695
+ export interface Filter {
696
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
697
+
698
+ version: 1;
699
+ }
700
+
701
+ export namespace Filter {
702
+ export interface UnionMember0 {
703
+ children: Array<unknown>;
704
+
705
+ kind: 'and' | 'or';
706
+ }
707
+
708
+ export interface UnionMember1 {
709
+ child: unknown;
710
+
711
+ kind: 'not';
712
+ }
713
+
714
+ export interface UnionMember2 {
715
+ kind: 'predicate';
716
+
717
+ operator:
718
+ | 'eq'
719
+ | 'neq'
720
+ | 'gt'
721
+ | 'gte'
722
+ | 'lt'
723
+ | 'lte'
724
+ | 'contains'
725
+ | 'not_contains'
726
+ | 'contains_ci'
727
+ | 'not_contains_ci'
728
+ | 'starts_with'
729
+ | 'ends_with'
730
+ | 'in'
731
+ | 'not_in'
732
+ | 'exists'
733
+ | 'missing'
734
+ | 'is_null';
735
+
736
+ property: string;
737
+
738
+ path?: Array<string>;
739
+
740
+ type?: 'string' | 'number' | 'boolean';
741
+
742
+ value?: string | number | boolean | Array<string | number | boolean>;
743
+ }
744
+ }
745
+
746
+ export interface Value {
747
+ path: Array<string>;
748
+
749
+ property: 'event.properties';
750
+
751
+ type?: 'number';
752
+ }
753
+ }
754
+
755
+ export interface Filter {
756
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
757
+
758
+ version: 1;
759
+ }
760
+
761
+ export namespace Filter {
762
+ export interface UnionMember0 {
763
+ children: Array<unknown>;
764
+
765
+ kind: 'and' | 'or';
766
+ }
767
+
768
+ export interface UnionMember1 {
769
+ child: unknown;
770
+
771
+ kind: 'not';
772
+ }
773
+
774
+ export interface UnionMember2 {
775
+ kind: 'predicate';
776
+
777
+ operator:
778
+ | 'eq'
779
+ | 'neq'
780
+ | 'gt'
781
+ | 'gte'
782
+ | 'lt'
783
+ | 'lte'
784
+ | 'contains'
785
+ | 'not_contains'
786
+ | 'contains_ci'
787
+ | 'not_contains_ci'
788
+ | 'starts_with'
789
+ | 'ends_with'
790
+ | 'in'
791
+ | 'not_in'
792
+ | 'exists'
793
+ | 'missing'
794
+ | 'is_null';
795
+
796
+ property: string;
797
+
798
+ path?: Array<string>;
799
+
800
+ type?: 'string' | 'number' | 'boolean';
801
+
802
+ value?: string | number | boolean | Array<string | number | boolean>;
803
+ }
804
+ }
805
+ }
806
+
807
+ /**
808
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
809
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
810
+ */
811
+ export interface ReportContext {
812
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
813
+ }
814
+
815
+ export namespace ReportContext {
816
+ export interface UnionMember0 {
817
+ from: string;
818
+
819
+ to: string;
820
+
821
+ timeZone?: 'UTC';
822
+ }
823
+
824
+ export interface UnionMember1 {
825
+ preset:
826
+ | 'today'
827
+ | 'yesterday'
828
+ | 'last_7_days'
829
+ | 'last_30_days'
830
+ | 'last_90_days'
831
+ | 'last_12_months'
832
+ | 'week_to_date'
833
+ | 'month_to_date'
834
+ | 'year_to_date';
835
+
836
+ timeZone?: 'UTC';
837
+ }
838
+ }
839
+ }
840
+
841
+ export interface AttributionReportUpdateResponse {
842
+ id: string;
843
+
844
+ createdAt: string;
845
+
846
+ createdByUserId: string;
847
+
848
+ /**
849
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
850
+ * to ten unique event names, an optional filter, and an optional numeric event
851
+ * property summed as value. Set the credit model (default last_touch), counting
852
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
853
+ * 30), an optional filter applied to every outcome, and the value currency
854
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
855
+ * definition on PATCH.
856
+ */
857
+ definition: AttributionReportUpdateResponse.Definition;
858
+
859
+ /**
860
+ * Display name for the saved attribution report.
861
+ */
862
+ name: string;
863
+
864
+ /**
865
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
866
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
867
+ */
868
+ reportContext: AttributionReportUpdateResponse.ReportContext;
869
+
870
+ revision: string;
871
+
872
+ updatedAt: string;
873
+
874
+ updatedByUserId: string;
875
+
876
+ /**
877
+ * Optional description; null clears it.
878
+ */
879
+ description?: string | null;
880
+ }
881
+
882
+ export namespace AttributionReportUpdateResponse {
883
+ /**
884
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
885
+ * to ten unique event names, an optional filter, and an optional numeric event
886
+ * property summed as value. Set the credit model (default last_touch), counting
887
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
888
+ * 30), an optional filter applied to every outcome, and the value currency
889
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
890
+ * definition on PATCH.
891
+ */
892
+ export interface Definition {
893
+ kind: 'attribution';
894
+
895
+ outcomes: Array<Definition.Outcome>;
896
+
897
+ version: 1;
898
+
899
+ counting?: 'unique' | 'totals' | 'sessions';
900
+
901
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
902
+
903
+ filter?: Definition.Filter;
904
+
905
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
906
+
907
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
908
+ }
909
+
910
+ export namespace Definition {
911
+ export interface Outcome {
912
+ id: string;
913
+
914
+ eventNames: Array<string>;
915
+
916
+ label: string;
917
+
918
+ filter?: Outcome.Filter;
919
+
920
+ value?: Outcome.Value;
921
+ }
922
+
923
+ export namespace Outcome {
924
+ export interface Filter {
925
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
926
+
927
+ version: 1;
928
+ }
929
+
930
+ export namespace Filter {
931
+ export interface UnionMember0 {
932
+ children: Array<unknown>;
933
+
934
+ kind: 'and' | 'or';
935
+ }
936
+
937
+ export interface UnionMember1 {
938
+ child: unknown;
939
+
940
+ kind: 'not';
941
+ }
942
+
943
+ export interface UnionMember2 {
944
+ kind: 'predicate';
945
+
946
+ operator:
947
+ | 'eq'
948
+ | 'neq'
949
+ | 'gt'
950
+ | 'gte'
951
+ | 'lt'
952
+ | 'lte'
953
+ | 'contains'
954
+ | 'not_contains'
955
+ | 'contains_ci'
956
+ | 'not_contains_ci'
957
+ | 'starts_with'
958
+ | 'ends_with'
959
+ | 'in'
960
+ | 'not_in'
961
+ | 'exists'
962
+ | 'missing'
963
+ | 'is_null';
964
+
965
+ property: string;
966
+
967
+ path?: Array<string>;
968
+
969
+ type?: 'string' | 'number' | 'boolean';
970
+
971
+ value?: string | number | boolean | Array<string | number | boolean>;
972
+ }
973
+ }
974
+
975
+ export interface Value {
976
+ path: Array<string>;
977
+
978
+ property: 'event.properties';
979
+
980
+ type?: 'number';
981
+ }
982
+ }
983
+
984
+ export interface Filter {
985
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
986
+
987
+ version: 1;
988
+ }
989
+
990
+ export namespace Filter {
991
+ export interface UnionMember0 {
992
+ children: Array<unknown>;
993
+
994
+ kind: 'and' | 'or';
995
+ }
996
+
997
+ export interface UnionMember1 {
998
+ child: unknown;
999
+
1000
+ kind: 'not';
1001
+ }
1002
+
1003
+ export interface UnionMember2 {
1004
+ kind: 'predicate';
1005
+
1006
+ operator:
1007
+ | 'eq'
1008
+ | 'neq'
1009
+ | 'gt'
1010
+ | 'gte'
1011
+ | 'lt'
1012
+ | 'lte'
1013
+ | 'contains'
1014
+ | 'not_contains'
1015
+ | 'contains_ci'
1016
+ | 'not_contains_ci'
1017
+ | 'starts_with'
1018
+ | 'ends_with'
1019
+ | 'in'
1020
+ | 'not_in'
1021
+ | 'exists'
1022
+ | 'missing'
1023
+ | 'is_null';
1024
+
1025
+ property: string;
1026
+
1027
+ path?: Array<string>;
1028
+
1029
+ type?: 'string' | 'number' | 'boolean';
1030
+
1031
+ value?: string | number | boolean | Array<string | number | boolean>;
1032
+ }
1033
+ }
1034
+ }
1035
+
1036
+ /**
1037
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
1038
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
1039
+ */
1040
+ export interface ReportContext {
1041
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
1042
+ }
1043
+
1044
+ export namespace ReportContext {
1045
+ export interface UnionMember0 {
1046
+ from: string;
1047
+
1048
+ to: string;
1049
+
1050
+ timeZone?: 'UTC';
1051
+ }
1052
+
1053
+ export interface UnionMember1 {
1054
+ preset:
1055
+ | 'today'
1056
+ | 'yesterday'
1057
+ | 'last_7_days'
1058
+ | 'last_30_days'
1059
+ | 'last_90_days'
1060
+ | 'last_12_months'
1061
+ | 'week_to_date'
1062
+ | 'month_to_date'
1063
+ | 'year_to_date';
1064
+
1065
+ timeZone?: 'UTC';
1066
+ }
1067
+ }
1068
+ }
1069
+
1070
+ export interface AttributionReportDeleteResponse {
1071
+ id: string;
1072
+
1073
+ deleted: true;
1074
+
1075
+ deletedRevision: string;
1076
+ }
1077
+
1078
+ export interface AttributionReportDuplicateResponse {
1079
+ id: string;
1080
+
1081
+ createdAt: string;
1082
+
1083
+ createdByUserId: string;
1084
+
1085
+ /**
1086
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
1087
+ * to ten unique event names, an optional filter, and an optional numeric event
1088
+ * property summed as value. Set the credit model (default last_touch), counting
1089
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
1090
+ * 30), an optional filter applied to every outcome, and the value currency
1091
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
1092
+ * definition on PATCH.
1093
+ */
1094
+ definition: AttributionReportDuplicateResponse.Definition;
1095
+
1096
+ /**
1097
+ * Display name for the saved attribution report.
1098
+ */
1099
+ name: string;
1100
+
1101
+ /**
1102
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
1103
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
1104
+ */
1105
+ reportContext: AttributionReportDuplicateResponse.ReportContext;
1106
+
1107
+ revision: string;
1108
+
1109
+ updatedAt: string;
1110
+
1111
+ updatedByUserId: string;
1112
+
1113
+ /**
1114
+ * Optional description; null clears it.
1115
+ */
1116
+ description?: string | null;
1117
+ }
1118
+
1119
+ export namespace AttributionReportDuplicateResponse {
1120
+ /**
1121
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
1122
+ * to ten unique event names, an optional filter, and an optional numeric event
1123
+ * property summed as value. Set the credit model (default last_touch), counting
1124
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
1125
+ * 30), an optional filter applied to every outcome, and the value currency
1126
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
1127
+ * definition on PATCH.
1128
+ */
1129
+ export interface Definition {
1130
+ kind: 'attribution';
1131
+
1132
+ outcomes: Array<Definition.Outcome>;
1133
+
1134
+ version: 1;
1135
+
1136
+ counting?: 'unique' | 'totals' | 'sessions';
1137
+
1138
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
1139
+
1140
+ filter?: Definition.Filter;
1141
+
1142
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
1143
+
1144
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
1145
+ }
1146
+
1147
+ export namespace Definition {
1148
+ export interface Outcome {
1149
+ id: string;
1150
+
1151
+ eventNames: Array<string>;
1152
+
1153
+ label: string;
1154
+
1155
+ filter?: Outcome.Filter;
1156
+
1157
+ value?: Outcome.Value;
1158
+ }
1159
+
1160
+ export namespace Outcome {
1161
+ export interface Filter {
1162
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
1163
+
1164
+ version: 1;
1165
+ }
1166
+
1167
+ export namespace Filter {
1168
+ export interface UnionMember0 {
1169
+ children: Array<unknown>;
1170
+
1171
+ kind: 'and' | 'or';
1172
+ }
1173
+
1174
+ export interface UnionMember1 {
1175
+ child: unknown;
1176
+
1177
+ kind: 'not';
1178
+ }
1179
+
1180
+ export interface UnionMember2 {
1181
+ kind: 'predicate';
1182
+
1183
+ operator:
1184
+ | 'eq'
1185
+ | 'neq'
1186
+ | 'gt'
1187
+ | 'gte'
1188
+ | 'lt'
1189
+ | 'lte'
1190
+ | 'contains'
1191
+ | 'not_contains'
1192
+ | 'contains_ci'
1193
+ | 'not_contains_ci'
1194
+ | 'starts_with'
1195
+ | 'ends_with'
1196
+ | 'in'
1197
+ | 'not_in'
1198
+ | 'exists'
1199
+ | 'missing'
1200
+ | 'is_null';
1201
+
1202
+ property: string;
1203
+
1204
+ path?: Array<string>;
1205
+
1206
+ type?: 'string' | 'number' | 'boolean';
1207
+
1208
+ value?: string | number | boolean | Array<string | number | boolean>;
1209
+ }
1210
+ }
1211
+
1212
+ export interface Value {
1213
+ path: Array<string>;
1214
+
1215
+ property: 'event.properties';
1216
+
1217
+ type?: 'number';
1218
+ }
1219
+ }
1220
+
1221
+ export interface Filter {
1222
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
1223
+
1224
+ version: 1;
1225
+ }
1226
+
1227
+ export namespace Filter {
1228
+ export interface UnionMember0 {
1229
+ children: Array<unknown>;
1230
+
1231
+ kind: 'and' | 'or';
1232
+ }
1233
+
1234
+ export interface UnionMember1 {
1235
+ child: unknown;
1236
+
1237
+ kind: 'not';
1238
+ }
1239
+
1240
+ export interface UnionMember2 {
1241
+ kind: 'predicate';
1242
+
1243
+ operator:
1244
+ | 'eq'
1245
+ | 'neq'
1246
+ | 'gt'
1247
+ | 'gte'
1248
+ | 'lt'
1249
+ | 'lte'
1250
+ | 'contains'
1251
+ | 'not_contains'
1252
+ | 'contains_ci'
1253
+ | 'not_contains_ci'
1254
+ | 'starts_with'
1255
+ | 'ends_with'
1256
+ | 'in'
1257
+ | 'not_in'
1258
+ | 'exists'
1259
+ | 'missing'
1260
+ | 'is_null';
1261
+
1262
+ property: string;
1263
+
1264
+ path?: Array<string>;
1265
+
1266
+ type?: 'string' | 'number' | 'boolean';
1267
+
1268
+ value?: string | number | boolean | Array<string | number | boolean>;
1269
+ }
1270
+ }
1271
+ }
1272
+
1273
+ /**
1274
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
1275
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
1276
+ */
1277
+ export interface ReportContext {
1278
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
1279
+ }
1280
+
1281
+ export namespace ReportContext {
1282
+ export interface UnionMember0 {
1283
+ from: string;
1284
+
1285
+ to: string;
1286
+
1287
+ timeZone?: 'UTC';
1288
+ }
1289
+
1290
+ export interface UnionMember1 {
1291
+ preset:
1292
+ | 'today'
1293
+ | 'yesterday'
1294
+ | 'last_7_days'
1295
+ | 'last_30_days'
1296
+ | 'last_90_days'
1297
+ | 'last_12_months'
1298
+ | 'week_to_date'
1299
+ | 'month_to_date'
1300
+ | 'year_to_date';
1301
+
1302
+ timeZone?: 'UTC';
1303
+ }
1304
+ }
1305
+ }
1306
+
1307
+ export interface AttributionReportPreviewResponse {
1308
+ channelRulesVersion: number;
1309
+
1310
+ computedAt: string;
1311
+
1312
+ counting: 'unique' | 'totals' | 'sessions';
1313
+
1314
+ from: string;
1315
+
1316
+ interval: 'day' | 'week';
1317
+
1318
+ /**
1319
+ * True when more breakdown rows matched than the response returns; the total row
1320
+ * is always complete.
1321
+ */
1322
+ isTruncated: boolean;
1323
+
1324
+ /**
1325
+ * Time-series credit per bucket, period, and outcome; channel is null for the
1326
+ * all-channel series.
1327
+ */
1328
+ points: Array<AttributionReportPreviewResponse.Point>;
1329
+
1330
+ /**
1331
+ * Inclusive comparison start date; null without a comparison.
1332
+ */
1333
+ previousFrom: string | null;
1334
+
1335
+ /**
1336
+ * Inclusive comparison end date; null without a comparison.
1337
+ */
1338
+ previousTo: string | null;
1339
+
1340
+ /**
1341
+ * The total row followed by channel, source/medium, campaign, and term breakdown
1342
+ * rows, ordered by current-period credit under the selected model.
1343
+ */
1344
+ rows: Array<AttributionReportPreviewResponse.Row>;
1345
+
1346
+ to: string;
1347
+ }
1348
+
1349
+ export namespace AttributionReportPreviewResponse {
1350
+ export interface Point {
1351
+ bucket: string;
1352
+
1353
+ channel: string | null;
1354
+
1355
+ /**
1356
+ * Credit under every model, keyed by model name, for this bucket.
1357
+ */
1358
+ credit: Point.Credit;
1359
+
1360
+ outcomeId: string;
1361
+
1362
+ period: 'current' | 'previous';
1363
+
1364
+ /**
1365
+ * Attributed value under every model for this bucket; null when the outcome has no
1366
+ * value property.
1367
+ */
1368
+ value: Point.Value | null;
1369
+ }
1370
+
1371
+ export namespace Point {
1372
+ /**
1373
+ * Credit under every model, keyed by model name, for this bucket.
1374
+ */
1375
+ export interface Credit {
1376
+ first_touch: number;
1377
+
1378
+ j_shaped: number;
1379
+
1380
+ last_touch: number;
1381
+
1382
+ linear: number;
1383
+
1384
+ time_decay: number;
1385
+
1386
+ u_shaped: number;
1387
+ }
1388
+
1389
+ /**
1390
+ * Attributed value under every model for this bucket; null when the outcome has no
1391
+ * value property.
1392
+ */
1393
+ export interface Value {
1394
+ first_touch: number;
1395
+
1396
+ j_shaped: number;
1397
+
1398
+ last_touch: number;
1399
+
1400
+ linear: number;
1401
+
1402
+ time_decay: number;
1403
+
1404
+ u_shaped: number;
1405
+ }
1406
+ }
1407
+
1408
+ export interface Row {
1409
+ campaign: string | null;
1410
+
1411
+ /**
1412
+ * One cell per outcome and period, current period first, in outcome order.
1413
+ */
1414
+ cells: Array<Row.Cell>;
1415
+
1416
+ channel: string | null;
1417
+
1418
+ grain: 'total' | 'channel' | 'source_medium' | 'campaign' | 'term';
1419
+
1420
+ sourceMedium: string | null;
1421
+
1422
+ term: string | null;
1423
+ }
1424
+
1425
+ export namespace Row {
1426
+ export interface Cell {
1427
+ assistedVisitors: number;
1428
+
1429
+ /**
1430
+ * Credit under every model, keyed by model name, in the definition counting unit.
1431
+ * Compare models without recomputing.
1432
+ */
1433
+ credit: Cell.Credit;
1434
+
1435
+ creditedUnits: number;
1436
+
1437
+ medianDaysToConvert: number | null;
1438
+
1439
+ outcomeId: string;
1440
+
1441
+ period: 'current' | 'previous';
1442
+
1443
+ /**
1444
+ * Attributed value under every model, in the definition currency; null when the
1445
+ * outcome has no value property.
1446
+ */
1447
+ value: Cell.Value | null;
1448
+ }
1449
+
1450
+ export namespace Cell {
1451
+ /**
1452
+ * Credit under every model, keyed by model name, in the definition counting unit.
1453
+ * Compare models without recomputing.
1454
+ */
1455
+ export interface Credit {
1456
+ first_touch: number;
1457
+
1458
+ j_shaped: number;
1459
+
1460
+ last_touch: number;
1461
+
1462
+ linear: number;
1463
+
1464
+ time_decay: number;
1465
+
1466
+ u_shaped: number;
1467
+ }
1468
+
1469
+ /**
1470
+ * Attributed value under every model, in the definition currency; null when the
1471
+ * outcome has no value property.
1472
+ */
1473
+ export interface Value {
1474
+ first_touch: number;
1475
+
1476
+ j_shaped: number;
1477
+
1478
+ last_touch: number;
1479
+
1480
+ linear: number;
1481
+
1482
+ time_decay: number;
1483
+
1484
+ u_shaped: number;
1485
+ }
1486
+ }
1487
+ }
1488
+ }
1489
+
1490
+ export interface AttributionReportVisitorsResponse {
1491
+ /**
1492
+ * Visitors ordered by latest matching conversion, newest first, then visitor id.
1493
+ */
1494
+ entities: Array<AttributionReportVisitorsResponse.Entity>;
1495
+
1496
+ pagination: AttributionReportVisitorsResponse.Pagination;
1497
+
1498
+ /**
1499
+ * Visitors behind the selection.
1500
+ */
1501
+ totalCount: number;
1502
+
1503
+ /**
1504
+ * Counted units behind the selection. Equals the first- or last-touch credit for
1505
+ * those roles and the row's creditedUnits for any.
1506
+ */
1507
+ totalUnits: number;
1508
+ }
1509
+
1510
+ export namespace AttributionReportVisitorsResponse {
1511
+ export interface Entity {
1512
+ /**
1513
+ * When the latest matching conversion happened (UTC).
1514
+ */
1515
+ convertedAt: string;
1516
+
1517
+ /**
1518
+ * Credit this visitor gives the selected row under the definition's model.
1519
+ */
1520
+ credit: number;
1521
+
1522
+ /**
1523
+ * The credited first touch of the latest matching conversion; null when it had no
1524
+ * eligible touch.
1525
+ */
1526
+ firstTouch: Entity.FirstTouch | null;
1527
+
1528
+ /**
1529
+ * The credited last touch of the latest matching conversion; null when it had no
1530
+ * eligible touch.
1531
+ */
1532
+ lastTouch: Entity.LastTouch | null;
1533
+
1534
+ /**
1535
+ * Up to three recorded sessions from the matching lookback windows, newest first,
1536
+ * within session replay retention.
1537
+ */
1538
+ latestReplays: Array<Entity.LatestReplay>;
1539
+
1540
+ /**
1541
+ * Sessions in the latest matching conversion's lookback window.
1542
+ */
1543
+ sessionCount: number;
1544
+
1545
+ /**
1546
+ * Matching conversions (totals counting) or converting sessions (sessions
1547
+ * counting); always 1 under unique counting.
1548
+ */
1549
+ units: number;
1550
+
1551
+ /**
1552
+ * Value this visitor credits to the selected row under the definition's model;
1553
+ * null when the outcome has no value property.
1554
+ */
1555
+ value: number | null;
1556
+
1557
+ visitorId: string;
1558
+ }
1559
+
1560
+ export namespace Entity {
1561
+ /**
1562
+ * The credited first touch of the latest matching conversion; null when it had no
1563
+ * eligible touch.
1564
+ */
1565
+ export interface FirstTouch {
1566
+ at: string;
1567
+
1568
+ campaign: string;
1569
+
1570
+ channel: string;
1571
+
1572
+ sessionId: string;
1573
+
1574
+ sourceMedium: string;
1575
+
1576
+ term: string;
1577
+ }
1578
+
1579
+ /**
1580
+ * The credited last touch of the latest matching conversion; null when it had no
1581
+ * eligible touch.
1582
+ */
1583
+ export interface LastTouch {
1584
+ at: string;
1585
+
1586
+ campaign: string;
1587
+
1588
+ channel: string;
1589
+
1590
+ sessionId: string;
1591
+
1592
+ sourceMedium: string;
1593
+
1594
+ term: string;
1595
+ }
1596
+
1597
+ export interface LatestReplay {
1598
+ date: string;
1599
+
1600
+ sessionId: string;
1601
+
1602
+ startedAt: string;
1603
+ }
1604
+ }
1605
+
1606
+ export interface Pagination {
1607
+ hasMore: boolean;
1608
+
1609
+ nextCursor: string | null;
1610
+ }
1611
+ }
1612
+
1613
+ export interface AttributionReportInsightsResponse {
1614
+ computedAt: string;
1615
+
1616
+ counting: 'unique' | 'totals' | 'sessions';
1617
+
1618
+ from: string;
1619
+
1620
+ /**
1621
+ * At most 8 findings, most notable first, one per row. Aggregates only; no visitor
1622
+ * identifiers.
1623
+ */
1624
+ insights: Array<AttributionReportInsightsResponse.Insight>;
1625
+
1626
+ model: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
1627
+
1628
+ /**
1629
+ * A value is new when it had no sessions in this many days before from.
1630
+ */
1631
+ newValueLookbackDays: number;
1632
+
1633
+ /**
1634
+ * Inclusive comparison start date; null without a comparison.
1635
+ */
1636
+ previousFrom: string | null;
1637
+
1638
+ /**
1639
+ * Inclusive comparison end date; null without a comparison.
1640
+ */
1641
+ previousTo: string | null;
1642
+
1643
+ to: string;
1644
+ }
1645
+
1646
+ export namespace AttributionReportInsightsResponse {
1647
+ export interface Insight {
1648
+ /**
1649
+ * Stable identifier for the same input, made of the kind, outcome, and row.
1650
+ */
1651
+ id: string;
1652
+
1653
+ /**
1654
+ * The number current is compared with; see baselineKind.
1655
+ */
1656
+ baseline: number;
1657
+
1658
+ /**
1659
+ * previous_period: baseline is the same model in the comparison period.
1660
+ * other_model: baseline is baselineModel in the current period. lookback: baseline
1661
+ * is the number of sessions with the value before the range, always 0.
1662
+ */
1663
+ baselineKind: 'previous_period' | 'other_model' | 'lookback';
1664
+
1665
+ baselineModel: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
1666
+
1667
+ /**
1668
+ * The row's share of the outcome's baseline credit; null for new values.
1669
+ */
1670
+ baselineShare: number | null;
1671
+
1672
+ /**
1673
+ * Relative change from baseline; null when the baseline is 0.
1674
+ */
1675
+ change: number | null;
1676
+
1677
+ /**
1678
+ * Credit in the current period under model, in the definition counting unit.
1679
+ */
1680
+ current: number;
1681
+
1682
+ /**
1683
+ * The row's share of the outcome's current credit; null when the outcome has none.
1684
+ */
1685
+ currentShare: number | null;
1686
+
1687
+ /**
1688
+ * current minus baseline.
1689
+ */
1690
+ delta: number;
1691
+
1692
+ /**
1693
+ * Child rows that together explain most of a move, largest first.
1694
+ */
1695
+ drivers: Array<string>;
1696
+
1697
+ /**
1698
+ * Always descriptive: findings are ranked by effect size above minimum volumes and
1699
+ * are not tested for significance.
1700
+ */
1701
+ evidence: 'descriptive';
1702
+
1703
+ /**
1704
+ * First session date with the new value; new_value only.
1705
+ */
1706
+ firstSeen: string | null;
1707
+
1708
+ /**
1709
+ * new_value: a source / medium, campaign, or term with credited conversions and no
1710
+ * sessions in the lookback before the range. mover_up / mover_down: the largest
1711
+ * share-adjusted credit changes against the comparison period. model_disagreement:
1712
+ * a channel or source / medium credited at least twice as much by last touch as by
1713
+ * first touch, or the reverse. went_quiet: a row that had credit in the comparison
1714
+ * period and almost none now.
1715
+ */
1716
+ kind: 'new_value' | 'mover_up' | 'mover_down' | 'model_disagreement' | 'went_quiet';
1717
+
1718
+ /**
1719
+ * Credit model of current.
1720
+ */
1721
+ model: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
1722
+
1723
+ /**
1724
+ * Relative change of the outcome's total credit, so a row's move can be read
1725
+ * against the account's.
1726
+ */
1727
+ outcomeChange: number | null;
1728
+
1729
+ /**
1730
+ * Outcome id from the definition the numbers belong to.
1731
+ */
1732
+ outcomeId: string;
1733
+
1734
+ /**
1735
+ * Counted units with a touch on this row in the comparison period; null without
1736
+ * one.
1737
+ */
1738
+ previousSampleUnits: number | null;
1739
+
1740
+ /**
1741
+ * The breakdown row the finding is about; matches a preview row by grain, channel,
1742
+ * sourceMedium, campaign, and term.
1743
+ */
1744
+ row: Insight.Row;
1745
+
1746
+ /**
1747
+ * Sessions with the new value in the range; new_value only.
1748
+ */
1749
+ sampleSessions: number | null;
1750
+
1751
+ /**
1752
+ * Counted units with a touch on this row in the current period.
1753
+ */
1754
+ sampleUnits: number;
1755
+
1756
+ /**
1757
+ * Ranking score from 0 to 1, weighted by kind.
1758
+ */
1759
+ score: number;
1760
+ }
1761
+
1762
+ export namespace Insight {
1763
+ /**
1764
+ * The breakdown row the finding is about; matches a preview row by grain, channel,
1765
+ * sourceMedium, campaign, and term.
1766
+ */
1767
+ export interface Row {
1768
+ campaign: string | null;
1769
+
1770
+ channel: string;
1771
+
1772
+ grain: 'channel' | 'source_medium' | 'campaign' | 'term';
1773
+
1774
+ sourceMedium: string | null;
1775
+
1776
+ term: string | null;
1777
+ }
1778
+ }
1779
+ }
1780
+
1781
+ export interface AttributionReportListParams extends CursorParams {
1782
+ /**
1783
+ * Case-insensitive substring search on attribution report names.
1784
+ */
1785
+ search?: string;
1786
+ }
1787
+
1788
+ export interface AttributionReportCreateParams {
1789
+ /**
1790
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
1791
+ * to ten unique event names, an optional filter, and an optional numeric event
1792
+ * property summed as value. Set the credit model (default last_touch), counting
1793
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
1794
+ * 30), an optional filter applied to every outcome, and the value currency
1795
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
1796
+ * definition on PATCH.
1797
+ */
1798
+ definition: AttributionReportCreateParams.Definition;
1799
+
1800
+ /**
1801
+ * Display name for the saved attribution report.
1802
+ */
1803
+ name: string;
1804
+
1805
+ /**
1806
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
1807
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
1808
+ */
1809
+ reportContext: AttributionReportCreateParams.ReportContext;
1810
+
1811
+ /**
1812
+ * Optional description; null clears it.
1813
+ */
1814
+ description?: string | null;
1815
+ }
1816
+
1817
+ export namespace AttributionReportCreateParams {
1818
+ /**
1819
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
1820
+ * to ten unique event names, an optional filter, and an optional numeric event
1821
+ * property summed as value. Set the credit model (default last_touch), counting
1822
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
1823
+ * 30), an optional filter applied to every outcome, and the value currency
1824
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
1825
+ * definition on PATCH.
1826
+ */
1827
+ export interface Definition {
1828
+ kind: 'attribution';
1829
+
1830
+ outcomes: Array<Definition.Outcome>;
1831
+
1832
+ version: 1;
1833
+
1834
+ counting?: 'unique' | 'totals' | 'sessions';
1835
+
1836
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
1837
+
1838
+ filter?: Definition.Filter;
1839
+
1840
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
1841
+
1842
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
1843
+ }
1844
+
1845
+ export namespace Definition {
1846
+ export interface Outcome {
1847
+ id: string;
1848
+
1849
+ eventNames: Array<string>;
1850
+
1851
+ label: string;
1852
+
1853
+ filter?: Outcome.Filter;
1854
+
1855
+ value?: Outcome.Value;
1856
+ }
1857
+
1858
+ export namespace Outcome {
1859
+ export interface Filter {
1860
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
1861
+
1862
+ version: 1;
1863
+ }
1864
+
1865
+ export namespace Filter {
1866
+ export interface UnionMember0 {
1867
+ children: Array<unknown>;
1868
+
1869
+ kind: 'and' | 'or';
1870
+ }
1871
+
1872
+ export interface UnionMember1 {
1873
+ child: unknown;
1874
+
1875
+ kind: 'not';
1876
+ }
1877
+
1878
+ export interface UnionMember2 {
1879
+ kind: 'predicate';
1880
+
1881
+ operator:
1882
+ | 'eq'
1883
+ | 'neq'
1884
+ | 'gt'
1885
+ | 'gte'
1886
+ | 'lt'
1887
+ | 'lte'
1888
+ | 'contains'
1889
+ | 'not_contains'
1890
+ | 'contains_ci'
1891
+ | 'not_contains_ci'
1892
+ | 'starts_with'
1893
+ | 'ends_with'
1894
+ | 'in'
1895
+ | 'not_in'
1896
+ | 'exists'
1897
+ | 'missing'
1898
+ | 'is_null';
1899
+
1900
+ property: string;
1901
+
1902
+ path?: Array<string>;
1903
+
1904
+ type?: 'string' | 'number' | 'boolean';
1905
+
1906
+ value?: string | number | boolean | Array<string | number | boolean>;
1907
+ }
1908
+ }
1909
+
1910
+ export interface Value {
1911
+ path: Array<string>;
1912
+
1913
+ property: 'event.properties';
1914
+
1915
+ type?: 'number';
1916
+ }
1917
+ }
1918
+
1919
+ export interface Filter {
1920
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
1921
+
1922
+ version: 1;
1923
+ }
1924
+
1925
+ export namespace Filter {
1926
+ export interface UnionMember0 {
1927
+ children: Array<unknown>;
1928
+
1929
+ kind: 'and' | 'or';
1930
+ }
1931
+
1932
+ export interface UnionMember1 {
1933
+ child: unknown;
1934
+
1935
+ kind: 'not';
1936
+ }
1937
+
1938
+ export interface UnionMember2 {
1939
+ kind: 'predicate';
1940
+
1941
+ operator:
1942
+ | 'eq'
1943
+ | 'neq'
1944
+ | 'gt'
1945
+ | 'gte'
1946
+ | 'lt'
1947
+ | 'lte'
1948
+ | 'contains'
1949
+ | 'not_contains'
1950
+ | 'contains_ci'
1951
+ | 'not_contains_ci'
1952
+ | 'starts_with'
1953
+ | 'ends_with'
1954
+ | 'in'
1955
+ | 'not_in'
1956
+ | 'exists'
1957
+ | 'missing'
1958
+ | 'is_null';
1959
+
1960
+ property: string;
1961
+
1962
+ path?: Array<string>;
1963
+
1964
+ type?: 'string' | 'number' | 'boolean';
1965
+
1966
+ value?: string | number | boolean | Array<string | number | boolean>;
1967
+ }
1968
+ }
1969
+ }
1970
+
1971
+ /**
1972
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
1973
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
1974
+ */
1975
+ export interface ReportContext {
1976
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
1977
+ }
1978
+
1979
+ export namespace ReportContext {
1980
+ export interface UnionMember0 {
1981
+ from: string;
1982
+
1983
+ to: string;
1984
+
1985
+ timeZone?: 'UTC';
1986
+ }
1987
+
1988
+ export interface UnionMember1 {
1989
+ preset:
1990
+ | 'today'
1991
+ | 'yesterday'
1992
+ | 'last_7_days'
1993
+ | 'last_30_days'
1994
+ | 'last_90_days'
1995
+ | 'last_12_months'
1996
+ | 'week_to_date'
1997
+ | 'month_to_date'
1998
+ | 'year_to_date';
1999
+
2000
+ timeZone?: 'UTC';
2001
+ }
2002
+ }
2003
+ }
2004
+
2005
+ export interface AttributionReportUpdateParams {
2006
+ /**
2007
+ * Current revision from get_attribution_report, list_attribution_reports, or the
2008
+ * last write. A stale revision returns 409; reload before retrying.
2009
+ */
2010
+ expectedRevision: string;
2011
+
2012
+ /**
2013
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
2014
+ * to ten unique event names, an optional filter, and an optional numeric event
2015
+ * property summed as value. Set the credit model (default last_touch), counting
2016
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
2017
+ * 30), an optional filter applied to every outcome, and the value currency
2018
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
2019
+ * definition on PATCH.
2020
+ */
2021
+ definition?: AttributionReportUpdateParams.Definition;
2022
+
2023
+ /**
2024
+ * Optional description; null clears it.
2025
+ */
2026
+ description?: string | null;
2027
+
2028
+ /**
2029
+ * Display name for the saved attribution report.
2030
+ */
2031
+ name?: string;
2032
+
2033
+ /**
2034
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
2035
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
2036
+ */
2037
+ reportContext?: AttributionReportUpdateParams.ReportContext;
2038
+ }
2039
+
2040
+ export namespace AttributionReportUpdateParams {
2041
+ /**
2042
+ * Version 1 attribution definition: one to five conversion outcomes, each with one
2043
+ * to ten unique event names, an optional filter, and an optional numeric event
2044
+ * property summed as value. Set the credit model (default last_touch), counting
2045
+ * unit (default unique), lookback window of 7, 14, 30, 60, or 90 days (default
2046
+ * 30), an optional filter applied to every outcome, and the value currency
2047
+ * (default USD). Outcome ids identify outcomes in results. Replaces the saved
2048
+ * definition on PATCH.
2049
+ */
2050
+ export interface Definition {
2051
+ kind: 'attribution';
2052
+
2053
+ outcomes: Array<Definition.Outcome>;
2054
+
2055
+ version: 1;
2056
+
2057
+ counting?: 'unique' | 'totals' | 'sessions';
2058
+
2059
+ currency?: 'USD' | 'CAD' | 'GBP' | 'EUR' | 'AUD';
2060
+
2061
+ filter?: Definition.Filter;
2062
+
2063
+ lookbackDays?: 7 | 14 | 30 | 60 | 90;
2064
+
2065
+ model?: 'first_touch' | 'last_touch' | 'linear' | 'u_shaped' | 'j_shaped' | 'time_decay';
2066
+ }
2067
+
2068
+ export namespace Definition {
2069
+ export interface Outcome {
2070
+ id: string;
2071
+
2072
+ eventNames: Array<string>;
2073
+
2074
+ label: string;
2075
+
2076
+ filter?: Outcome.Filter;
2077
+
2078
+ value?: Outcome.Value;
2079
+ }
2080
+
2081
+ export namespace Outcome {
2082
+ export interface Filter {
2083
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
2084
+
2085
+ version: 1;
2086
+ }
2087
+
2088
+ export namespace Filter {
2089
+ export interface UnionMember0 {
2090
+ children: Array<unknown>;
2091
+
2092
+ kind: 'and' | 'or';
2093
+ }
2094
+
2095
+ export interface UnionMember1 {
2096
+ child: unknown;
2097
+
2098
+ kind: 'not';
2099
+ }
2100
+
2101
+ export interface UnionMember2 {
2102
+ kind: 'predicate';
2103
+
2104
+ operator:
2105
+ | 'eq'
2106
+ | 'neq'
2107
+ | 'gt'
2108
+ | 'gte'
2109
+ | 'lt'
2110
+ | 'lte'
2111
+ | 'contains'
2112
+ | 'not_contains'
2113
+ | 'contains_ci'
2114
+ | 'not_contains_ci'
2115
+ | 'starts_with'
2116
+ | 'ends_with'
2117
+ | 'in'
2118
+ | 'not_in'
2119
+ | 'exists'
2120
+ | 'missing'
2121
+ | 'is_null';
2122
+
2123
+ property: string;
2124
+
2125
+ path?: Array<string>;
2126
+
2127
+ type?: 'string' | 'number' | 'boolean';
2128
+
2129
+ value?: string | number | boolean | Array<string | number | boolean>;
2130
+ }
2131
+ }
2132
+
2133
+ export interface Value {
2134
+ path: Array<string>;
2135
+
2136
+ property: 'event.properties';
2137
+
2138
+ type?: 'number';
2139
+ }
2140
+ }
2141
+
2142
+ export interface Filter {
2143
+ filter: Filter.UnionMember0 | Filter.UnionMember1 | Filter.UnionMember2;
2144
+
2145
+ version: 1;
2146
+ }
2147
+
2148
+ export namespace Filter {
2149
+ export interface UnionMember0 {
2150
+ children: Array<unknown>;
2151
+
2152
+ kind: 'and' | 'or';
2153
+ }
2154
+
2155
+ export interface UnionMember1 {
2156
+ child: unknown;
2157
+
2158
+ kind: 'not';
2159
+ }
2160
+
2161
+ export interface UnionMember2 {
2162
+ kind: 'predicate';
2163
+
2164
+ operator:
2165
+ | 'eq'
2166
+ | 'neq'
2167
+ | 'gt'
2168
+ | 'gte'
2169
+ | 'lt'
2170
+ | 'lte'
2171
+ | 'contains'
2172
+ | 'not_contains'
2173
+ | 'contains_ci'
2174
+ | 'not_contains_ci'
2175
+ | 'starts_with'
2176
+ | 'ends_with'
2177
+ | 'in'
2178
+ | 'not_in'
2179
+ | 'exists'
2180
+ | 'missing'
2181
+ | 'is_null';
2182
+
2183
+ property: string;
2184
+
2185
+ path?: Array<string>;
2186
+
2187
+ type?: 'string' | 'number' | 'boolean';
2188
+
2189
+ value?: string | number | boolean | Array<string | number | boolean>;
2190
+ }
2191
+ }
2192
+ }
2193
+
2194
+ /**
2195
+ * Default UTC date range: a preset or inclusive from/to calendar dates. Replaces
2196
+ * the saved context on PATCH. Results cover at most 92 inclusive days.
2197
+ */
2198
+ export interface ReportContext {
2199
+ dateRange: ReportContext.UnionMember0 | ReportContext.UnionMember1;
2200
+ }
2201
+
2202
+ export namespace ReportContext {
2203
+ export interface UnionMember0 {
2204
+ from: string;
2205
+
2206
+ to: string;
2207
+
2208
+ timeZone?: 'UTC';
2209
+ }
2210
+
2211
+ export interface UnionMember1 {
2212
+ preset:
2213
+ | 'today'
2214
+ | 'yesterday'
2215
+ | 'last_7_days'
2216
+ | 'last_30_days'
2217
+ | 'last_90_days'
2218
+ | 'last_12_months'
2219
+ | 'week_to_date'
2220
+ | 'month_to_date'
2221
+ | 'year_to_date';
2222
+
2223
+ timeZone?: 'UTC';
2224
+ }
2225
+ }
2226
+ }
2227
+
2228
+ export interface AttributionReportDeleteParams {
2229
+ /**
2230
+ * Current revision from get_attribution_report, list_attribution_reports, or the
2231
+ * last write. A stale revision returns 409; reload before retrying.
2232
+ */
2233
+ expectedRevision: string;
2234
+ }
2235
+
2236
+ export interface AttributionReportDuplicateParams {
2237
+ /**
2238
+ * Current revision from get_attribution_report, list_attribution_reports, or the
2239
+ * last write. A stale revision returns 409; reload before retrying.
2240
+ */
2241
+ expectedRevision: string;
2242
+ }
2243
+
2244
+ export interface AttributionReportPreviewParams {
2245
+ /**
2246
+ * Required input: definition, from, and to; comparison and interval are optional.
2247
+ * JSON-encode this object in the REST query string; maximum 16384 bytes before URL
2248
+ * encoding. Computing a result never saves or changes a report.
2249
+ */
2250
+ input: string;
2251
+ }
2252
+
2253
+ export interface AttributionReportVisitorsParams {
2254
+ /**
2255
+ * Required input: the same definition, from, to, and optional comparison and
2256
+ * interval that produced the result, plus the selection to open; limit and cursor
2257
+ * are optional. JSON-encode this object in the REST query string; maximum 16384
2258
+ * bytes before URL encoding.
2259
+ */
2260
+ input: string;
2261
+ }
2262
+
2263
+ export interface AttributionReportInsightsParams {
2264
+ /**
2265
+ * Required input: definition, from, and to; comparison and interval are optional.
2266
+ * Use the same input as the preview to explain what moved in that result.
2267
+ * JSON-encode this object in the REST query string; maximum 16384 bytes before URL
2268
+ * encoding. Nothing is saved.
2269
+ */
2270
+ input: string;
2271
+ }
2272
+
2273
+ export declare namespace AttributionReports {
2274
+ export {
2275
+ type AttributionReportListResponse as AttributionReportListResponse,
2276
+ type AttributionReportCreateResponse as AttributionReportCreateResponse,
2277
+ type AttributionReportRetrieveResponse as AttributionReportRetrieveResponse,
2278
+ type AttributionReportUpdateResponse as AttributionReportUpdateResponse,
2279
+ type AttributionReportDeleteResponse as AttributionReportDeleteResponse,
2280
+ type AttributionReportDuplicateResponse as AttributionReportDuplicateResponse,
2281
+ type AttributionReportPreviewResponse as AttributionReportPreviewResponse,
2282
+ type AttributionReportVisitorsResponse as AttributionReportVisitorsResponse,
2283
+ type AttributionReportInsightsResponse as AttributionReportInsightsResponse,
2284
+ type AttributionReportListResponsesCursor as AttributionReportListResponsesCursor,
2285
+ type AttributionReportListParams as AttributionReportListParams,
2286
+ type AttributionReportCreateParams as AttributionReportCreateParams,
2287
+ type AttributionReportUpdateParams as AttributionReportUpdateParams,
2288
+ type AttributionReportDeleteParams as AttributionReportDeleteParams,
2289
+ type AttributionReportDuplicateParams as AttributionReportDuplicateParams,
2290
+ type AttributionReportPreviewParams as AttributionReportPreviewParams,
2291
+ type AttributionReportVisitorsParams as AttributionReportVisitorsParams,
2292
+ type AttributionReportInsightsParams as AttributionReportInsightsParams,
2293
+ };
2294
+ }