@appwrite.io/console 18.3.0-rc.1 → 18.3.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/README.md +2 -2
- package/dist/cjs/sdk.js +59 -1095
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +60 -1094
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +59 -1095
- package/package.json +1 -1
- package/types/enums/project-key-scopes.d.ts +1 -3
- package/types/enums/proxy-rule-deployment-resource-type.d.ts +1 -2
- package/types/enums/query-suggestion-resource.d.ts +0 -1
- package/types/enums/usage-event-metric.d.ts +0 -3
- package/types/enums/usage-gauge-metric.d.ts +0 -1
- package/types/index.d.ts +0 -5
- package/types/models.d.ts +25 -141
- package/types/service.d.ts +11 -0
- package/types/services/functions.d.ts +12 -6
- package/types/services/projects.d.ts +7 -4
- package/types/services/push.d.ts +2 -2
- package/types/enums/analytics-dimension.d.ts +0 -24
- package/types/enums/analytics-interval.d.ts +0 -6
- package/types/services/analytics-tracking.d.ts +0 -211
- package/types/services/analytics.d.ts +0 -254
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Analytics auto-tracking helpers.
|
|
3
|
-
*
|
|
4
|
-
* These are hand-written companions to the generated `Analytics` service.
|
|
5
|
-
* The generated service exposes `createEvent(params)` for arbitrary events;
|
|
6
|
-
* this module wires up common auto-tracking behaviours (pageviews, outbound
|
|
7
|
-
* links, downloads, scroll depth, active engagement) on top of it.
|
|
8
|
-
*
|
|
9
|
-
* The tracking helpers accept a plain event-emitter function so they do not
|
|
10
|
-
* hard-couple to the generated `Analytics` class. The emitter adapts this
|
|
11
|
-
* module's option shape to `createEvent`: `url` is required there, and `props`
|
|
12
|
-
* is a flat alternating key/value list rather than an object.
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* const analytics = new Analytics(client);
|
|
16
|
-
* const tracking = new AnalyticsTracking(
|
|
17
|
-
* (name, options) => analytics.createEvent({
|
|
18
|
-
* propertyId: options?.propertyId ?? '<PROPERTY_ID>',
|
|
19
|
-
* name,
|
|
20
|
-
* url: options?.url ?? window.location.href,
|
|
21
|
-
* referrer: options?.referrer,
|
|
22
|
-
* scrollDepth: options?.scrollDepth,
|
|
23
|
-
* engagementTime: options?.engagementTime,
|
|
24
|
-
* props: Object.entries(options?.props ?? {}).flatMap(
|
|
25
|
-
* ([key, value]) => [key, String(value)],
|
|
26
|
-
* ),
|
|
27
|
-
* }),
|
|
28
|
-
* { propertyId: '<PROPERTY_ID>' }
|
|
29
|
-
* );
|
|
30
|
-
* tracking.enableAllAutoTracking();
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* `propertyId` is optional: when set it is merged into the options of every
|
|
34
|
-
* emitted event, so an emitter that forwards `options.propertyId` (as above)
|
|
35
|
-
* picks it up instead of every caller hand-rolling it into the closure.
|
|
36
|
-
* Per-event `propertyId` always wins over the configured default.
|
|
37
|
-
*
|
|
38
|
-
* All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
|
|
39
|
-
* `respectDoNotTrack: false` in the constructor options.
|
|
40
|
-
*
|
|
41
|
-
* Engagement time follows Plausible's model: rather than one total at unload,
|
|
42
|
-
* a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
|
|
43
|
-
* route change, unload). See `enableAutoEngagementTime` for details.
|
|
44
|
-
*
|
|
45
|
-
* Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
|
|
46
|
-
* `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
|
|
47
|
-
* camelCase to match the endpoint's parameter naming. Callers can pass any
|
|
48
|
-
* custom event name; the auto-track methods only own the events they emit
|
|
49
|
-
* themselves.
|
|
50
|
-
*/
|
|
51
|
-
export type AnalyticsEventOptions = {
|
|
52
|
-
props?: Record<string, unknown>;
|
|
53
|
-
url?: string;
|
|
54
|
-
referrer?: string;
|
|
55
|
-
propertyId?: string;
|
|
56
|
-
scrollDepth?: number;
|
|
57
|
-
engagementTime?: number;
|
|
58
|
-
};
|
|
59
|
-
export type AnalyticsEventEmitter = (name: string, options?: AnalyticsEventOptions) => unknown;
|
|
60
|
-
export type AnalyticsTrackingOptions = {
|
|
61
|
-
/**
|
|
62
|
-
* When true (default) the tracker becomes a no-op if `navigator.doNotTrack`
|
|
63
|
-
* is set to `'1'`. Set to false to always fire regardless of the DNT signal.
|
|
64
|
-
*/
|
|
65
|
-
respectDoNotTrack?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Analytics property (or snippet) ID to attach to every emitted event.
|
|
68
|
-
* Optional — omit it when the emitter closure already supplies one. A
|
|
69
|
-
* `propertyId` passed on an individual event takes precedence.
|
|
70
|
-
*/
|
|
71
|
-
propertyId?: string;
|
|
72
|
-
};
|
|
73
|
-
export type OutboundTrackingOptions = {
|
|
74
|
-
/**
|
|
75
|
-
* When true, links pointing at the current host's subdomains are treated
|
|
76
|
-
* as outbound. Defaults to false (subdomains are same-origin for tracking).
|
|
77
|
-
*/
|
|
78
|
-
includeSubdomains?: boolean;
|
|
79
|
-
};
|
|
80
|
-
export type DownloadTrackingOptions = {
|
|
81
|
-
/**
|
|
82
|
-
* File extensions (without the leading dot) that mark an anchor as a
|
|
83
|
-
* download. Defaults cover the common set.
|
|
84
|
-
*/
|
|
85
|
-
extensions?: string[];
|
|
86
|
-
};
|
|
87
|
-
export declare class AnalyticsTracking {
|
|
88
|
-
private readonly emit;
|
|
89
|
-
private readonly respectDoNotTrack;
|
|
90
|
-
private readonly propertyId?;
|
|
91
|
-
private pageviewCleanups;
|
|
92
|
-
private outboundCleanup?;
|
|
93
|
-
private downloadCleanup?;
|
|
94
|
-
private scrollCleanups;
|
|
95
|
-
private engagementCleanups;
|
|
96
|
-
private currentPath?;
|
|
97
|
-
private maxScrollDepth;
|
|
98
|
-
private scrollTicking;
|
|
99
|
-
private lastScrollReport;
|
|
100
|
-
private engagementStart;
|
|
101
|
-
private engagementAccumulatedMs;
|
|
102
|
-
private engagementActive;
|
|
103
|
-
constructor(emit: AnalyticsEventEmitter, options?: AnalyticsTrackingOptions);
|
|
104
|
-
/**
|
|
105
|
-
* Enable the opinionated default auto-tracking set: pageviews, outbound
|
|
106
|
-
* links, scroll depth and active engagement time. Downloads must be opted
|
|
107
|
-
* into separately via `enableAutoDownloadTracking()` because the extension
|
|
108
|
-
* list is application-specific.
|
|
109
|
-
*/
|
|
110
|
-
enableAllAutoTracking(): void;
|
|
111
|
-
/**
|
|
112
|
-
* Track an event manually. Respects the DNT setting and swallows emitter
|
|
113
|
-
* exceptions so tracking failures never surface to the host page.
|
|
114
|
-
*/
|
|
115
|
-
track(name: string, options?: AnalyticsEventOptions): void;
|
|
116
|
-
/**
|
|
117
|
-
* Convenience wrapper for pageview-shaped events.
|
|
118
|
-
*/
|
|
119
|
-
pageview(url?: string, referrer?: string): void;
|
|
120
|
-
/**
|
|
121
|
-
* Enable SPA-aware pageview tracking. Fires an initial pageview on
|
|
122
|
-
* enable, then again on every `pushState`, `replaceState`, `popstate`
|
|
123
|
-
* or hashchange. Idempotent — repeat calls no-op.
|
|
124
|
-
*/
|
|
125
|
-
enableAutoPageviews(): void;
|
|
126
|
-
/**
|
|
127
|
-
* Disable auto-pageview tracking installed by `enableAutoPageviews`.
|
|
128
|
-
* Safe to call when auto-pageviews were never enabled.
|
|
129
|
-
*/
|
|
130
|
-
disableAutoPageviews(): void;
|
|
131
|
-
/**
|
|
132
|
-
* Enable click-based outbound link tracking. Detects anchor clicks that
|
|
133
|
-
* navigate to a different origin and fires an `outbound_link` event
|
|
134
|
-
* (with `hostname` and `href` props) before the browser navigates.
|
|
135
|
-
*/
|
|
136
|
-
enableAutoOutboundTracking(options?: OutboundTrackingOptions): void;
|
|
137
|
-
/**
|
|
138
|
-
* Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
|
|
139
|
-
* Safe to call when auto-outbound was never enabled.
|
|
140
|
-
*/
|
|
141
|
-
disableAutoOutboundTracking(): void;
|
|
142
|
-
/**
|
|
143
|
-
* Enable click-based download tracking. Detects anchor clicks that point
|
|
144
|
-
* at a file whose extension appears in the configured list and fires a
|
|
145
|
-
* `file_download` event with `filename`, `extension` and `href` props.
|
|
146
|
-
*/
|
|
147
|
-
enableAutoDownloadTracking(options?: DownloadTrackingOptions): void;
|
|
148
|
-
/**
|
|
149
|
-
* Disable file-download tracking installed by `enableAutoDownloadTracking`.
|
|
150
|
-
* Safe to call when auto-download was never enabled.
|
|
151
|
-
*/
|
|
152
|
-
disableAutoDownloadTracking(): void;
|
|
153
|
-
/**
|
|
154
|
-
* Enable passive scroll-depth tracking. Records the maximum percent of the
|
|
155
|
-
* document scrolled and reports it on `beforeunload` and on SPA route
|
|
156
|
-
* changes. Uses a throttled passive listener so it is safe on hot paths.
|
|
157
|
-
*/
|
|
158
|
-
enableAutoScrollDepth(): void;
|
|
159
|
-
/**
|
|
160
|
-
* Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
|
|
161
|
-
* to call when auto-scroll-depth was never enabled. Any accumulated depth
|
|
162
|
-
* for the current page is dropped.
|
|
163
|
-
*/
|
|
164
|
-
disableAutoScrollDepth(): void;
|
|
165
|
-
/**
|
|
166
|
-
* Enable active engagement-time tracking. Counts time the tab is visible
|
|
167
|
-
* and uses `visibilitychange` to exclude background time.
|
|
168
|
-
*
|
|
169
|
-
* Delivery follows Plausible's model rather than a single total at the
|
|
170
|
-
* end of the visit: an `engagement_time` event is emitted at every natural
|
|
171
|
-
* checkpoint — the tab going hidden, an SPA route change, and finally
|
|
172
|
-
* `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
|
|
173
|
-
* flush; it is the least reliable moment to send anything (browsers
|
|
174
|
-
* routinely cancel in-flight requests there, and `sendBeacon` cannot set
|
|
175
|
-
* the `X-Appwrite-Project` header the endpoint requires), so it must never
|
|
176
|
-
* be the only delivery.
|
|
177
|
-
*
|
|
178
|
-
* Each event carries a **delta** — the seconds accrued since the previous
|
|
179
|
-
* flush, not a running total — so the values are additive per session and
|
|
180
|
-
* a lost event costs only its own slice.
|
|
181
|
-
*
|
|
182
|
-
* There is deliberately no periodic ping. The cadence is driven by
|
|
183
|
-
* navigation and tab switches, so request volume tracks what the visitor
|
|
184
|
-
* actually does instead of multiplying with time on page.
|
|
185
|
-
*/
|
|
186
|
-
enableAutoEngagementTime(): void;
|
|
187
|
-
/**
|
|
188
|
-
* Disable engagement-time tracking installed by `enableAutoEngagementTime`.
|
|
189
|
-
* Safe to call when auto-engagement was never enabled. Any accumulated
|
|
190
|
-
* engagement time is dropped without being emitted.
|
|
191
|
-
*/
|
|
192
|
-
disableAutoEngagementTime(): void;
|
|
193
|
-
/**
|
|
194
|
-
* Merge the configured `propertyId` into an event's options. Returns the
|
|
195
|
-
* caller's object untouched when no default is configured (or the event
|
|
196
|
-
* already carries one), so emitters written against the pre-`propertyId`
|
|
197
|
-
* shape keep receiving exactly what they received before.
|
|
198
|
-
*/
|
|
199
|
-
private withPropertyId;
|
|
200
|
-
private canTrack;
|
|
201
|
-
private currentPageUrl;
|
|
202
|
-
private findAnchor;
|
|
203
|
-
private parseUrl;
|
|
204
|
-
private isExternal;
|
|
205
|
-
private rootDomain;
|
|
206
|
-
private computeScrollDepth;
|
|
207
|
-
private flushScrollDepth;
|
|
208
|
-
private startEngagement;
|
|
209
|
-
private pauseEngagement;
|
|
210
|
-
private flushEngagement;
|
|
211
|
-
}
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { Client } from '../client';
|
|
2
|
-
import type { Models } from '../models';
|
|
3
|
-
import { AnalyticsInterval } from '../enums/analytics-interval';
|
|
4
|
-
import { AnalyticsDimension } from '../enums/analytics-dimension';
|
|
5
|
-
export declare class Analytics {
|
|
6
|
-
client: Client;
|
|
7
|
-
constructor(client: Client);
|
|
8
|
-
/**
|
|
9
|
-
* List analytics properties for the current project.
|
|
10
|
-
*
|
|
11
|
-
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, domain, timezone, enabled, public, snippetId
|
|
12
|
-
* @param {string} params.search - Search term to filter your list results. Matches the property ID, name and domain. Max length: 256 chars.
|
|
13
|
-
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
14
|
-
* @throws {AppwriteException}
|
|
15
|
-
* @returns {Promise<Models.AnalyticsPropertyList>}
|
|
16
|
-
*/
|
|
17
|
-
listProperties(params?: {
|
|
18
|
-
queries?: string[];
|
|
19
|
-
search?: string;
|
|
20
|
-
total?: boolean;
|
|
21
|
-
}): Promise<Models.AnalyticsPropertyList>;
|
|
22
|
-
/**
|
|
23
|
-
* List analytics properties for the current project.
|
|
24
|
-
*
|
|
25
|
-
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, domain, timezone, enabled, public, snippetId
|
|
26
|
-
* @param {string} search - Search term to filter your list results. Matches the property ID, name and domain. Max length: 256 chars.
|
|
27
|
-
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
28
|
-
* @throws {AppwriteException}
|
|
29
|
-
* @returns {Promise<Models.AnalyticsPropertyList>}
|
|
30
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
31
|
-
*/
|
|
32
|
-
listProperties(queries?: string[], search?: string, total?: boolean): Promise<Models.AnalyticsPropertyList>;
|
|
33
|
-
/**
|
|
34
|
-
* Create a new analytics property to track a website or application.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} params.propertyId - Unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Max length is 36 chars.
|
|
37
|
-
* @param {string} params.name - Human-readable name for this property.
|
|
38
|
-
* @param {string} params.domain - Primary domain to track (e.g. example.com). Optional for native apps.
|
|
39
|
-
* @param {string} params.timezone - IANA timezone used for daily boundaries.
|
|
40
|
-
* @param {boolean} params.enabled - Whether tracking is enabled.
|
|
41
|
-
* @param {boolean} params.xpublic - Whether stats are publicly viewable.
|
|
42
|
-
* @param {string[]} params.allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all.
|
|
43
|
-
* @throws {AppwriteException}
|
|
44
|
-
* @returns {Promise<Models.AnalyticsProperty>}
|
|
45
|
-
*/
|
|
46
|
-
createProperty(params: {
|
|
47
|
-
propertyId: string;
|
|
48
|
-
name: string;
|
|
49
|
-
domain?: string;
|
|
50
|
-
timezone?: string;
|
|
51
|
-
enabled?: boolean;
|
|
52
|
-
xpublic?: boolean;
|
|
53
|
-
allowedOrigins?: string[];
|
|
54
|
-
}): Promise<Models.AnalyticsProperty>;
|
|
55
|
-
/**
|
|
56
|
-
* Create a new analytics property to track a website or application.
|
|
57
|
-
*
|
|
58
|
-
* @param {string} propertyId - Unique ID. Choose a custom ID or generate a random ID with `ID.unique()`. Max length is 36 chars.
|
|
59
|
-
* @param {string} name - Human-readable name for this property.
|
|
60
|
-
* @param {string} domain - Primary domain to track (e.g. example.com). Optional for native apps.
|
|
61
|
-
* @param {string} timezone - IANA timezone used for daily boundaries.
|
|
62
|
-
* @param {boolean} enabled - Whether tracking is enabled.
|
|
63
|
-
* @param {boolean} xpublic - Whether stats are publicly viewable.
|
|
64
|
-
* @param {string[]} allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all.
|
|
65
|
-
* @throws {AppwriteException}
|
|
66
|
-
* @returns {Promise<Models.AnalyticsProperty>}
|
|
67
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
68
|
-
*/
|
|
69
|
-
createProperty(propertyId: string, name: string, domain?: string, timezone?: string, enabled?: boolean, xpublic?: boolean, allowedOrigins?: string[]): Promise<Models.AnalyticsProperty>;
|
|
70
|
-
/**
|
|
71
|
-
* Get an analytics property by ID.
|
|
72
|
-
*
|
|
73
|
-
* @param {string} params.propertyId - Analytics property unique ID.
|
|
74
|
-
* @throws {AppwriteException}
|
|
75
|
-
* @returns {Promise<Models.AnalyticsProperty>}
|
|
76
|
-
*/
|
|
77
|
-
getProperty(params: {
|
|
78
|
-
propertyId: string;
|
|
79
|
-
}): Promise<Models.AnalyticsProperty>;
|
|
80
|
-
/**
|
|
81
|
-
* Get an analytics property by ID.
|
|
82
|
-
*
|
|
83
|
-
* @param {string} propertyId - Analytics property unique ID.
|
|
84
|
-
* @throws {AppwriteException}
|
|
85
|
-
* @returns {Promise<Models.AnalyticsProperty>}
|
|
86
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
87
|
-
*/
|
|
88
|
-
getProperty(propertyId: string): Promise<Models.AnalyticsProperty>;
|
|
89
|
-
/**
|
|
90
|
-
* Update an analytics property. Only the attributes you pass are changed; omitted attributes keep their current value.
|
|
91
|
-
*
|
|
92
|
-
* @param {string} params.propertyId - Analytics property unique ID.
|
|
93
|
-
* @param {string} params.name - Human-readable name for this property.
|
|
94
|
-
* @param {string} params.domain - Primary domain to track (e.g. example.com). Pass an empty string to clear it.
|
|
95
|
-
* @param {string} params.timezone - IANA timezone used for daily boundaries.
|
|
96
|
-
* @param {boolean} params.enabled - Whether tracking is enabled.
|
|
97
|
-
* @param {boolean} params.xpublic - Whether stats are publicly viewable.
|
|
98
|
-
* @param {string[]} params.allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all.
|
|
99
|
-
* @throws {AppwriteException}
|
|
100
|
-
* @returns {Promise<Models.AnalyticsProperty>}
|
|
101
|
-
*/
|
|
102
|
-
updateProperty(params: {
|
|
103
|
-
propertyId: string;
|
|
104
|
-
name?: string;
|
|
105
|
-
domain?: string;
|
|
106
|
-
timezone?: string;
|
|
107
|
-
enabled?: boolean;
|
|
108
|
-
xpublic?: boolean;
|
|
109
|
-
allowedOrigins?: string[];
|
|
110
|
-
}): Promise<Models.AnalyticsProperty>;
|
|
111
|
-
/**
|
|
112
|
-
* Update an analytics property. Only the attributes you pass are changed; omitted attributes keep their current value.
|
|
113
|
-
*
|
|
114
|
-
* @param {string} propertyId - Analytics property unique ID.
|
|
115
|
-
* @param {string} name - Human-readable name for this property.
|
|
116
|
-
* @param {string} domain - Primary domain to track (e.g. example.com). Pass an empty string to clear it.
|
|
117
|
-
* @param {string} timezone - IANA timezone used for daily boundaries.
|
|
118
|
-
* @param {boolean} enabled - Whether tracking is enabled.
|
|
119
|
-
* @param {boolean} xpublic - Whether stats are publicly viewable.
|
|
120
|
-
* @param {string[]} allowedOrigins - Allowed origins for tracking. Use ["*"] to allow all.
|
|
121
|
-
* @throws {AppwriteException}
|
|
122
|
-
* @returns {Promise<Models.AnalyticsProperty>}
|
|
123
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
124
|
-
*/
|
|
125
|
-
updateProperty(propertyId: string, name?: string, domain?: string, timezone?: string, enabled?: boolean, xpublic?: boolean, allowedOrigins?: string[]): Promise<Models.AnalyticsProperty>;
|
|
126
|
-
/**
|
|
127
|
-
* Delete an analytics property along with every event and session collected for it. This cannot be undone.
|
|
128
|
-
*
|
|
129
|
-
* @param {string} params.propertyId - Analytics property unique ID.
|
|
130
|
-
* @throws {AppwriteException}
|
|
131
|
-
* @returns {Promise<{}>}
|
|
132
|
-
*/
|
|
133
|
-
deleteProperty(params: {
|
|
134
|
-
propertyId: string;
|
|
135
|
-
}): Promise<{}>;
|
|
136
|
-
/**
|
|
137
|
-
* Delete an analytics property along with every event and session collected for it. This cannot be undone.
|
|
138
|
-
*
|
|
139
|
-
* @param {string} propertyId - Analytics property unique ID.
|
|
140
|
-
* @throws {AppwriteException}
|
|
141
|
-
* @returns {Promise<{}>}
|
|
142
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
143
|
-
*/
|
|
144
|
-
deleteProperty(propertyId: string): Promise<{}>;
|
|
145
|
-
/**
|
|
146
|
-
* Send a tracking event from a browser, native app, or server-side SDK.
|
|
147
|
-
*
|
|
148
|
-
* @param {string} params.propertyId - Analytics property ID or snippet ID identifying the property.
|
|
149
|
-
* @param {string} params.name - Event name. "pageview" is just a conventional event name; events are not modeled specially.
|
|
150
|
-
* @param {string} params.url - Full page URL or screen identifier.
|
|
151
|
-
* @param {string} params.domain - Hostname (e.g. example.com).
|
|
152
|
-
* @param {string} params.referrer - Referrer URL.
|
|
153
|
-
* @param {number} params.screenWidth - Viewport width in CSS pixels.
|
|
154
|
-
* @param {string} params.sessionHash - Optional session hash (provided by SDK).
|
|
155
|
-
* @param {number} params.scrollDepth - Scroll depth percentage 0-100.
|
|
156
|
-
* @param {number} params.engagementTime - Engagement time in seconds, 0-4294967295.
|
|
157
|
-
* @param {string[]} params.props - Custom string properties as a flat key=value list (max 32 entries, alternating key,value).
|
|
158
|
-
* @param {string} params.userId - Override user ID. Requires API-key auth with analytics.write scope.
|
|
159
|
-
* @param {string} params.ip - Override IP address. Requires API-key auth with analytics.write scope.
|
|
160
|
-
* @param {string} params.userAgent - Override user agent. Requires API-key auth with analytics.write scope.
|
|
161
|
-
* @throws {AppwriteException}
|
|
162
|
-
* @returns {Promise<{}>}
|
|
163
|
-
*/
|
|
164
|
-
createEvent(params: {
|
|
165
|
-
propertyId: string;
|
|
166
|
-
name: string;
|
|
167
|
-
url: string;
|
|
168
|
-
domain?: string;
|
|
169
|
-
referrer?: string;
|
|
170
|
-
screenWidth?: number;
|
|
171
|
-
sessionHash?: string;
|
|
172
|
-
scrollDepth?: number;
|
|
173
|
-
engagementTime?: number;
|
|
174
|
-
props?: string[];
|
|
175
|
-
userId?: string;
|
|
176
|
-
ip?: string;
|
|
177
|
-
userAgent?: string;
|
|
178
|
-
}): Promise<{}>;
|
|
179
|
-
/**
|
|
180
|
-
* Send a tracking event from a browser, native app, or server-side SDK.
|
|
181
|
-
*
|
|
182
|
-
* @param {string} propertyId - Analytics property ID or snippet ID identifying the property.
|
|
183
|
-
* @param {string} name - Event name. "pageview" is just a conventional event name; events are not modeled specially.
|
|
184
|
-
* @param {string} url - Full page URL or screen identifier.
|
|
185
|
-
* @param {string} domain - Hostname (e.g. example.com).
|
|
186
|
-
* @param {string} referrer - Referrer URL.
|
|
187
|
-
* @param {number} screenWidth - Viewport width in CSS pixels.
|
|
188
|
-
* @param {string} sessionHash - Optional session hash (provided by SDK).
|
|
189
|
-
* @param {number} scrollDepth - Scroll depth percentage 0-100.
|
|
190
|
-
* @param {number} engagementTime - Engagement time in seconds, 0-4294967295.
|
|
191
|
-
* @param {string[]} props - Custom string properties as a flat key=value list (max 32 entries, alternating key,value).
|
|
192
|
-
* @param {string} userId - Override user ID. Requires API-key auth with analytics.write scope.
|
|
193
|
-
* @param {string} ip - Override IP address. Requires API-key auth with analytics.write scope.
|
|
194
|
-
* @param {string} userAgent - Override user agent. Requires API-key auth with analytics.write scope.
|
|
195
|
-
* @throws {AppwriteException}
|
|
196
|
-
* @returns {Promise<{}>}
|
|
197
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
198
|
-
*/
|
|
199
|
-
createEvent(propertyId: string, name: string, url: string, domain?: string, referrer?: string, screenWidth?: number, sessionHash?: string, scrollDepth?: number, engagementTime?: number, props?: string[], userId?: string, ip?: string, userAgent?: string): Promise<{}>;
|
|
200
|
-
/**
|
|
201
|
-
* Read analytics metrics (visitors, sessions, pageviews, events, bounceRate, …) for a property over a date range.
|
|
202
|
-
*
|
|
203
|
-
* **Three response shapes**, chosen by `dimensions[]` and `interval`:
|
|
204
|
-
* - Neither: one row aggregating the whole window, with `value` and `date` null. Only this shape carries `pageviews`, `visits`, `bounceRate`, `visitDuration`, `viewsPerVisit`, `scrollDepth` and `engagementTime`.
|
|
205
|
-
* - `dimensions[]`: one row per dimension value, ranked by visitors, with `value` set and `date` null.
|
|
206
|
-
* - `interval`: one row per time bucket in chronological order, with `date` set and `value` null.
|
|
207
|
-
*
|
|
208
|
-
* Combining `dimensions[]` with `interval` is not supported yet. `queries[]` filters the underlying events using standard Utopia query syntax.
|
|
209
|
-
*
|
|
210
|
-
* @param {string} params.propertyId - Analytics property unique ID.
|
|
211
|
-
* @param {string[]} params.queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: country, region, city, browser, operatingSystem, device, screenSize, referrerSource, channel, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, page, hostname, botName, botCategory, eventName. page, eventName are only accepted alongside `interval`, or with a breakdown on a dimension other than entryPage, exitPage. Allowed methods: equal, notEqual, contains, startsWith, endsWith. Example: `queries[]=equal("country", ["US"])`.
|
|
212
|
-
* @param {AnalyticsInterval} params.interval - Time bucket size. Omit (null) for a flat aggregate over the whole window. Allowed: 1h, 1d, 1w, 1m.
|
|
213
|
-
* @param {AnalyticsDimension[]} params.dimensions - Dimension to break the metrics down by. One at most for now; the parameter is a list so that cap can be raised without a breaking change. Allowed: country, region, city, browser, operatingSystem, device, screenSize, referrerSource, channel, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, page, hostname, entryPage, exitPage, trafficType, botName, botCategory, eventName.
|
|
214
|
-
* @param {string} params.dateRange - Date range shorthand (e.g. 7d, 30d). Ignored for any bound you supply explicitly via startAt/endAt.
|
|
215
|
-
* @param {string} params.startAt - Explicit window start in ISO 8601. Defaults to endAt minus dateRange.
|
|
216
|
-
* @param {string} params.endAt - Explicit window end in ISO 8601. Defaults to the current time.
|
|
217
|
-
* @param {number} params.limit - Maximum number of ranked values to return.
|
|
218
|
-
* @throws {AppwriteException}
|
|
219
|
-
* @returns {Promise<Models.AnalyticsMetricList>}
|
|
220
|
-
*/
|
|
221
|
-
listMetrics(params: {
|
|
222
|
-
propertyId: string;
|
|
223
|
-
queries?: string[];
|
|
224
|
-
interval?: AnalyticsInterval;
|
|
225
|
-
dimensions?: AnalyticsDimension[];
|
|
226
|
-
dateRange?: string;
|
|
227
|
-
startAt?: string;
|
|
228
|
-
endAt?: string;
|
|
229
|
-
limit?: number;
|
|
230
|
-
}): Promise<Models.AnalyticsMetricList>;
|
|
231
|
-
/**
|
|
232
|
-
* Read analytics metrics (visitors, sessions, pageviews, events, bounceRate, …) for a property over a date range.
|
|
233
|
-
*
|
|
234
|
-
* **Three response shapes**, chosen by `dimensions[]` and `interval`:
|
|
235
|
-
* - Neither: one row aggregating the whole window, with `value` and `date` null. Only this shape carries `pageviews`, `visits`, `bounceRate`, `visitDuration`, `viewsPerVisit`, `scrollDepth` and `engagementTime`.
|
|
236
|
-
* - `dimensions[]`: one row per dimension value, ranked by visitors, with `value` set and `date` null.
|
|
237
|
-
* - `interval`: one row per time bucket in chronological order, with `date` set and `value` null.
|
|
238
|
-
*
|
|
239
|
-
* Combining `dimensions[]` with `interval` is not supported yet. `queries[]` filters the underlying events using standard Utopia query syntax.
|
|
240
|
-
*
|
|
241
|
-
* @param {string} propertyId - Analytics property unique ID.
|
|
242
|
-
* @param {string[]} queries - Up to 10 filter queries in Utopia syntax. Allowed attributes: country, region, city, browser, operatingSystem, device, screenSize, referrerSource, channel, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, page, hostname, botName, botCategory, eventName. page, eventName are only accepted alongside `interval`, or with a breakdown on a dimension other than entryPage, exitPage. Allowed methods: equal, notEqual, contains, startsWith, endsWith. Example: `queries[]=equal("country", ["US"])`.
|
|
243
|
-
* @param {AnalyticsInterval} interval - Time bucket size. Omit (null) for a flat aggregate over the whole window. Allowed: 1h, 1d, 1w, 1m.
|
|
244
|
-
* @param {AnalyticsDimension[]} dimensions - Dimension to break the metrics down by. One at most for now; the parameter is a list so that cap can be raised without a breaking change. Allowed: country, region, city, browser, operatingSystem, device, screenSize, referrerSource, channel, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, page, hostname, entryPage, exitPage, trafficType, botName, botCategory, eventName.
|
|
245
|
-
* @param {string} dateRange - Date range shorthand (e.g. 7d, 30d). Ignored for any bound you supply explicitly via startAt/endAt.
|
|
246
|
-
* @param {string} startAt - Explicit window start in ISO 8601. Defaults to endAt minus dateRange.
|
|
247
|
-
* @param {string} endAt - Explicit window end in ISO 8601. Defaults to the current time.
|
|
248
|
-
* @param {number} limit - Maximum number of ranked values to return.
|
|
249
|
-
* @throws {AppwriteException}
|
|
250
|
-
* @returns {Promise<Models.AnalyticsMetricList>}
|
|
251
|
-
* @deprecated Use the object parameter style method for a better developer experience.
|
|
252
|
-
*/
|
|
253
|
-
listMetrics(propertyId: string, queries?: string[], interval?: AnalyticsInterval, dimensions?: AnalyticsDimension[], dateRange?: string, startAt?: string, endAt?: string, limit?: number): Promise<Models.AnalyticsMetricList>;
|
|
254
|
-
}
|