@oursprivacy/platform-sdk 1.35.0 → 1.37.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/CHANGELOG.md +16 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/attribution.d.mts +412 -0
- package/resources/attribution.d.mts.map +1 -0
- package/resources/attribution.d.ts +412 -0
- package/resources/attribution.d.ts.map +1 -0
- package/resources/attribution.js +64 -0
- package/resources/attribution.js.map +1 -0
- package/resources/attribution.mjs +60 -0
- package/resources/attribution.mjs.map +1 -0
- package/resources/consent-settings.d.mts +15 -0
- package/resources/consent-settings.d.mts.map +1 -1
- package/resources/consent-settings.d.ts +15 -0
- package/resources/consent-settings.d.ts.map +1 -1
- package/resources/funnels.d.mts +194 -0
- package/resources/funnels.d.mts.map +1 -0
- package/resources/funnels.d.ts +194 -0
- package/resources/funnels.d.ts.map +1 -0
- package/resources/funnels.js +37 -0
- package/resources/funnels.js.map +1 -0
- package/resources/funnels.mjs +33 -0
- package/resources/funnels.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +46 -0
- package/src/resources/attribution.ts +595 -0
- package/src/resources/consent-settings.ts +17 -0
- package/src/resources/funnels.ts +285 -0
- package/src/resources/index.ts +20 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,595 @@
|
|
|
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 { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Attribution extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
10
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
11
|
+
* a first-touch basis for the given date window. Use `from`/`to` to set the
|
|
12
|
+
* analysis window (max 60 days). Optionally filter to a specific UTM combo with
|
|
13
|
+
* `utmSource`, `utmMedium`, etc. The counts represent unique visitors who
|
|
14
|
+
* performed the specified `eventName` and were attributed to each UTM value.
|
|
15
|
+
* Requires scope: web-analytics:view
|
|
16
|
+
*/
|
|
17
|
+
initial(query: AttributionInitialParams, options?: RequestOptions): APIPromise<AttributionInitialResponse> {
|
|
18
|
+
return this._client.get('/rest/v1/attribution/initial', { query, ...options });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
23
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
24
|
+
* a last-touch basis for the given date window. Use `from`/`to` to set the
|
|
25
|
+
* analysis window (max 60 days). The counts represent unique visitors who
|
|
26
|
+
* performed the specified `eventName` and were attributed to each UTM value on
|
|
27
|
+
* their most recent session. Requires scope: web-analytics:view
|
|
28
|
+
*/
|
|
29
|
+
lastTouch(
|
|
30
|
+
query: AttributionLastTouchParams,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): APIPromise<AttributionLastTouchResponse> {
|
|
33
|
+
return this._client.get('/rest/v1/attribution/last-touch', { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Multi-touch conversion attribution: returns a source → medium → campaign
|
|
38
|
+
* hierarchy with attributed converter credits distributed according to the
|
|
39
|
+
* selected `attributionModel`. Scoped to all web sources by default; optionally
|
|
40
|
+
* narrow to a single web source via `webSourceId`. Date range is capped at 31
|
|
41
|
+
* days; lookback window is capped at 60 days. Requires scope: web-analytics:view
|
|
42
|
+
*/
|
|
43
|
+
conversion(
|
|
44
|
+
query: AttributionConversionParams,
|
|
45
|
+
options?: RequestOptions,
|
|
46
|
+
): APIPromise<AttributionConversionResponse> {
|
|
47
|
+
return this._client.get('/rest/v1/attribution/conversion', { query, ...options });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Audience performance conversion report: returns a summary of converters and
|
|
52
|
+
* conversion rate for the selected event and date window, a per-day timeseries,
|
|
53
|
+
* and a UTM source/medium/campaign breakdown. Optionally compare against the
|
|
54
|
+
* preceding period of equal length when `attributionWindow` is `IN_RANGE`. Date
|
|
55
|
+
* range is capped at 60 days. Requires scope: web-analytics:view
|
|
56
|
+
*/
|
|
57
|
+
audienceConversion(
|
|
58
|
+
query: AttributionAudienceConversionParams,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): APIPromise<AttributionAudienceConversionResponse> {
|
|
61
|
+
return this._client.get('/rest/v1/attribution/audience-conversion', { query, ...options });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Compare up to 5 UTM dimension combinations side-by-side for a single conversion
|
|
66
|
+
* event. Each combo returns the unique visitors, sessions, total events, and
|
|
67
|
+
* derived conversion rate for that UTM filter within the window. Requires both
|
|
68
|
+
* `web-analytics:view` and `report:event-count-by-day` API-key scopes. Date range
|
|
69
|
+
* is capped at 31 days. Pass `combos` as a single JSON-encoded array:
|
|
70
|
+
* `combos=[{"utmSource":"google","utmMedium":"cpc"},{"utmSource":"meta"}]`.
|
|
71
|
+
* Requires scope: web-analytics:view
|
|
72
|
+
*/
|
|
73
|
+
utmComparison(
|
|
74
|
+
query: AttributionUtmComparisonParams,
|
|
75
|
+
options?: RequestOptions,
|
|
76
|
+
): APIPromise<AttributionUtmComparisonResponse> {
|
|
77
|
+
return this._client.get('/rest/v1/attribution/utm-comparison', { query, ...options });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface AttributionInitialResponse {
|
|
82
|
+
initial_referring_domain: Array<AttributionInitialResponse.InitialReferringDomain>;
|
|
83
|
+
|
|
84
|
+
initial_utm_campaign: Array<AttributionInitialResponse.InitialUtmCampaign>;
|
|
85
|
+
|
|
86
|
+
initial_utm_content: Array<AttributionInitialResponse.InitialUtmContent>;
|
|
87
|
+
|
|
88
|
+
initial_utm_medium: Array<AttributionInitialResponse.InitialUtmMedium>;
|
|
89
|
+
|
|
90
|
+
initial_utm_name: Array<AttributionInitialResponse.InitialUtmName>;
|
|
91
|
+
|
|
92
|
+
initial_utm_source: Array<AttributionInitialResponse.InitialUtmSource>;
|
|
93
|
+
|
|
94
|
+
initial_utm_term: Array<AttributionInitialResponse.InitialUtmTerm>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export namespace AttributionInitialResponse {
|
|
98
|
+
export interface InitialReferringDomain {
|
|
99
|
+
count: number;
|
|
100
|
+
|
|
101
|
+
value: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface InitialUtmCampaign {
|
|
105
|
+
count: number;
|
|
106
|
+
|
|
107
|
+
value: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface InitialUtmContent {
|
|
111
|
+
count: number;
|
|
112
|
+
|
|
113
|
+
value: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface InitialUtmMedium {
|
|
117
|
+
count: number;
|
|
118
|
+
|
|
119
|
+
value: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface InitialUtmName {
|
|
123
|
+
count: number;
|
|
124
|
+
|
|
125
|
+
value: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface InitialUtmSource {
|
|
129
|
+
count: number;
|
|
130
|
+
|
|
131
|
+
value: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface InitialUtmTerm {
|
|
135
|
+
count: number;
|
|
136
|
+
|
|
137
|
+
value: string;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface AttributionLastTouchResponse {
|
|
142
|
+
referring_domain: Array<AttributionLastTouchResponse.ReferringDomain>;
|
|
143
|
+
|
|
144
|
+
utm_campaign: Array<AttributionLastTouchResponse.UtmCampaign>;
|
|
145
|
+
|
|
146
|
+
utm_content: Array<AttributionLastTouchResponse.UtmContent>;
|
|
147
|
+
|
|
148
|
+
utm_medium: Array<AttributionLastTouchResponse.UtmMedium>;
|
|
149
|
+
|
|
150
|
+
utm_name: Array<AttributionLastTouchResponse.UtmName>;
|
|
151
|
+
|
|
152
|
+
utm_source: Array<AttributionLastTouchResponse.UtmSource>;
|
|
153
|
+
|
|
154
|
+
utm_term: Array<AttributionLastTouchResponse.UtmTerm>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export namespace AttributionLastTouchResponse {
|
|
158
|
+
export interface ReferringDomain {
|
|
159
|
+
count: number;
|
|
160
|
+
|
|
161
|
+
value: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface UtmCampaign {
|
|
165
|
+
count: number;
|
|
166
|
+
|
|
167
|
+
value: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface UtmContent {
|
|
171
|
+
count: number;
|
|
172
|
+
|
|
173
|
+
value: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface UtmMedium {
|
|
177
|
+
count: number;
|
|
178
|
+
|
|
179
|
+
value: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface UtmName {
|
|
183
|
+
count: number;
|
|
184
|
+
|
|
185
|
+
value: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface UtmSource {
|
|
189
|
+
count: number;
|
|
190
|
+
|
|
191
|
+
value: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface UtmTerm {
|
|
195
|
+
count: number;
|
|
196
|
+
|
|
197
|
+
value: string;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface AttributionConversionResponse {
|
|
202
|
+
isTruncated: boolean;
|
|
203
|
+
|
|
204
|
+
maxLeafRows: number;
|
|
205
|
+
|
|
206
|
+
nodes: Array<AttributionConversionResponse.Node>;
|
|
207
|
+
|
|
208
|
+
summary: AttributionConversionResponse.Summary;
|
|
209
|
+
|
|
210
|
+
totalLeafRows: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export namespace AttributionConversionResponse {
|
|
214
|
+
export interface Node {
|
|
215
|
+
attributedConverterCredit: number;
|
|
216
|
+
|
|
217
|
+
converters: number;
|
|
218
|
+
|
|
219
|
+
level: 'SOURCE' | 'MEDIUM' | 'CAMPAIGN';
|
|
220
|
+
|
|
221
|
+
sessions: number;
|
|
222
|
+
|
|
223
|
+
source: string;
|
|
224
|
+
|
|
225
|
+
campaign?: string | null;
|
|
226
|
+
|
|
227
|
+
medium?: string | null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface Summary {
|
|
231
|
+
attributedConverters: number;
|
|
232
|
+
|
|
233
|
+
scopeConverters: number;
|
|
234
|
+
|
|
235
|
+
totalEventConverters: number;
|
|
236
|
+
|
|
237
|
+
totalSessions: number;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface AttributionAudienceConversionResponse {
|
|
242
|
+
breakdown: Array<AttributionAudienceConversionResponse.Breakdown>;
|
|
243
|
+
|
|
244
|
+
summary: AttributionAudienceConversionResponse.Summary;
|
|
245
|
+
|
|
246
|
+
timeseries: Array<AttributionAudienceConversionResponse.Timesery>;
|
|
247
|
+
|
|
248
|
+
previousSummary?: AttributionAudienceConversionResponse.PreviousSummary | null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export namespace AttributionAudienceConversionResponse {
|
|
252
|
+
export interface Breakdown {
|
|
253
|
+
campaign: string;
|
|
254
|
+
|
|
255
|
+
conversions: number;
|
|
256
|
+
|
|
257
|
+
converters: number;
|
|
258
|
+
|
|
259
|
+
medium: string;
|
|
260
|
+
|
|
261
|
+
source: string;
|
|
262
|
+
|
|
263
|
+
totalValue: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface Summary {
|
|
267
|
+
audienceSize: number;
|
|
268
|
+
|
|
269
|
+
avgValuePerConversion: number;
|
|
270
|
+
|
|
271
|
+
avgValuePerConvertingVisitor: number;
|
|
272
|
+
|
|
273
|
+
conversionRate: number;
|
|
274
|
+
|
|
275
|
+
conversions: number;
|
|
276
|
+
|
|
277
|
+
converters: number;
|
|
278
|
+
|
|
279
|
+
totalValue: number;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface Timesery {
|
|
283
|
+
conversions: number;
|
|
284
|
+
|
|
285
|
+
date: string;
|
|
286
|
+
|
|
287
|
+
totalValue: number;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface PreviousSummary {
|
|
291
|
+
audienceSize: number;
|
|
292
|
+
|
|
293
|
+
avgValuePerConversion: number;
|
|
294
|
+
|
|
295
|
+
avgValuePerConvertingVisitor: number;
|
|
296
|
+
|
|
297
|
+
conversionRate: number;
|
|
298
|
+
|
|
299
|
+
conversions: number;
|
|
300
|
+
|
|
301
|
+
converters: number;
|
|
302
|
+
|
|
303
|
+
totalValue: number;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export interface AttributionUtmComparisonResponse {
|
|
308
|
+
/**
|
|
309
|
+
* Per-combo metrics in the same order as the input `combos` array.
|
|
310
|
+
*/
|
|
311
|
+
combos: Array<AttributionUtmComparisonResponse.Combo>;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* The conversion event that was analyzed.
|
|
315
|
+
*/
|
|
316
|
+
eventName: string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The requested date range as returned by the server.
|
|
320
|
+
*/
|
|
321
|
+
range: AttributionUtmComparisonResponse.Range;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export namespace AttributionUtmComparisonResponse {
|
|
325
|
+
export interface Combo {
|
|
326
|
+
combo: Combo.Combo;
|
|
327
|
+
|
|
328
|
+
conversionRate: number;
|
|
329
|
+
|
|
330
|
+
events: number;
|
|
331
|
+
|
|
332
|
+
sessions: number;
|
|
333
|
+
|
|
334
|
+
visitors: number;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export namespace Combo {
|
|
338
|
+
export interface Combo {
|
|
339
|
+
utmCampaign?: string | null;
|
|
340
|
+
|
|
341
|
+
utmContent?: string | null;
|
|
342
|
+
|
|
343
|
+
utmMedium?: string | null;
|
|
344
|
+
|
|
345
|
+
utmSource?: string | null;
|
|
346
|
+
|
|
347
|
+
utmTerm?: string | null;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* The requested date range as returned by the server.
|
|
353
|
+
*/
|
|
354
|
+
export interface Range {
|
|
355
|
+
from: string;
|
|
356
|
+
|
|
357
|
+
to: string;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface AttributionInitialParams {
|
|
362
|
+
/**
|
|
363
|
+
* Conversion event to count. Must be a selectable conversion event.
|
|
364
|
+
*/
|
|
365
|
+
eventName: string;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
369
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
370
|
+
* fewer.
|
|
371
|
+
*/
|
|
372
|
+
from: string;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
376
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
377
|
+
* fewer.
|
|
378
|
+
*/
|
|
379
|
+
to: string;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Attribution type for UTM filter matching. Defaults to `INITIAL`.
|
|
383
|
+
*/
|
|
384
|
+
attributionType?: 'INITIAL' | 'LAST_TOUCH';
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Filter by UTM campaign.
|
|
388
|
+
*/
|
|
389
|
+
utmCampaign?: string;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Filter by UTM content.
|
|
393
|
+
*/
|
|
394
|
+
utmContent?: string;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Filter by UTM medium.
|
|
398
|
+
*/
|
|
399
|
+
utmMedium?: string;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Filter by UTM name.
|
|
403
|
+
*/
|
|
404
|
+
utmName?: string;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Filter by UTM source.
|
|
408
|
+
*/
|
|
409
|
+
utmSource?: string;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Filter by UTM term.
|
|
413
|
+
*/
|
|
414
|
+
utmTerm?: string;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface AttributionLastTouchParams {
|
|
418
|
+
/**
|
|
419
|
+
* Conversion event to count. Must be a selectable conversion event.
|
|
420
|
+
*/
|
|
421
|
+
eventName: string;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
425
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
426
|
+
* fewer.
|
|
427
|
+
*/
|
|
428
|
+
from: string;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
432
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
433
|
+
* fewer.
|
|
434
|
+
*/
|
|
435
|
+
to: string;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Attribution type for UTM filter matching. Defaults to `LAST_TOUCH`.
|
|
439
|
+
*/
|
|
440
|
+
attributionType?: 'INITIAL' | 'LAST_TOUCH';
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Filter by UTM campaign.
|
|
444
|
+
*/
|
|
445
|
+
utmCampaign?: string;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Filter by UTM content.
|
|
449
|
+
*/
|
|
450
|
+
utmContent?: string;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Filter by UTM medium.
|
|
454
|
+
*/
|
|
455
|
+
utmMedium?: string;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Filter by UTM name.
|
|
459
|
+
*/
|
|
460
|
+
utmName?: string;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Filter by UTM source.
|
|
464
|
+
*/
|
|
465
|
+
utmSource?: string;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Filter by UTM term.
|
|
469
|
+
*/
|
|
470
|
+
utmTerm?: string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export interface AttributionConversionParams {
|
|
474
|
+
/**
|
|
475
|
+
* Attribution model to apply to multi-touch conversion paths.
|
|
476
|
+
*/
|
|
477
|
+
attributionModel: 'FIRST_TOUCH' | 'LAST_TOUCH' | 'LINEAR' | 'POSITION_BASED';
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Conversion event to attribute. Must be a selectable conversion event.
|
|
481
|
+
*/
|
|
482
|
+
eventName: string;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
486
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
487
|
+
* fewer.
|
|
488
|
+
*/
|
|
489
|
+
from: string;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
493
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
494
|
+
* fewer.
|
|
495
|
+
*/
|
|
496
|
+
to: string;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Maximum number of leaf-level attribution rows to return. Defaults to 1000.
|
|
500
|
+
*/
|
|
501
|
+
limit?: number;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* How far back before each conversion to consider touchpoints. Capped at 60 days
|
|
505
|
+
* for this report. Defaults to `THIRTY_DAYS`.
|
|
506
|
+
*/
|
|
507
|
+
lookbackWindow?:
|
|
508
|
+
| 'SEVEN_DAYS'
|
|
509
|
+
| 'FOURTEEN_DAYS'
|
|
510
|
+
| 'THIRTY_DAYS'
|
|
511
|
+
| 'SIXTY_DAYS'
|
|
512
|
+
| 'NINETY_DAYS'
|
|
513
|
+
| 'ONE_HUNDRED_EIGHTY_DAYS'
|
|
514
|
+
| 'UNLIMITED';
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Scope to a single web source by id, or omit for all sources (account-wide).
|
|
518
|
+
*/
|
|
519
|
+
webSourceId?: string;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export interface AttributionAudienceConversionParams {
|
|
523
|
+
/**
|
|
524
|
+
* Conversion event to analyze.
|
|
525
|
+
*/
|
|
526
|
+
eventName: string;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
530
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
531
|
+
* fewer.
|
|
532
|
+
*/
|
|
533
|
+
from: string;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
537
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
538
|
+
* fewer.
|
|
539
|
+
*/
|
|
540
|
+
to: string;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Attribution window: `IN_RANGE` or a number of lookback days (e.g. `7`, `30`).
|
|
544
|
+
* Defaults to `IN_RANGE`.
|
|
545
|
+
*/
|
|
546
|
+
attributionWindow?: string;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Event property to sum as conversion value.
|
|
550
|
+
*/
|
|
551
|
+
valueProperty?: string;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export interface AttributionUtmComparisonParams {
|
|
555
|
+
/**
|
|
556
|
+
* JSON-encoded array of UTM dimension combos to compare side-by-side (min 1, max
|
|
557
|
+
* 5). Each combo is an object with optional `utmSource`, `utmMedium`,
|
|
558
|
+
* `utmCampaign`, `utmContent`, `utmTerm` fields.
|
|
559
|
+
*/
|
|
560
|
+
combos: string;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Conversion event to compare across UTM combos.
|
|
564
|
+
*/
|
|
565
|
+
eventName: string;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
569
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
570
|
+
* fewer.
|
|
571
|
+
*/
|
|
572
|
+
from: string;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
576
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
577
|
+
* fewer.
|
|
578
|
+
*/
|
|
579
|
+
to: string;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export declare namespace Attribution {
|
|
583
|
+
export {
|
|
584
|
+
type AttributionInitialResponse as AttributionInitialResponse,
|
|
585
|
+
type AttributionLastTouchResponse as AttributionLastTouchResponse,
|
|
586
|
+
type AttributionConversionResponse as AttributionConversionResponse,
|
|
587
|
+
type AttributionAudienceConversionResponse as AttributionAudienceConversionResponse,
|
|
588
|
+
type AttributionUtmComparisonResponse as AttributionUtmComparisonResponse,
|
|
589
|
+
type AttributionInitialParams as AttributionInitialParams,
|
|
590
|
+
type AttributionLastTouchParams as AttributionLastTouchParams,
|
|
591
|
+
type AttributionConversionParams as AttributionConversionParams,
|
|
592
|
+
type AttributionAudienceConversionParams as AttributionAudienceConversionParams,
|
|
593
|
+
type AttributionUtmComparisonParams as AttributionUtmComparisonParams,
|
|
594
|
+
};
|
|
595
|
+
}
|
|
@@ -3664,6 +3664,23 @@ export interface ConsentSettingAnalyticsParams {
|
|
|
3664
3664
|
*/
|
|
3665
3665
|
compareWithPreviousPeriod?: boolean;
|
|
3666
3666
|
|
|
3667
|
+
/**
|
|
3668
|
+
* Optional custom comparison-window lower bound, as a UTC calendar day in
|
|
3669
|
+
* `YYYY-MM-DD` format. Provide together with `comparisonTo`; the window between
|
|
3670
|
+
* them must be the same length as `from`–`to` (a mismatch returns `400`). When
|
|
3671
|
+
* omitted (with `compareWithPreviousPeriod=true`), the immediately preceding
|
|
3672
|
+
* equal-length period is used.
|
|
3673
|
+
*/
|
|
3674
|
+
comparisonFrom?: string;
|
|
3675
|
+
|
|
3676
|
+
/**
|
|
3677
|
+
* Optional custom comparison-window upper bound, as a UTC calendar day in
|
|
3678
|
+
* `YYYY-MM-DD` format. Provide together with `comparisonFrom`; the window must
|
|
3679
|
+
* match the `from`–`to` length. Ignored unless both comparison bounds are
|
|
3680
|
+
* supplied.
|
|
3681
|
+
*/
|
|
3682
|
+
comparisonTo?: string;
|
|
3683
|
+
|
|
3667
3684
|
/**
|
|
3668
3685
|
* Bucket size for the time-series rollup. `DAILY` (default) buckets per UTC day;
|
|
3669
3686
|
* `HOURLY` buckets per UTC hour and limits the window to 14 days.
|