@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,412 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Attribution extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
7
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
8
|
+
* a first-touch basis for the given date window. Use `from`/`to` to set the
|
|
9
|
+
* analysis window (max 60 days). Optionally filter to a specific UTM combo with
|
|
10
|
+
* `utmSource`, `utmMedium`, etc. The counts represent unique visitors who
|
|
11
|
+
* performed the specified `eventName` and were attributed to each UTM value.
|
|
12
|
+
* Requires scope: web-analytics:view
|
|
13
|
+
*/
|
|
14
|
+
initial(query: AttributionInitialParams, options?: RequestOptions): APIPromise<AttributionInitialResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
17
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
18
|
+
* a last-touch basis for the given date window. Use `from`/`to` to set the
|
|
19
|
+
* analysis window (max 60 days). The counts represent unique visitors who
|
|
20
|
+
* performed the specified `eventName` and were attributed to each UTM value on
|
|
21
|
+
* their most recent session. Requires scope: web-analytics:view
|
|
22
|
+
*/
|
|
23
|
+
lastTouch(query: AttributionLastTouchParams, options?: RequestOptions): APIPromise<AttributionLastTouchResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Multi-touch conversion attribution: returns a source → medium → campaign
|
|
26
|
+
* hierarchy with attributed converter credits distributed according to the
|
|
27
|
+
* selected `attributionModel`. Scoped to all web sources by default; optionally
|
|
28
|
+
* narrow to a single web source via `webSourceId`. Date range is capped at 31
|
|
29
|
+
* days; lookback window is capped at 60 days. Requires scope: web-analytics:view
|
|
30
|
+
*/
|
|
31
|
+
conversion(query: AttributionConversionParams, options?: RequestOptions): APIPromise<AttributionConversionResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Audience performance conversion report: returns a summary of converters and
|
|
34
|
+
* conversion rate for the selected event and date window, a per-day timeseries,
|
|
35
|
+
* and a UTM source/medium/campaign breakdown. Optionally compare against the
|
|
36
|
+
* preceding period of equal length when `attributionWindow` is `IN_RANGE`. Date
|
|
37
|
+
* range is capped at 60 days. Requires scope: web-analytics:view
|
|
38
|
+
*/
|
|
39
|
+
audienceConversion(query: AttributionAudienceConversionParams, options?: RequestOptions): APIPromise<AttributionAudienceConversionResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Compare up to 5 UTM dimension combinations side-by-side for a single conversion
|
|
42
|
+
* event. Each combo returns the unique visitors, sessions, total events, and
|
|
43
|
+
* derived conversion rate for that UTM filter within the window. Requires both
|
|
44
|
+
* `web-analytics:view` and `report:event-count-by-day` API-key scopes. Date range
|
|
45
|
+
* is capped at 31 days. Pass `combos` as a single JSON-encoded array:
|
|
46
|
+
* `combos=[{"utmSource":"google","utmMedium":"cpc"},{"utmSource":"meta"}]`.
|
|
47
|
+
* Requires scope: web-analytics:view
|
|
48
|
+
*/
|
|
49
|
+
utmComparison(query: AttributionUtmComparisonParams, options?: RequestOptions): APIPromise<AttributionUtmComparisonResponse>;
|
|
50
|
+
}
|
|
51
|
+
export interface AttributionInitialResponse {
|
|
52
|
+
initial_referring_domain: Array<AttributionInitialResponse.InitialReferringDomain>;
|
|
53
|
+
initial_utm_campaign: Array<AttributionInitialResponse.InitialUtmCampaign>;
|
|
54
|
+
initial_utm_content: Array<AttributionInitialResponse.InitialUtmContent>;
|
|
55
|
+
initial_utm_medium: Array<AttributionInitialResponse.InitialUtmMedium>;
|
|
56
|
+
initial_utm_name: Array<AttributionInitialResponse.InitialUtmName>;
|
|
57
|
+
initial_utm_source: Array<AttributionInitialResponse.InitialUtmSource>;
|
|
58
|
+
initial_utm_term: Array<AttributionInitialResponse.InitialUtmTerm>;
|
|
59
|
+
}
|
|
60
|
+
export declare namespace AttributionInitialResponse {
|
|
61
|
+
interface InitialReferringDomain {
|
|
62
|
+
count: number;
|
|
63
|
+
value: string;
|
|
64
|
+
}
|
|
65
|
+
interface InitialUtmCampaign {
|
|
66
|
+
count: number;
|
|
67
|
+
value: string;
|
|
68
|
+
}
|
|
69
|
+
interface InitialUtmContent {
|
|
70
|
+
count: number;
|
|
71
|
+
value: string;
|
|
72
|
+
}
|
|
73
|
+
interface InitialUtmMedium {
|
|
74
|
+
count: number;
|
|
75
|
+
value: string;
|
|
76
|
+
}
|
|
77
|
+
interface InitialUtmName {
|
|
78
|
+
count: number;
|
|
79
|
+
value: string;
|
|
80
|
+
}
|
|
81
|
+
interface InitialUtmSource {
|
|
82
|
+
count: number;
|
|
83
|
+
value: string;
|
|
84
|
+
}
|
|
85
|
+
interface InitialUtmTerm {
|
|
86
|
+
count: number;
|
|
87
|
+
value: string;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export interface AttributionLastTouchResponse {
|
|
91
|
+
referring_domain: Array<AttributionLastTouchResponse.ReferringDomain>;
|
|
92
|
+
utm_campaign: Array<AttributionLastTouchResponse.UtmCampaign>;
|
|
93
|
+
utm_content: Array<AttributionLastTouchResponse.UtmContent>;
|
|
94
|
+
utm_medium: Array<AttributionLastTouchResponse.UtmMedium>;
|
|
95
|
+
utm_name: Array<AttributionLastTouchResponse.UtmName>;
|
|
96
|
+
utm_source: Array<AttributionLastTouchResponse.UtmSource>;
|
|
97
|
+
utm_term: Array<AttributionLastTouchResponse.UtmTerm>;
|
|
98
|
+
}
|
|
99
|
+
export declare namespace AttributionLastTouchResponse {
|
|
100
|
+
interface ReferringDomain {
|
|
101
|
+
count: number;
|
|
102
|
+
value: string;
|
|
103
|
+
}
|
|
104
|
+
interface UtmCampaign {
|
|
105
|
+
count: number;
|
|
106
|
+
value: string;
|
|
107
|
+
}
|
|
108
|
+
interface UtmContent {
|
|
109
|
+
count: number;
|
|
110
|
+
value: string;
|
|
111
|
+
}
|
|
112
|
+
interface UtmMedium {
|
|
113
|
+
count: number;
|
|
114
|
+
value: string;
|
|
115
|
+
}
|
|
116
|
+
interface UtmName {
|
|
117
|
+
count: number;
|
|
118
|
+
value: string;
|
|
119
|
+
}
|
|
120
|
+
interface UtmSource {
|
|
121
|
+
count: number;
|
|
122
|
+
value: string;
|
|
123
|
+
}
|
|
124
|
+
interface UtmTerm {
|
|
125
|
+
count: number;
|
|
126
|
+
value: string;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export interface AttributionConversionResponse {
|
|
130
|
+
isTruncated: boolean;
|
|
131
|
+
maxLeafRows: number;
|
|
132
|
+
nodes: Array<AttributionConversionResponse.Node>;
|
|
133
|
+
summary: AttributionConversionResponse.Summary;
|
|
134
|
+
totalLeafRows: number;
|
|
135
|
+
}
|
|
136
|
+
export declare namespace AttributionConversionResponse {
|
|
137
|
+
interface Node {
|
|
138
|
+
attributedConverterCredit: number;
|
|
139
|
+
converters: number;
|
|
140
|
+
level: 'SOURCE' | 'MEDIUM' | 'CAMPAIGN';
|
|
141
|
+
sessions: number;
|
|
142
|
+
source: string;
|
|
143
|
+
campaign?: string | null;
|
|
144
|
+
medium?: string | null;
|
|
145
|
+
}
|
|
146
|
+
interface Summary {
|
|
147
|
+
attributedConverters: number;
|
|
148
|
+
scopeConverters: number;
|
|
149
|
+
totalEventConverters: number;
|
|
150
|
+
totalSessions: number;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export interface AttributionAudienceConversionResponse {
|
|
154
|
+
breakdown: Array<AttributionAudienceConversionResponse.Breakdown>;
|
|
155
|
+
summary: AttributionAudienceConversionResponse.Summary;
|
|
156
|
+
timeseries: Array<AttributionAudienceConversionResponse.Timesery>;
|
|
157
|
+
previousSummary?: AttributionAudienceConversionResponse.PreviousSummary | null;
|
|
158
|
+
}
|
|
159
|
+
export declare namespace AttributionAudienceConversionResponse {
|
|
160
|
+
interface Breakdown {
|
|
161
|
+
campaign: string;
|
|
162
|
+
conversions: number;
|
|
163
|
+
converters: number;
|
|
164
|
+
medium: string;
|
|
165
|
+
source: string;
|
|
166
|
+
totalValue: number;
|
|
167
|
+
}
|
|
168
|
+
interface Summary {
|
|
169
|
+
audienceSize: number;
|
|
170
|
+
avgValuePerConversion: number;
|
|
171
|
+
avgValuePerConvertingVisitor: number;
|
|
172
|
+
conversionRate: number;
|
|
173
|
+
conversions: number;
|
|
174
|
+
converters: number;
|
|
175
|
+
totalValue: number;
|
|
176
|
+
}
|
|
177
|
+
interface Timesery {
|
|
178
|
+
conversions: number;
|
|
179
|
+
date: string;
|
|
180
|
+
totalValue: number;
|
|
181
|
+
}
|
|
182
|
+
interface PreviousSummary {
|
|
183
|
+
audienceSize: number;
|
|
184
|
+
avgValuePerConversion: number;
|
|
185
|
+
avgValuePerConvertingVisitor: number;
|
|
186
|
+
conversionRate: number;
|
|
187
|
+
conversions: number;
|
|
188
|
+
converters: number;
|
|
189
|
+
totalValue: number;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export interface AttributionUtmComparisonResponse {
|
|
193
|
+
/**
|
|
194
|
+
* Per-combo metrics in the same order as the input `combos` array.
|
|
195
|
+
*/
|
|
196
|
+
combos: Array<AttributionUtmComparisonResponse.Combo>;
|
|
197
|
+
/**
|
|
198
|
+
* The conversion event that was analyzed.
|
|
199
|
+
*/
|
|
200
|
+
eventName: string;
|
|
201
|
+
/**
|
|
202
|
+
* The requested date range as returned by the server.
|
|
203
|
+
*/
|
|
204
|
+
range: AttributionUtmComparisonResponse.Range;
|
|
205
|
+
}
|
|
206
|
+
export declare namespace AttributionUtmComparisonResponse {
|
|
207
|
+
interface Combo {
|
|
208
|
+
combo: Combo.Combo;
|
|
209
|
+
conversionRate: number;
|
|
210
|
+
events: number;
|
|
211
|
+
sessions: number;
|
|
212
|
+
visitors: number;
|
|
213
|
+
}
|
|
214
|
+
namespace Combo {
|
|
215
|
+
interface Combo {
|
|
216
|
+
utmCampaign?: string | null;
|
|
217
|
+
utmContent?: string | null;
|
|
218
|
+
utmMedium?: string | null;
|
|
219
|
+
utmSource?: string | null;
|
|
220
|
+
utmTerm?: string | null;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* The requested date range as returned by the server.
|
|
225
|
+
*/
|
|
226
|
+
interface Range {
|
|
227
|
+
from: string;
|
|
228
|
+
to: string;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
export interface AttributionInitialParams {
|
|
232
|
+
/**
|
|
233
|
+
* Conversion event to count. Must be a selectable conversion event.
|
|
234
|
+
*/
|
|
235
|
+
eventName: string;
|
|
236
|
+
/**
|
|
237
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
238
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
239
|
+
* fewer.
|
|
240
|
+
*/
|
|
241
|
+
from: string;
|
|
242
|
+
/**
|
|
243
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
244
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
245
|
+
* fewer.
|
|
246
|
+
*/
|
|
247
|
+
to: string;
|
|
248
|
+
/**
|
|
249
|
+
* Attribution type for UTM filter matching. Defaults to `INITIAL`.
|
|
250
|
+
*/
|
|
251
|
+
attributionType?: 'INITIAL' | 'LAST_TOUCH';
|
|
252
|
+
/**
|
|
253
|
+
* Filter by UTM campaign.
|
|
254
|
+
*/
|
|
255
|
+
utmCampaign?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Filter by UTM content.
|
|
258
|
+
*/
|
|
259
|
+
utmContent?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Filter by UTM medium.
|
|
262
|
+
*/
|
|
263
|
+
utmMedium?: string;
|
|
264
|
+
/**
|
|
265
|
+
* Filter by UTM name.
|
|
266
|
+
*/
|
|
267
|
+
utmName?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Filter by UTM source.
|
|
270
|
+
*/
|
|
271
|
+
utmSource?: string;
|
|
272
|
+
/**
|
|
273
|
+
* Filter by UTM term.
|
|
274
|
+
*/
|
|
275
|
+
utmTerm?: string;
|
|
276
|
+
}
|
|
277
|
+
export interface AttributionLastTouchParams {
|
|
278
|
+
/**
|
|
279
|
+
* Conversion event to count. Must be a selectable conversion event.
|
|
280
|
+
*/
|
|
281
|
+
eventName: string;
|
|
282
|
+
/**
|
|
283
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
284
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
285
|
+
* fewer.
|
|
286
|
+
*/
|
|
287
|
+
from: string;
|
|
288
|
+
/**
|
|
289
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
290
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
291
|
+
* fewer.
|
|
292
|
+
*/
|
|
293
|
+
to: string;
|
|
294
|
+
/**
|
|
295
|
+
* Attribution type for UTM filter matching. Defaults to `LAST_TOUCH`.
|
|
296
|
+
*/
|
|
297
|
+
attributionType?: 'INITIAL' | 'LAST_TOUCH';
|
|
298
|
+
/**
|
|
299
|
+
* Filter by UTM campaign.
|
|
300
|
+
*/
|
|
301
|
+
utmCampaign?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Filter by UTM content.
|
|
304
|
+
*/
|
|
305
|
+
utmContent?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Filter by UTM medium.
|
|
308
|
+
*/
|
|
309
|
+
utmMedium?: string;
|
|
310
|
+
/**
|
|
311
|
+
* Filter by UTM name.
|
|
312
|
+
*/
|
|
313
|
+
utmName?: string;
|
|
314
|
+
/**
|
|
315
|
+
* Filter by UTM source.
|
|
316
|
+
*/
|
|
317
|
+
utmSource?: string;
|
|
318
|
+
/**
|
|
319
|
+
* Filter by UTM term.
|
|
320
|
+
*/
|
|
321
|
+
utmTerm?: string;
|
|
322
|
+
}
|
|
323
|
+
export interface AttributionConversionParams {
|
|
324
|
+
/**
|
|
325
|
+
* Attribution model to apply to multi-touch conversion paths.
|
|
326
|
+
*/
|
|
327
|
+
attributionModel: 'FIRST_TOUCH' | 'LAST_TOUCH' | 'LINEAR' | 'POSITION_BASED';
|
|
328
|
+
/**
|
|
329
|
+
* Conversion event to attribute. Must be a selectable conversion event.
|
|
330
|
+
*/
|
|
331
|
+
eventName: string;
|
|
332
|
+
/**
|
|
333
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
334
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
335
|
+
* fewer.
|
|
336
|
+
*/
|
|
337
|
+
from: string;
|
|
338
|
+
/**
|
|
339
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
340
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
341
|
+
* fewer.
|
|
342
|
+
*/
|
|
343
|
+
to: string;
|
|
344
|
+
/**
|
|
345
|
+
* Maximum number of leaf-level attribution rows to return. Defaults to 1000.
|
|
346
|
+
*/
|
|
347
|
+
limit?: number;
|
|
348
|
+
/**
|
|
349
|
+
* How far back before each conversion to consider touchpoints. Capped at 60 days
|
|
350
|
+
* for this report. Defaults to `THIRTY_DAYS`.
|
|
351
|
+
*/
|
|
352
|
+
lookbackWindow?: 'SEVEN_DAYS' | 'FOURTEEN_DAYS' | 'THIRTY_DAYS' | 'SIXTY_DAYS' | 'NINETY_DAYS' | 'ONE_HUNDRED_EIGHTY_DAYS' | 'UNLIMITED';
|
|
353
|
+
/**
|
|
354
|
+
* Scope to a single web source by id, or omit for all sources (account-wide).
|
|
355
|
+
*/
|
|
356
|
+
webSourceId?: string;
|
|
357
|
+
}
|
|
358
|
+
export interface AttributionAudienceConversionParams {
|
|
359
|
+
/**
|
|
360
|
+
* Conversion event to analyze.
|
|
361
|
+
*/
|
|
362
|
+
eventName: string;
|
|
363
|
+
/**
|
|
364
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
365
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
366
|
+
* fewer.
|
|
367
|
+
*/
|
|
368
|
+
from: string;
|
|
369
|
+
/**
|
|
370
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
371
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 60 days or
|
|
372
|
+
* fewer.
|
|
373
|
+
*/
|
|
374
|
+
to: string;
|
|
375
|
+
/**
|
|
376
|
+
* Attribution window: `IN_RANGE` or a number of lookback days (e.g. `7`, `30`).
|
|
377
|
+
* Defaults to `IN_RANGE`.
|
|
378
|
+
*/
|
|
379
|
+
attributionWindow?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Event property to sum as conversion value.
|
|
382
|
+
*/
|
|
383
|
+
valueProperty?: string;
|
|
384
|
+
}
|
|
385
|
+
export interface AttributionUtmComparisonParams {
|
|
386
|
+
/**
|
|
387
|
+
* JSON-encoded array of UTM dimension combos to compare side-by-side (min 1, max
|
|
388
|
+
* 5). Each combo is an object with optional `utmSource`, `utmMedium`,
|
|
389
|
+
* `utmCampaign`, `utmContent`, `utmTerm` fields.
|
|
390
|
+
*/
|
|
391
|
+
combos: string;
|
|
392
|
+
/**
|
|
393
|
+
* Conversion event to compare across UTM combos.
|
|
394
|
+
*/
|
|
395
|
+
eventName: string;
|
|
396
|
+
/**
|
|
397
|
+
* Inclusive lower bound of the analytics window, as a UTC calendar day in
|
|
398
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
399
|
+
* fewer.
|
|
400
|
+
*/
|
|
401
|
+
from: string;
|
|
402
|
+
/**
|
|
403
|
+
* Inclusive upper bound of the analytics window, as a UTC calendar day in
|
|
404
|
+
* `YYYY-MM-DD` format. The window between `from` and `to` must be 31 days or
|
|
405
|
+
* fewer.
|
|
406
|
+
*/
|
|
407
|
+
to: string;
|
|
408
|
+
}
|
|
409
|
+
export declare namespace Attribution {
|
|
410
|
+
export { type AttributionInitialResponse as AttributionInitialResponse, type AttributionLastTouchResponse as AttributionLastTouchResponse, type AttributionConversionResponse as AttributionConversionResponse, type AttributionAudienceConversionResponse as AttributionAudienceConversionResponse, type AttributionUtmComparisonResponse as AttributionUtmComparisonResponse, type AttributionInitialParams as AttributionInitialParams, type AttributionLastTouchParams as AttributionLastTouchParams, type AttributionConversionParams as AttributionConversionParams, type AttributionAudienceConversionParams as AttributionAudienceConversionParams, type AttributionUtmComparisonParams as AttributionUtmComparisonParams, };
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=attribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../src/resources/attribution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;OAQG;IACH,OAAO,CAAC,KAAK,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI1G;;;;;;;OAOG;IACH,SAAS,CACP,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;IAI3C;;;;;;OAMG;IACH,UAAU,CACR,KAAK,EAAE,2BAA2B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,6BAA6B,CAAC;IAI5C;;;;;;OAMG;IACH,kBAAkB,CAChB,KAAK,EAAE,mCAAmC,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qCAAqC,CAAC;IAIpD;;;;;;;;OAQG;IACH,aAAa,CACX,KAAK,EAAE,8BAA8B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gCAAgC,CAAC;CAGhD;AAED,MAAM,WAAW,0BAA0B;IACzC,wBAAwB,EAAE,KAAK,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,CAAC;IAEnF,oBAAoB,EAAE,KAAK,CAAC,0BAA0B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,aAAa,GACb,YAAY,GACZ,aAAa,GACb,yBAAyB,GACzB,WAAW,CAAC;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;CACH"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Attribution = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
class Attribution extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
9
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
10
|
+
* a first-touch basis for the given date window. Use `from`/`to` to set the
|
|
11
|
+
* analysis window (max 60 days). Optionally filter to a specific UTM combo with
|
|
12
|
+
* `utmSource`, `utmMedium`, etc. The counts represent unique visitors who
|
|
13
|
+
* performed the specified `eventName` and were attributed to each UTM value.
|
|
14
|
+
* Requires scope: web-analytics:view
|
|
15
|
+
*/
|
|
16
|
+
initial(query, options) {
|
|
17
|
+
return this._client.get('/rest/v1/attribution/initial', { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
21
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
22
|
+
* a last-touch basis for the given date window. Use `from`/`to` to set the
|
|
23
|
+
* analysis window (max 60 days). The counts represent unique visitors who
|
|
24
|
+
* performed the specified `eventName` and were attributed to each UTM value on
|
|
25
|
+
* their most recent session. Requires scope: web-analytics:view
|
|
26
|
+
*/
|
|
27
|
+
lastTouch(query, options) {
|
|
28
|
+
return this._client.get('/rest/v1/attribution/last-touch', { query, ...options });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Multi-touch conversion attribution: returns a source → medium → campaign
|
|
32
|
+
* hierarchy with attributed converter credits distributed according to the
|
|
33
|
+
* selected `attributionModel`. Scoped to all web sources by default; optionally
|
|
34
|
+
* narrow to a single web source via `webSourceId`. Date range is capped at 31
|
|
35
|
+
* days; lookback window is capped at 60 days. Requires scope: web-analytics:view
|
|
36
|
+
*/
|
|
37
|
+
conversion(query, options) {
|
|
38
|
+
return this._client.get('/rest/v1/attribution/conversion', { query, ...options });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Audience performance conversion report: returns a summary of converters and
|
|
42
|
+
* conversion rate for the selected event and date window, a per-day timeseries,
|
|
43
|
+
* and a UTM source/medium/campaign breakdown. Optionally compare against the
|
|
44
|
+
* preceding period of equal length when `attributionWindow` is `IN_RANGE`. Date
|
|
45
|
+
* range is capped at 60 days. Requires scope: web-analytics:view
|
|
46
|
+
*/
|
|
47
|
+
audienceConversion(query, options) {
|
|
48
|
+
return this._client.get('/rest/v1/attribution/audience-conversion', { query, ...options });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compare up to 5 UTM dimension combinations side-by-side for a single conversion
|
|
52
|
+
* event. Each combo returns the unique visitors, sessions, total events, and
|
|
53
|
+
* derived conversion rate for that UTM filter within the window. Requires both
|
|
54
|
+
* `web-analytics:view` and `report:event-count-by-day` API-key scopes. Date range
|
|
55
|
+
* is capped at 31 days. Pass `combos` as a single JSON-encoded array:
|
|
56
|
+
* `combos=[{"utmSource":"google","utmMedium":"cpc"},{"utmSource":"meta"}]`.
|
|
57
|
+
* Requires scope: web-analytics:view
|
|
58
|
+
*/
|
|
59
|
+
utmComparison(query, options) {
|
|
60
|
+
return this._client.get('/rest/v1/attribution/utm-comparison', { query, ...options });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.Attribution = Attribution;
|
|
64
|
+
//# sourceMappingURL=attribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.js","sourceRoot":"","sources":["../src/resources/attribution.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;OAQG;IACH,OAAO,CAAC,KAA+B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CACP,KAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CACR,KAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB,CAChB,KAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa,CACX,KAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;CACF;AAxED,kCAwEC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
export class Attribution extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
6
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
7
|
+
* a first-touch basis for the given date window. Use `from`/`to` to set the
|
|
8
|
+
* analysis window (max 60 days). Optionally filter to a specific UTM combo with
|
|
9
|
+
* `utmSource`, `utmMedium`, etc. The counts represent unique visitors who
|
|
10
|
+
* performed the specified `eventName` and were attributed to each UTM value.
|
|
11
|
+
* Requires scope: web-analytics:view
|
|
12
|
+
*/
|
|
13
|
+
initial(query, options) {
|
|
14
|
+
return this._client.get('/rest/v1/attribution/initial', { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns the top-15 values for each UTM dimension (source, medium, campaign,
|
|
18
|
+
* content, term, name) and referring domain attributed to the conversion event on
|
|
19
|
+
* a last-touch basis for the given date window. Use `from`/`to` to set the
|
|
20
|
+
* analysis window (max 60 days). The counts represent unique visitors who
|
|
21
|
+
* performed the specified `eventName` and were attributed to each UTM value on
|
|
22
|
+
* their most recent session. Requires scope: web-analytics:view
|
|
23
|
+
*/
|
|
24
|
+
lastTouch(query, options) {
|
|
25
|
+
return this._client.get('/rest/v1/attribution/last-touch', { query, ...options });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Multi-touch conversion attribution: returns a source → medium → campaign
|
|
29
|
+
* hierarchy with attributed converter credits distributed according to the
|
|
30
|
+
* selected `attributionModel`. Scoped to all web sources by default; optionally
|
|
31
|
+
* narrow to a single web source via `webSourceId`. Date range is capped at 31
|
|
32
|
+
* days; lookback window is capped at 60 days. Requires scope: web-analytics:view
|
|
33
|
+
*/
|
|
34
|
+
conversion(query, options) {
|
|
35
|
+
return this._client.get('/rest/v1/attribution/conversion', { query, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Audience performance conversion report: returns a summary of converters and
|
|
39
|
+
* conversion rate for the selected event and date window, a per-day timeseries,
|
|
40
|
+
* and a UTM source/medium/campaign breakdown. Optionally compare against the
|
|
41
|
+
* preceding period of equal length when `attributionWindow` is `IN_RANGE`. Date
|
|
42
|
+
* range is capped at 60 days. Requires scope: web-analytics:view
|
|
43
|
+
*/
|
|
44
|
+
audienceConversion(query, options) {
|
|
45
|
+
return this._client.get('/rest/v1/attribution/audience-conversion', { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Compare up to 5 UTM dimension combinations side-by-side for a single conversion
|
|
49
|
+
* event. Each combo returns the unique visitors, sessions, total events, and
|
|
50
|
+
* derived conversion rate for that UTM filter within the window. Requires both
|
|
51
|
+
* `web-analytics:view` and `report:event-count-by-day` API-key scopes. Date range
|
|
52
|
+
* is capped at 31 days. Pass `combos` as a single JSON-encoded array:
|
|
53
|
+
* `combos=[{"utmSource":"google","utmMedium":"cpc"},{"utmSource":"meta"}]`.
|
|
54
|
+
* Requires scope: web-analytics:view
|
|
55
|
+
*/
|
|
56
|
+
utmComparison(query, options) {
|
|
57
|
+
return this._client.get('/rest/v1/attribution/utm-comparison', { query, ...options });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=attribution.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.mjs","sourceRoot":"","sources":["../src/resources/attribution.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;OAQG;IACH,OAAO,CAAC,KAA+B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CACP,KAAiC,EACjC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CACR,KAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;OAMG;IACH,kBAAkB,CAChB,KAA0C,EAC1C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;OAQG;IACH,aAAa,CACX,KAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;CACF"}
|
|
@@ -3007,6 +3007,21 @@ export interface ConsentSettingAnalyticsParams {
|
|
|
3007
3007
|
* fields). Defaults to `false`.
|
|
3008
3008
|
*/
|
|
3009
3009
|
compareWithPreviousPeriod?: boolean;
|
|
3010
|
+
/**
|
|
3011
|
+
* Optional custom comparison-window lower bound, as a UTC calendar day in
|
|
3012
|
+
* `YYYY-MM-DD` format. Provide together with `comparisonTo`; the window between
|
|
3013
|
+
* them must be the same length as `from`–`to` (a mismatch returns `400`). When
|
|
3014
|
+
* omitted (with `compareWithPreviousPeriod=true`), the immediately preceding
|
|
3015
|
+
* equal-length period is used.
|
|
3016
|
+
*/
|
|
3017
|
+
comparisonFrom?: string;
|
|
3018
|
+
/**
|
|
3019
|
+
* Optional custom comparison-window upper bound, as a UTC calendar day in
|
|
3020
|
+
* `YYYY-MM-DD` format. Provide together with `comparisonFrom`; the window must
|
|
3021
|
+
* match the `from`–`to` length. Ignored unless both comparison bounds are
|
|
3022
|
+
* supplied.
|
|
3023
|
+
*/
|
|
3024
|
+
comparisonTo?: string;
|
|
3010
3025
|
/**
|
|
3011
3026
|
* Bucket size for the time-series rollup. `DAILY` (default) buckets per UTC day;
|
|
3012
3027
|
* `HOURLY` buckets per UTC hour and limits the window to 14 days.
|