@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,285 @@
|
|
|
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
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Funnels extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List every funnel configured on this account. Each funnel includes its step
|
|
11
|
+
* configuration, funnel type, conversion window, and current processing status.
|
|
12
|
+
* The available report date range (if any pre-computed reports exist) is returned
|
|
13
|
+
* in `reportDateRange`. Requires scope: web-analytics:view
|
|
14
|
+
*/
|
|
15
|
+
list(options?: RequestOptions): APIPromise<FunnelListResponse> {
|
|
16
|
+
return this._client.get('/rest/v1/funnels', options);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Fetch a single funnel configuration by its id. Returns `404` when the funnel
|
|
21
|
+
* does not exist or belongs to a different account. Requires scope:
|
|
22
|
+
* web-analytics:view
|
|
23
|
+
*/
|
|
24
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<FunnelRetrieveResponse> {
|
|
25
|
+
return this._client.get(path`/rest/v1/funnels/${id}`, options);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Compute funnel step analytics for a funnel over a date window. Returns per-step
|
|
30
|
+
* visitor counts, conversion rates, drop-off rates, average time to next step, and
|
|
31
|
+
* sample session IDs for replay. Funnel results are pre-computed daily from S3;
|
|
32
|
+
* reports outside the `reportDateRange` shown on the funnel config will return
|
|
33
|
+
* empty steps. Requires scope: web-analytics:view
|
|
34
|
+
*/
|
|
35
|
+
results(
|
|
36
|
+
id: string,
|
|
37
|
+
query: FunnelResultsParams,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<FunnelResultsResponse> {
|
|
40
|
+
return this._client.get(path`/rest/v1/funnels/${id}/results`, { query, ...options });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface FunnelListResponse {
|
|
45
|
+
/**
|
|
46
|
+
* All funnels configured on this account.
|
|
47
|
+
*/
|
|
48
|
+
entities: Array<FunnelListResponse.Entity>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export namespace FunnelListResponse {
|
|
52
|
+
export interface Entity {
|
|
53
|
+
createdAt: string;
|
|
54
|
+
|
|
55
|
+
funnelId: string;
|
|
56
|
+
|
|
57
|
+
funnelType: 'SESSION_BASED' | 'VISITOR_BASED';
|
|
58
|
+
|
|
59
|
+
name: string;
|
|
60
|
+
|
|
61
|
+
status: 'READY' | 'PROCESSING';
|
|
62
|
+
|
|
63
|
+
steps: Array<Entity.Step>;
|
|
64
|
+
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
|
|
67
|
+
conversionWindow?: Entity.ConversionWindow | null;
|
|
68
|
+
|
|
69
|
+
countingMethod?: 'UNIQUES' | 'TOTALS' | 'SESSIONS' | null;
|
|
70
|
+
|
|
71
|
+
description?: string | null;
|
|
72
|
+
|
|
73
|
+
reportDateRange?: Entity.ReportDateRange | null;
|
|
74
|
+
|
|
75
|
+
stepOrder?: 'EXACT' | 'ANY' | null;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* UTM filter object (JSON).
|
|
79
|
+
*/
|
|
80
|
+
utmFilters?: unknown;
|
|
81
|
+
|
|
82
|
+
watched?: boolean | null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export namespace Entity {
|
|
86
|
+
export interface Step {
|
|
87
|
+
eventName: string;
|
|
88
|
+
|
|
89
|
+
name: string;
|
|
90
|
+
|
|
91
|
+
order: number;
|
|
92
|
+
|
|
93
|
+
stepId: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Step-level event filters (JSON object).
|
|
97
|
+
*/
|
|
98
|
+
filters?: unknown;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface ConversionWindow {
|
|
102
|
+
unit: 'MINUTES' | 'HOURS' | 'DAYS';
|
|
103
|
+
|
|
104
|
+
value: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface ReportDateRange {
|
|
108
|
+
from: string;
|
|
109
|
+
|
|
110
|
+
to: string;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Funnel configuration details.
|
|
117
|
+
*/
|
|
118
|
+
export interface FunnelRetrieveResponse {
|
|
119
|
+
createdAt: string;
|
|
120
|
+
|
|
121
|
+
funnelId: string;
|
|
122
|
+
|
|
123
|
+
funnelType: 'SESSION_BASED' | 'VISITOR_BASED';
|
|
124
|
+
|
|
125
|
+
name: string;
|
|
126
|
+
|
|
127
|
+
status: 'READY' | 'PROCESSING';
|
|
128
|
+
|
|
129
|
+
steps: Array<FunnelRetrieveResponse.Step>;
|
|
130
|
+
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
|
|
133
|
+
conversionWindow?: FunnelRetrieveResponse.ConversionWindow | null;
|
|
134
|
+
|
|
135
|
+
countingMethod?: 'UNIQUES' | 'TOTALS' | 'SESSIONS' | null;
|
|
136
|
+
|
|
137
|
+
description?: string | null;
|
|
138
|
+
|
|
139
|
+
reportDateRange?: FunnelRetrieveResponse.ReportDateRange | null;
|
|
140
|
+
|
|
141
|
+
stepOrder?: 'EXACT' | 'ANY' | null;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* UTM filter object (JSON).
|
|
145
|
+
*/
|
|
146
|
+
utmFilters?: unknown;
|
|
147
|
+
|
|
148
|
+
watched?: boolean | null;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export namespace FunnelRetrieveResponse {
|
|
152
|
+
export interface Step {
|
|
153
|
+
eventName: string;
|
|
154
|
+
|
|
155
|
+
name: string;
|
|
156
|
+
|
|
157
|
+
order: number;
|
|
158
|
+
|
|
159
|
+
stepId: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Step-level event filters (JSON object).
|
|
163
|
+
*/
|
|
164
|
+
filters?: unknown;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface ConversionWindow {
|
|
168
|
+
unit: 'MINUTES' | 'HOURS' | 'DAYS';
|
|
169
|
+
|
|
170
|
+
value: number;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface ReportDateRange {
|
|
174
|
+
from: string;
|
|
175
|
+
|
|
176
|
+
to: string;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface FunnelResultsResponse {
|
|
181
|
+
/**
|
|
182
|
+
* Conversion rate from first step to last step as a percentage.
|
|
183
|
+
*/
|
|
184
|
+
overallConversionRate: number;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Per-step funnel analytics, ordered by step number.
|
|
188
|
+
*/
|
|
189
|
+
steps: Array<FunnelResultsResponse.Step>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Total number of visitors who entered the funnel (entered step 1).
|
|
193
|
+
*/
|
|
194
|
+
totalVisitors: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Average time from first step to last step in seconds. Null when no completions.
|
|
198
|
+
*/
|
|
199
|
+
overallAvgTimeToConversion?: number | null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export namespace FunnelResultsResponse {
|
|
203
|
+
export interface Step {
|
|
204
|
+
conversionCount: number;
|
|
205
|
+
|
|
206
|
+
conversionRate: number;
|
|
207
|
+
|
|
208
|
+
dropOffRate: number;
|
|
209
|
+
|
|
210
|
+
dropOffSessionIds: Array<string>;
|
|
211
|
+
|
|
212
|
+
overallConversionRate: number;
|
|
213
|
+
|
|
214
|
+
sessionIds: Array<string>;
|
|
215
|
+
|
|
216
|
+
stepNumber: number;
|
|
217
|
+
|
|
218
|
+
visitorCount: number;
|
|
219
|
+
|
|
220
|
+
avgTimeToNextStep?: number | null;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface FunnelResultsParams {
|
|
225
|
+
/**
|
|
226
|
+
* Inclusive lower bound of the analysis window, as a UTC calendar day in
|
|
227
|
+
* `YYYY-MM-DD` format.
|
|
228
|
+
*/
|
|
229
|
+
from: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Inclusive upper bound of the analysis window, as a UTC calendar day in
|
|
233
|
+
* `YYYY-MM-DD` format.
|
|
234
|
+
*/
|
|
235
|
+
to: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Attribution type for UTM filter matching in funnel steps.
|
|
239
|
+
*/
|
|
240
|
+
attributionType?: 'INITIAL' | 'LAST_TOUCH';
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Filter funnel analytics to a specific device type. Defaults to `ALL`.
|
|
244
|
+
*/
|
|
245
|
+
deviceType?: 'DESKTOP' | 'MOBILE' | 'ALL';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Filter by UTM campaign.
|
|
249
|
+
*/
|
|
250
|
+
utmCampaign?: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Filter by UTM content.
|
|
254
|
+
*/
|
|
255
|
+
utmContent?: string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Filter by UTM medium.
|
|
259
|
+
*/
|
|
260
|
+
utmMedium?: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Filter by UTM name.
|
|
264
|
+
*/
|
|
265
|
+
utmName?: string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Filter by UTM source.
|
|
269
|
+
*/
|
|
270
|
+
utmSource?: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Filter by UTM term.
|
|
274
|
+
*/
|
|
275
|
+
utmTerm?: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export declare namespace Funnels {
|
|
279
|
+
export {
|
|
280
|
+
type FunnelListResponse as FunnelListResponse,
|
|
281
|
+
type FunnelRetrieveResponse as FunnelRetrieveResponse,
|
|
282
|
+
type FunnelResultsResponse as FunnelResultsResponse,
|
|
283
|
+
type FunnelResultsParams as FunnelResultsParams,
|
|
284
|
+
};
|
|
285
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -10,6 +10,19 @@ export {
|
|
|
10
10
|
type AllowedEventCreateParams,
|
|
11
11
|
type AllowedEventUpdateParams,
|
|
12
12
|
} from './allowed-events';
|
|
13
|
+
export {
|
|
14
|
+
Attribution,
|
|
15
|
+
type AttributionInitialResponse,
|
|
16
|
+
type AttributionLastTouchResponse,
|
|
17
|
+
type AttributionConversionResponse,
|
|
18
|
+
type AttributionAudienceConversionResponse,
|
|
19
|
+
type AttributionUtmComparisonResponse,
|
|
20
|
+
type AttributionInitialParams,
|
|
21
|
+
type AttributionLastTouchParams,
|
|
22
|
+
type AttributionConversionParams,
|
|
23
|
+
type AttributionAudienceConversionParams,
|
|
24
|
+
type AttributionUtmComparisonParams,
|
|
25
|
+
} from './attribution';
|
|
13
26
|
export {
|
|
14
27
|
ConsentAnalytics,
|
|
15
28
|
type ConsentAnalyticsListResponse,
|
|
@@ -117,6 +130,13 @@ export {
|
|
|
117
130
|
type ExperimentSessionReplaysParams,
|
|
118
131
|
type ExperimentListResponsesCursor,
|
|
119
132
|
} from './experiments';
|
|
133
|
+
export {
|
|
134
|
+
Funnels,
|
|
135
|
+
type FunnelListResponse,
|
|
136
|
+
type FunnelRetrieveResponse,
|
|
137
|
+
type FunnelResultsResponse,
|
|
138
|
+
type FunnelResultsParams,
|
|
139
|
+
} from './funnels';
|
|
120
140
|
export {
|
|
121
141
|
HeatmapPages,
|
|
122
142
|
type HeatmapPageListResponse,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.37.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.37.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.37.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.37.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|