@ogcio/analytics-sdk 0.0.1-beta.4 → 0.1.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/base-client.d.ts +1 -1
- package/dist/base/base-client.d.ts.map +1 -1
- package/dist/base/base-client.js +3 -0
- package/dist/base/base-client.js.map +1 -1
- package/dist/index.d.ts +245 -362
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +275 -73
- package/dist/index.js.map +1 -1
- package/dist/matomo/helpers.d.ts.map +1 -1
- package/dist/matomo/helpers.js +18 -20
- package/dist/matomo/helpers.js.map +1 -1
- package/dist/schema.d.ts +551 -158
- package/dist/schema.d.ts.map +1 -1
- package/dist/support-files/auth/index.d.ts.map +1 -1
- package/dist/support-files/auth/index.js +3 -0
- package/dist/support-files/auth/index.js.map +1 -1
- package/dist/support-files/building-blocks-sdk.d.ts +1 -1
- package/dist/support-files/building-blocks-sdk.d.ts.map +1 -1
- package/dist/support-files/building-blocks-sdk.js +2 -0
- package/dist/support-files/building-blocks-sdk.js.map +1 -1
- package/dist/tests/testUtils/api.mock.handlers.d.ts +2 -0
- package/dist/tests/testUtils/api.mock.handlers.d.ts.map +1 -0
- package/dist/tests/testUtils/api.mock.handlers.js +41 -0
- package/dist/tests/testUtils/api.mock.handlers.js.map +1 -0
- package/dist/tests/testUtils/setup.mock.d.ts +17 -0
- package/dist/tests/testUtils/setup.mock.d.ts.map +1 -0
- package/dist/tests/testUtils/setup.mock.js +82 -0
- package/dist/tests/testUtils/setup.mock.js.map +1 -0
- package/dist/tests/testUtils/wait-request.d.ts +2 -0
- package/dist/tests/testUtils/wait-request.d.ts.map +1 -0
- package/dist/tests/testUtils/wait-request.js +2 -0
- package/dist/tests/testUtils/wait-request.js.map +1 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,10 +9,11 @@ export type CustomDimension = {
|
|
|
9
9
|
export type TrackEndpoints = {
|
|
10
10
|
[K in keyof paths]: K extends `/api/v1/websites/{id}/track-${string}` ? K : never;
|
|
11
11
|
}[keyof paths];
|
|
12
|
-
type
|
|
12
|
+
type BaseTrackingRequest = paths["/api/v1/websites/{id}/track-event"]["post"];
|
|
13
|
+
type WebsiteTrackingContextOverride = NonNullable<BaseTrackingRequest["requestBody"]["content"]["application/json"]["contextOverride"]>;
|
|
13
14
|
export type WebsiteTrackingContext = Omit<WebsiteTrackingContextOverride, "customDimensions"> & {
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
+
* Custom dimensions in format: { 'dimension1': 'value1', 'dimension2': 'value2' }
|
|
16
17
|
* @example {
|
|
17
18
|
* "dimension1": "value1",
|
|
18
19
|
* "dimension2": "value2"
|
|
@@ -20,13 +21,19 @@ export type WebsiteTrackingContext = Omit<WebsiteTrackingContextOverride, "custo
|
|
|
20
21
|
*/
|
|
21
22
|
customDimensions?: CustomDimension;
|
|
22
23
|
};
|
|
23
|
-
export type WebsiteTrackingMetadata =
|
|
24
|
+
export type WebsiteTrackingMetadata = BaseTrackingRequest["requestBody"]["content"]["application/json"]["metadataOverride"];
|
|
25
|
+
export type WebsiteTrackBackendActionResponse = {
|
|
26
|
+
data?: BaseTrackingRequest["responses"]["200" | "201"]["content"]["application/json"]["data"];
|
|
27
|
+
error?: BaseTrackingRequest["responses"]["4XX"]["content"]["application/json"];
|
|
28
|
+
};
|
|
24
29
|
export type AnalyticsOptions = BaseApiClientParams & {
|
|
25
30
|
trackingWebsiteId?: string;
|
|
26
31
|
organizationId?: string;
|
|
27
32
|
matomoToken?: string;
|
|
28
33
|
trackingContext?: WebsiteTrackingContext;
|
|
29
34
|
trackingMetadata?: WebsiteTrackingMetadata;
|
|
35
|
+
dryRun?: boolean;
|
|
36
|
+
optOut?: boolean;
|
|
30
37
|
};
|
|
31
38
|
export type WebsiteConfiguration = paths["/api/v1/websites/{id}"]["get"]["responses"]["200"]["content"]["application/json"]["data"];
|
|
32
39
|
export type WebsiteTrackingCode = paths["/api/v1/websites/{id}/tracking-code"]["get"]["parameters"]["query"];
|
|
@@ -42,17 +49,45 @@ export declare class Analytics extends BaseClient<paths> {
|
|
|
42
49
|
private organizationId?;
|
|
43
50
|
private websiteConfiguration?;
|
|
44
51
|
private websiteConfigurationPromise?;
|
|
45
|
-
constructor({ trackingWebsiteId, organizationId, matomoToken, trackingContext, trackingMetadata, ...baseApiClientOptions }: AnalyticsOptions);
|
|
52
|
+
constructor({ trackingWebsiteId, organizationId, matomoToken, trackingContext, trackingMetadata, dryRun, optOut, ...baseApiClientOptions }: AnalyticsOptions);
|
|
46
53
|
private retrieveWebsiteConfiguration;
|
|
47
54
|
private matomoOnRequestMiddleware;
|
|
48
55
|
private clientRequest;
|
|
49
56
|
private ensureWebsiteConfiguration;
|
|
50
57
|
private trackPush;
|
|
51
58
|
private trackBackendAction;
|
|
59
|
+
/**
|
|
60
|
+
* Updates the Matomo authentication token.
|
|
61
|
+
* The token is optional, and is used to validate some params, during the backend requests.
|
|
62
|
+
* If you don't set the token, the validation will be skipped.
|
|
63
|
+
*
|
|
64
|
+
* @note The token is not used in browser environments.
|
|
65
|
+
*/
|
|
52
66
|
setMatomoToken(matomoToken: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Configures the website ID for tracking purposes
|
|
69
|
+
*
|
|
70
|
+
* When used client-side, this method triggers a background request to fetch the website configuration.
|
|
71
|
+
* The retrieved configuration is then used to initialize the Matomo tracker via the `initClientTracker` method.
|
|
72
|
+
*
|
|
73
|
+
* When used server-side, this method only sets the website ID without making any requests,
|
|
74
|
+
* since configuration retrieval is handled separately on the backend.
|
|
75
|
+
*/
|
|
53
76
|
setTrackingWebsiteId(websiteId: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves the currently configured tracking website ID.
|
|
79
|
+
*/
|
|
54
80
|
getTrackingWebsiteId(): string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Sets metadata that will be included with all subsequent tracking requests.
|
|
83
|
+
* Setting a new value clears and overrides all previous metadata.
|
|
84
|
+
*
|
|
85
|
+
* @note Metadata is only used for backend tracking requests, as the metadata in browser environments are automatically retrieved.
|
|
86
|
+
*/
|
|
55
87
|
setTrackingMetadata(metadata: WebsiteTrackingMetadata): void;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieves the current tracking metadata configuration.
|
|
90
|
+
*/
|
|
56
91
|
getTrackingMetadata(): {
|
|
57
92
|
url?: string;
|
|
58
93
|
userAgent?: string;
|
|
@@ -60,400 +95,248 @@ export declare class Analytics extends BaseClient<paths> {
|
|
|
60
95
|
language?: string;
|
|
61
96
|
screenResolution?: string;
|
|
62
97
|
} | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Removes all configured tracking metadata.
|
|
100
|
+
*/
|
|
101
|
+
clearTrackingMetadata(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Sets the tracking context for all subsequent tracking operations.
|
|
104
|
+
* Setting a new value will clear and override all previously configured context data.
|
|
105
|
+
*
|
|
106
|
+
* @note When used in a browser environment, this will update the Matomo tracker with the provided user ID and custom dimensions.
|
|
107
|
+
*/
|
|
63
108
|
setTrackingContext(context: WebsiteTrackingContext): void;
|
|
109
|
+
/**
|
|
110
|
+
* Clears all tracking context data, including user ID and custom dimensions,
|
|
111
|
+
* from both the internal state and the Matomo tracker.
|
|
112
|
+
*
|
|
113
|
+
* @note When running in a browser environment, this method also clears
|
|
114
|
+
* the user ID and custom dimensions from the Matomo tracker instance.
|
|
115
|
+
*/
|
|
64
116
|
clearTrackingContext(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Retrieves the current tracking context configuration.
|
|
119
|
+
*/
|
|
65
120
|
getTrackingContext(): WebsiteTrackingContext | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Enables or disables dry run mode. When enabled, no request will be sent
|
|
123
|
+
* to the API service, useful for testing and debugging.
|
|
124
|
+
*/
|
|
66
125
|
setDryRun(dryRun: boolean): void;
|
|
126
|
+
/**
|
|
127
|
+
* Enables or disables tracking opt-out. When enabled, the inizialization of the script will be done, but no tracking data will be sent
|
|
128
|
+
* to the analytics service respecting user privacy preferences.
|
|
129
|
+
*/
|
|
67
130
|
setOptOut(optOut: boolean): void;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the current analytics configuration state.
|
|
133
|
+
*/
|
|
68
134
|
getAnalyticsConfig(): {
|
|
69
135
|
dryRun: boolean;
|
|
70
136
|
optOut: boolean;
|
|
71
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* Updates the analytics configuration state.
|
|
140
|
+
*/
|
|
72
141
|
setAnalyticsConfig(config: {
|
|
73
142
|
dryRun: boolean;
|
|
74
143
|
optOut: boolean;
|
|
75
144
|
}): void;
|
|
145
|
+
/**
|
|
146
|
+
* Initializes the Matomo tracker by injecting the tracking script
|
|
147
|
+
* and configuring it with the website configuration of the currently set trackingWebsiteId.
|
|
148
|
+
*
|
|
149
|
+
* @note This method is only available in a browser environment, since it injects the tracking script directly into the HEAD of the document.
|
|
150
|
+
*/
|
|
76
151
|
initClientTracker(overrideConfig?: Partial<WebsiteTrackingCode>): Promise<void>;
|
|
77
152
|
administration: {
|
|
153
|
+
/**
|
|
154
|
+
* Retrieves a list of all configured websites.
|
|
155
|
+
*/
|
|
78
156
|
getWebsites: () => Promise<{
|
|
79
|
-
data
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
updated_at: string;
|
|
101
|
-
}[];
|
|
102
|
-
} | undefined;
|
|
103
|
-
error: undefined;
|
|
104
|
-
} | {
|
|
105
|
-
error: unknown;
|
|
106
|
-
data: undefined;
|
|
157
|
+
data?: {
|
|
158
|
+
siteIds: number[] & number[];
|
|
159
|
+
trackerUrl: string;
|
|
160
|
+
cookieless: boolean;
|
|
161
|
+
bypassAdblockers: boolean;
|
|
162
|
+
trackPageView: boolean;
|
|
163
|
+
linkTracking: boolean;
|
|
164
|
+
heartBeatTimer: number;
|
|
165
|
+
browserFeatureDetection: boolean;
|
|
166
|
+
trackBots: boolean;
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
domain: string;
|
|
170
|
+
organizationId: string;
|
|
171
|
+
createdAt: string;
|
|
172
|
+
updatedAt: string;
|
|
173
|
+
customDimensions: {
|
|
174
|
+
[key: string]: string;
|
|
175
|
+
};
|
|
176
|
+
}[] | undefined;
|
|
177
|
+
error?: WebsiteTrackBackendActionResponse["error"];
|
|
107
178
|
}>;
|
|
179
|
+
/**
|
|
180
|
+
* Retrieves detailed configuration for a specific website.
|
|
181
|
+
*/
|
|
108
182
|
getWebsiteById: (id: paths["/api/v1/websites/{id}"]["get"]["parameters"]["path"]["id"], query?: paths["/api/v1/websites/{id}"]["get"]["parameters"]["query"]) => Promise<{
|
|
109
|
-
data
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
site_ids: number[];
|
|
128
|
-
organization_id: string;
|
|
129
|
-
created_at: string;
|
|
130
|
-
updated_at: string;
|
|
183
|
+
data?: {
|
|
184
|
+
siteIds: number[] & number[];
|
|
185
|
+
trackerUrl: string;
|
|
186
|
+
cookieless: boolean;
|
|
187
|
+
bypassAdblockers: boolean;
|
|
188
|
+
trackPageView: boolean;
|
|
189
|
+
linkTracking: boolean;
|
|
190
|
+
heartBeatTimer: number;
|
|
191
|
+
browserFeatureDetection: boolean;
|
|
192
|
+
trackBots: boolean;
|
|
193
|
+
id: string;
|
|
194
|
+
name: string;
|
|
195
|
+
domain: string;
|
|
196
|
+
organizationId: string;
|
|
197
|
+
createdAt: string;
|
|
198
|
+
updatedAt: string;
|
|
199
|
+
customDimensions: {
|
|
200
|
+
[key: string]: string;
|
|
131
201
|
};
|
|
132
202
|
} | undefined;
|
|
133
|
-
error
|
|
134
|
-
} | {
|
|
135
|
-
error: unknown;
|
|
136
|
-
data: undefined;
|
|
203
|
+
error?: WebsiteTrackBackendActionResponse["error"];
|
|
137
204
|
}>;
|
|
205
|
+
/**
|
|
206
|
+
* Creates a new website configuration
|
|
207
|
+
*/
|
|
138
208
|
createWebsite: (data: paths["/api/v1/websites/"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
139
|
-
data
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
site_ids: number[];
|
|
158
|
-
organization_id: string;
|
|
159
|
-
created_at: string;
|
|
160
|
-
updated_at: string;
|
|
209
|
+
data?: {
|
|
210
|
+
siteIds: number[] & number[];
|
|
211
|
+
trackerUrl: string;
|
|
212
|
+
cookieless: boolean;
|
|
213
|
+
bypassAdblockers: boolean;
|
|
214
|
+
trackPageView: boolean;
|
|
215
|
+
linkTracking: boolean;
|
|
216
|
+
heartBeatTimer: number;
|
|
217
|
+
browserFeatureDetection: boolean;
|
|
218
|
+
trackBots: boolean;
|
|
219
|
+
id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
domain: string;
|
|
222
|
+
organizationId: string;
|
|
223
|
+
createdAt: string;
|
|
224
|
+
updatedAt: string;
|
|
225
|
+
customDimensions: {
|
|
226
|
+
[key: string]: string;
|
|
161
227
|
};
|
|
162
228
|
} | undefined;
|
|
163
|
-
error
|
|
164
|
-
} | {
|
|
165
|
-
error: unknown;
|
|
166
|
-
data: undefined;
|
|
229
|
+
error?: WebsiteTrackBackendActionResponse["error"];
|
|
167
230
|
}>;
|
|
231
|
+
/**
|
|
232
|
+
* Updates an existing website configuration.
|
|
233
|
+
*/
|
|
168
234
|
updateWebsite: (id: paths["/api/v1/websites/{id}"]["patch"]["parameters"]["path"]["id"], data: NonNullable<paths["/api/v1/websites/{id}"]["patch"]["requestBody"]>["content"]["application/json"]) => Promise<{
|
|
169
|
-
data
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
created_at: string;
|
|
188
|
-
updated_at: string;
|
|
235
|
+
data?: {
|
|
236
|
+
siteIds: number[] & number[];
|
|
237
|
+
trackerUrl: string;
|
|
238
|
+
cookieless: boolean;
|
|
239
|
+
bypassAdblockers: boolean;
|
|
240
|
+
trackPageView: boolean;
|
|
241
|
+
linkTracking: boolean;
|
|
242
|
+
heartBeatTimer: number;
|
|
243
|
+
browserFeatureDetection: boolean;
|
|
244
|
+
trackBots: boolean;
|
|
245
|
+
id: string;
|
|
246
|
+
name: string;
|
|
247
|
+
domain: string;
|
|
248
|
+
organizationId: string;
|
|
249
|
+
createdAt: string;
|
|
250
|
+
updatedAt: string;
|
|
251
|
+
customDimensions: {
|
|
252
|
+
[key: string]: string;
|
|
189
253
|
};
|
|
190
254
|
} | undefined;
|
|
191
|
-
error
|
|
192
|
-
} | {
|
|
193
|
-
error: unknown;
|
|
194
|
-
data: undefined;
|
|
255
|
+
error?: WebsiteTrackBackendActionResponse["error"];
|
|
195
256
|
}>;
|
|
196
257
|
};
|
|
197
258
|
generate: {
|
|
259
|
+
/**
|
|
260
|
+
* Generates the JavaScript tracking code for initializing analytics on a website.
|
|
261
|
+
*
|
|
262
|
+
* @note This method is available only on the backend-side
|
|
263
|
+
*/
|
|
198
264
|
initTrackingJsCode: (query: WebsiteTrackingCode) => Promise<{
|
|
199
|
-
data
|
|
200
|
-
|
|
201
|
-
script: string;
|
|
202
|
-
};
|
|
203
|
-
} | undefined;
|
|
204
|
-
error: undefined;
|
|
205
|
-
} | {
|
|
206
|
-
error: unknown;
|
|
207
|
-
data: undefined;
|
|
208
|
-
}>;
|
|
209
|
-
trackEventJsCode: (data: paths["/api/v1/websites/{id}/track-event"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
210
|
-
data: {
|
|
211
|
-
data: unknown;
|
|
212
|
-
} | {
|
|
213
|
-
data: unknown;
|
|
214
|
-
} | {
|
|
215
|
-
data: unknown;
|
|
216
|
-
} | {
|
|
217
|
-
data: unknown;
|
|
218
|
-
} | {
|
|
219
|
-
data: unknown;
|
|
220
|
-
} | {
|
|
221
|
-
data: unknown;
|
|
222
|
-
} | undefined;
|
|
223
|
-
error: undefined;
|
|
224
|
-
} | {
|
|
225
|
-
error: unknown;
|
|
226
|
-
data: undefined;
|
|
227
|
-
}>;
|
|
228
|
-
trackPageViewJsCode: (data: paths["/api/v1/websites/{id}/track-page-view"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
229
|
-
data: {
|
|
230
|
-
data: unknown;
|
|
231
|
-
} | {
|
|
232
|
-
data: unknown;
|
|
233
|
-
} | {
|
|
234
|
-
data: unknown;
|
|
235
|
-
} | {
|
|
236
|
-
data: unknown;
|
|
237
|
-
} | {
|
|
238
|
-
data: unknown;
|
|
239
|
-
} | {
|
|
240
|
-
data: unknown;
|
|
241
|
-
} | undefined;
|
|
242
|
-
error: undefined;
|
|
243
|
-
} | {
|
|
244
|
-
error: unknown;
|
|
245
|
-
data: undefined;
|
|
246
|
-
}>;
|
|
247
|
-
trackSiteSearchJsCode: (data: paths["/api/v1/websites/{id}/track-search"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
248
|
-
data: {
|
|
249
|
-
data: unknown;
|
|
250
|
-
} | {
|
|
251
|
-
data: unknown;
|
|
252
|
-
} | {
|
|
253
|
-
data: unknown;
|
|
254
|
-
} | {
|
|
255
|
-
data: unknown;
|
|
256
|
-
} | {
|
|
257
|
-
data: unknown;
|
|
258
|
-
} | {
|
|
259
|
-
data: unknown;
|
|
265
|
+
data?: {
|
|
266
|
+
script: string;
|
|
260
267
|
} | undefined;
|
|
261
|
-
error
|
|
262
|
-
} | {
|
|
263
|
-
error: unknown;
|
|
264
|
-
data: undefined;
|
|
265
|
-
}>;
|
|
266
|
-
trackLinkJsCode: (data: paths["/api/v1/websites/{id}/track-link"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
267
|
-
data: {
|
|
268
|
-
data: unknown;
|
|
269
|
-
} | {
|
|
270
|
-
data: unknown;
|
|
271
|
-
} | {
|
|
272
|
-
data: unknown;
|
|
273
|
-
} | {
|
|
274
|
-
data: unknown;
|
|
275
|
-
} | {
|
|
276
|
-
data: unknown;
|
|
277
|
-
} | {
|
|
278
|
-
data: unknown;
|
|
279
|
-
} | undefined;
|
|
280
|
-
error: undefined;
|
|
281
|
-
} | {
|
|
282
|
-
error: unknown;
|
|
283
|
-
data: undefined;
|
|
284
|
-
}>;
|
|
285
|
-
trackContentImpressionJsCode: (data: paths["/api/v1/websites/{id}/track-content-impression"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
286
|
-
data: {
|
|
287
|
-
data: unknown;
|
|
288
|
-
} | {
|
|
289
|
-
data: unknown;
|
|
290
|
-
} | {
|
|
291
|
-
data: unknown;
|
|
292
|
-
} | {
|
|
293
|
-
data: unknown;
|
|
294
|
-
} | {
|
|
295
|
-
data: unknown;
|
|
296
|
-
} | {
|
|
297
|
-
data: unknown;
|
|
298
|
-
} | undefined;
|
|
299
|
-
error: undefined;
|
|
300
|
-
} | {
|
|
301
|
-
error: unknown;
|
|
302
|
-
data: undefined;
|
|
303
|
-
}>;
|
|
304
|
-
trackContentInteractionJsCode: (data: paths["/api/v1/websites/{id}/track-content-interaction"]["post"]["requestBody"]["content"]["application/json"]) => Promise<{
|
|
305
|
-
data: {
|
|
306
|
-
data: unknown;
|
|
307
|
-
} | {
|
|
308
|
-
data: unknown;
|
|
309
|
-
} | {
|
|
310
|
-
data: unknown;
|
|
311
|
-
} | {
|
|
312
|
-
data: unknown;
|
|
313
|
-
} | {
|
|
314
|
-
data: unknown;
|
|
315
|
-
} | {
|
|
316
|
-
data: unknown;
|
|
317
|
-
} | undefined;
|
|
318
|
-
error: undefined;
|
|
319
|
-
} | {
|
|
320
|
-
error: unknown;
|
|
321
|
-
data: undefined;
|
|
268
|
+
error?: WebsiteTrackBackendActionResponse["error"];
|
|
322
269
|
}>;
|
|
270
|
+
/**
|
|
271
|
+
* Generates JavaScript code for tracking custom events.
|
|
272
|
+
*
|
|
273
|
+
* @note This method is available only on the backend-side
|
|
274
|
+
*
|
|
275
|
+
*/
|
|
276
|
+
trackEventJsCode: (data: paths["/api/v1/websites/{id}/track-event"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
277
|
+
/**
|
|
278
|
+
* Generates JavaScript code for tracking page views.
|
|
279
|
+
*
|
|
280
|
+
* @note This method is available only on the backend-side
|
|
281
|
+
*
|
|
282
|
+
*/
|
|
283
|
+
trackPageViewJsCode: (data: paths["/api/v1/websites/{id}/track-page-view"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
284
|
+
/**
|
|
285
|
+
* Generates JavaScript code for tracking site searches.
|
|
286
|
+
*
|
|
287
|
+
* @note This method is available only on the backend-side
|
|
288
|
+
*
|
|
289
|
+
*/
|
|
290
|
+
trackSiteSearchJsCode: (data: paths["/api/v1/websites/{id}/track-search"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
291
|
+
/**
|
|
292
|
+
* Generates JavaScript code for tracking link clicks.
|
|
293
|
+
*
|
|
294
|
+
* @note This method is available only on the backend-side
|
|
295
|
+
*
|
|
296
|
+
*/
|
|
297
|
+
trackLinkJsCode: (data: paths["/api/v1/websites/{id}/track-link"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
298
|
+
/**
|
|
299
|
+
* Generates JavaScript code for tracking content impressions.
|
|
300
|
+
*
|
|
301
|
+
* @note This method is available only on the backend-side
|
|
302
|
+
*
|
|
303
|
+
*/
|
|
304
|
+
trackContentImpressionJsCode: (data: paths["/api/v1/websites/{id}/track-content-impression"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
305
|
+
/**
|
|
306
|
+
* Generates JavaScript code for tracking content interactions.
|
|
307
|
+
*
|
|
308
|
+
* @note This method is available only on the backend-side
|
|
309
|
+
*
|
|
310
|
+
*/
|
|
311
|
+
trackContentInteractionJsCode: (data: paths["/api/v1/websites/{id}/track-content-interaction"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
323
312
|
};
|
|
324
313
|
track: {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
error: unknown;
|
|
352
|
-
data?: undefined;
|
|
353
|
-
} | {
|
|
354
|
-
data: {
|
|
355
|
-
data: unknown;
|
|
356
|
-
} | {
|
|
357
|
-
data: unknown;
|
|
358
|
-
} | {
|
|
359
|
-
data: unknown;
|
|
360
|
-
} | {
|
|
361
|
-
data: unknown;
|
|
362
|
-
} | {
|
|
363
|
-
data: unknown;
|
|
364
|
-
} | {
|
|
365
|
-
data: unknown;
|
|
366
|
-
} | undefined;
|
|
367
|
-
error: undefined;
|
|
368
|
-
} | undefined>;
|
|
369
|
-
siteSearch: (data: paths["/api/v1/websites/{id}/track-search"]["post"]["requestBody"]["content"]["application/json"]) => Promise<number | {
|
|
370
|
-
data: string;
|
|
371
|
-
error?: undefined;
|
|
372
|
-
} | {
|
|
373
|
-
error: unknown;
|
|
374
|
-
data?: undefined;
|
|
375
|
-
} | {
|
|
376
|
-
data: {
|
|
377
|
-
data: unknown;
|
|
378
|
-
} | {
|
|
379
|
-
data: unknown;
|
|
380
|
-
} | {
|
|
381
|
-
data: unknown;
|
|
382
|
-
} | {
|
|
383
|
-
data: unknown;
|
|
384
|
-
} | {
|
|
385
|
-
data: unknown;
|
|
386
|
-
} | {
|
|
387
|
-
data: unknown;
|
|
388
|
-
} | undefined;
|
|
389
|
-
error: undefined;
|
|
390
|
-
} | undefined>;
|
|
391
|
-
link: (data: paths["/api/v1/websites/{id}/track-link"]["post"]["requestBody"]["content"]["application/json"]) => Promise<number | {
|
|
392
|
-
data: string;
|
|
393
|
-
error?: undefined;
|
|
394
|
-
} | {
|
|
395
|
-
error: unknown;
|
|
396
|
-
data?: undefined;
|
|
397
|
-
} | {
|
|
398
|
-
data: {
|
|
399
|
-
data: unknown;
|
|
400
|
-
} | {
|
|
401
|
-
data: unknown;
|
|
402
|
-
} | {
|
|
403
|
-
data: unknown;
|
|
404
|
-
} | {
|
|
405
|
-
data: unknown;
|
|
406
|
-
} | {
|
|
407
|
-
data: unknown;
|
|
408
|
-
} | {
|
|
409
|
-
data: unknown;
|
|
410
|
-
} | undefined;
|
|
411
|
-
error: undefined;
|
|
412
|
-
} | undefined>;
|
|
413
|
-
contentImpression: (data: paths["/api/v1/websites/{id}/track-content-impression"]["post"]["requestBody"]["content"]["application/json"]) => Promise<number | {
|
|
414
|
-
data: string;
|
|
415
|
-
error?: undefined;
|
|
416
|
-
} | {
|
|
417
|
-
error: unknown;
|
|
418
|
-
data?: undefined;
|
|
419
|
-
} | {
|
|
420
|
-
data: {
|
|
421
|
-
data: unknown;
|
|
422
|
-
} | {
|
|
423
|
-
data: unknown;
|
|
424
|
-
} | {
|
|
425
|
-
data: unknown;
|
|
426
|
-
} | {
|
|
427
|
-
data: unknown;
|
|
428
|
-
} | {
|
|
429
|
-
data: unknown;
|
|
430
|
-
} | {
|
|
431
|
-
data: unknown;
|
|
432
|
-
} | undefined;
|
|
433
|
-
error: undefined;
|
|
434
|
-
} | undefined>;
|
|
435
|
-
contentInteraction: (data: paths["/api/v1/websites/{id}/track-content-interaction"]["post"]["requestBody"]["content"]["application/json"]) => Promise<number | {
|
|
436
|
-
data: string;
|
|
437
|
-
error?: undefined;
|
|
438
|
-
} | {
|
|
439
|
-
error: unknown;
|
|
440
|
-
data?: undefined;
|
|
441
|
-
} | {
|
|
442
|
-
data: {
|
|
443
|
-
data: unknown;
|
|
444
|
-
} | {
|
|
445
|
-
data: unknown;
|
|
446
|
-
} | {
|
|
447
|
-
data: unknown;
|
|
448
|
-
} | {
|
|
449
|
-
data: unknown;
|
|
450
|
-
} | {
|
|
451
|
-
data: unknown;
|
|
452
|
-
} | {
|
|
453
|
-
data: unknown;
|
|
454
|
-
} | undefined;
|
|
455
|
-
error: undefined;
|
|
456
|
-
} | undefined>;
|
|
314
|
+
/**
|
|
315
|
+
* Tracks custom event
|
|
316
|
+
*/
|
|
317
|
+
event: (data: paths["/api/v1/websites/{id}/track-event"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
318
|
+
/**
|
|
319
|
+
* Tracks page views
|
|
320
|
+
*/
|
|
321
|
+
pageView: (data: paths["/api/v1/websites/{id}/track-page-view"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
322
|
+
/**
|
|
323
|
+
* Tracks site search
|
|
324
|
+
*/
|
|
325
|
+
siteSearch: (data: paths["/api/v1/websites/{id}/track-search"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
326
|
+
/**
|
|
327
|
+
* Tracks link click
|
|
328
|
+
*
|
|
329
|
+
* if linkType is 'link' the link is an outgoing link, if 'download' the link is a download
|
|
330
|
+
*/
|
|
331
|
+
link: (data: paths["/api/v1/websites/{id}/track-link"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
332
|
+
/**
|
|
333
|
+
* Tracks content impression
|
|
334
|
+
*/
|
|
335
|
+
contentImpression: (data: paths["/api/v1/websites/{id}/track-content-impression"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
336
|
+
/**
|
|
337
|
+
* Tracks content interaction
|
|
338
|
+
*/
|
|
339
|
+
contentInteraction: (data: paths["/api/v1/websites/{id}/track-content-interaction"]["post"]["requestBody"]["content"]["application/json"]) => Promise<WebsiteTrackBackendActionResponse>;
|
|
457
340
|
};
|
|
458
341
|
}
|
|
459
342
|
//# sourceMappingURL=index.d.ts.map
|