@walkeros/web-destination-amplitude 3.4.2 → 4.0.0-next-1777882869103
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 +13 -13
- package/dist/dev.d.mts +8 -8
- package/dist/dev.d.ts +8 -8
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +8 -8
- package/dist/examples/index.d.ts +8 -8
- package/dist/examples/index.js +32 -27
- package/dist/examples/index.mjs +32 -27
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +36 -148
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[NPM Package](https://www.npmjs.com/package/@walkeros/web-destination-amplitude)
|
|
12
12
|
• [Documentation](https://www.walkeros.io/docs/destinations/web/amplitude)
|
|
13
13
|
|
|
14
|
-
This package forwards walkerOS events to [Amplitude](https://amplitude.com/)
|
|
14
|
+
This package forwards walkerOS events to [Amplitude](https://amplitude.com/) -
|
|
15
15
|
product analytics with identity, revenue, groups, and optional session replay,
|
|
16
16
|
experiments, and guides & surveys. Built on the official
|
|
17
17
|
[`@amplitude/unified`](https://www.npmjs.com/package/@amplitude/unified) SDK
|
|
@@ -23,23 +23,23 @@ forwards them as Amplitude track, identify, revenue, group, and consent calls.
|
|
|
23
23
|
|
|
24
24
|
## Features
|
|
25
25
|
|
|
26
|
-
- **Default event forwarding**
|
|
26
|
+
- **Default event forwarding** - every walkerOS event becomes
|
|
27
27
|
`amplitude.track(name, event_properties)` with no additional config
|
|
28
|
-
- **Custom event properties**
|
|
28
|
+
- **Custom event properties** - flatten walkerOS event sections
|
|
29
29
|
(`settings.include`) or map freely via the standard walkerOS `mapping.data`
|
|
30
30
|
DSL
|
|
31
|
-
- **Identity**
|
|
31
|
+
- **Identity** - destination-level and per-event `settings.identify` with the
|
|
32
32
|
full Amplitude operation vocabulary (`set`, `setOnce`, `add`, `append`,
|
|
33
33
|
`prepend`, `preInsert`, `postInsert`, `remove`, `unset`, `clearAll`). Runtime
|
|
34
34
|
state diffing skips redundant setter calls.
|
|
35
|
-
- **Revenue**
|
|
35
|
+
- **Revenue** - `settings.revenue` supports both single-object and `loop`-based
|
|
36
36
|
multi-product orders. Currency defaults to `"EUR"`.
|
|
37
|
-
- **Groups**
|
|
38
|
-
- **Consent**
|
|
37
|
+
- **Groups** - `settings.group` and `settings.groupIdentify` for B2B flows
|
|
38
|
+
- **Consent** - `on('consent')` handler derives the consent keys from
|
|
39
39
|
`config.consent` and toggles `amplitude.setOptOut()`
|
|
40
40
|
- **Optional plugins** (all npm-bundled via `@amplitude/unified`, opt-in via
|
|
41
41
|
settings): Session Replay, Feature Experiments, Engagement (Guides & Surveys)
|
|
42
|
-
- **Async init**
|
|
42
|
+
- **Async init** - awaits `amplitude.initAll(...)` so downstream pushes are
|
|
43
43
|
truly ready before returning
|
|
44
44
|
|
|
45
45
|
> **Bundle cost:** All three plugin packages are statically imported and
|
|
@@ -98,7 +98,7 @@ All fields of Amplitude's `BrowserOptions` pass through to
|
|
|
98
98
|
| `revenue` | `Mapping.Value` | Resolves to a single object or (via `loop`) an array, each with `productId`, `price`, `quantity`, `revenueType`, `currency`, `revenue`, `receipt`, `receiptSig`, `eventProperties`. One `amplitude.revenue()` call fires per item. |
|
|
99
99
|
| `group` | `Mapping.Value` | Resolves to `{ type, name }` → `amplitude.setGroup(type, name)` |
|
|
100
100
|
| `groupIdentify` | `Mapping.Value` | Resolves to `{ type, name, set?, setOnce?, ... }` → `amplitude.groupIdentify(type, name, identify)` |
|
|
101
|
-
| `reset` | `boolean \| Mapping.Value` | Truthy → `amplitude.reset()` (logout). Typically paired with `
|
|
101
|
+
| `reset` | `boolean \| Mapping.Value` | Truthy → `amplitude.reset()` (logout). Typically paired with `silent: true`. |
|
|
102
102
|
|
|
103
103
|
## Custom Event Properties
|
|
104
104
|
|
|
@@ -120,7 +120,7 @@ Per-rule override via `mapping.settings.include` replaces destination-level
|
|
|
120
120
|
mapping: {
|
|
121
121
|
user: {
|
|
122
122
|
login: {
|
|
123
|
-
|
|
123
|
+
silent: true, // suppress default track()
|
|
124
124
|
settings: {
|
|
125
125
|
identify: {
|
|
126
126
|
map: {
|
|
@@ -150,7 +150,7 @@ mapping: {
|
|
|
150
150
|
mapping: {
|
|
151
151
|
subscription: {
|
|
152
152
|
renew: {
|
|
153
|
-
|
|
153
|
+
silent: true,
|
|
154
154
|
settings: {
|
|
155
155
|
revenue: {
|
|
156
156
|
map: {
|
|
@@ -217,7 +217,7 @@ settings: {
|
|
|
217
217
|
mapping: {
|
|
218
218
|
user: {
|
|
219
219
|
logout: {
|
|
220
|
-
|
|
220
|
+
silent: true,
|
|
221
221
|
settings: { reset: true },
|
|
222
222
|
},
|
|
223
223
|
},
|
|
@@ -231,7 +231,7 @@ clears its runtime identity cache so the next push re-fires the setters.
|
|
|
231
231
|
## Consent
|
|
232
232
|
|
|
233
233
|
Declare the required consent keys on the destination config, then push a walker
|
|
234
|
-
consent event
|
|
234
|
+
consent event - the destination's `on('consent')` handler toggles
|
|
235
235
|
`amplitude.setOptOut()` accordingly. Semantics are strict: all required keys
|
|
236
236
|
must be granted for opt-in; any missing grant opts out.
|
|
237
237
|
|
package/dist/dev.d.mts
CHANGED
|
@@ -173,13 +173,13 @@ type AmplitudeStepExample = Flow.StepExample & {
|
|
|
173
173
|
configInclude?: string[];
|
|
174
174
|
};
|
|
175
175
|
/**
|
|
176
|
-
* Default event forwarding
|
|
176
|
+
* Default event forwarding - every walkerOS event becomes
|
|
177
177
|
* amplitude.track(event.name, event_properties). With no mapping and
|
|
178
178
|
* no destination-level include, event_properties is `{}`.
|
|
179
179
|
*/
|
|
180
180
|
declare const defaultEventForwarding: AmplitudeStepExample;
|
|
181
181
|
/**
|
|
182
|
-
* Wildcard ignore
|
|
182
|
+
* Wildcard ignore - walkerOS's standard way to drop events. The rule
|
|
183
183
|
* matches but does nothing. The destination fires zero SDK calls.
|
|
184
184
|
*/
|
|
185
185
|
declare const wildcardIgnored: AmplitudeStepExample;
|
|
@@ -210,20 +210,20 @@ declare const ruleIncludeReplaces: AmplitudeStepExample;
|
|
|
210
210
|
*/
|
|
211
211
|
declare const destinationLevelIdentify: AmplitudeStepExample;
|
|
212
212
|
/**
|
|
213
|
-
* Per-event identify with the full operation vocabulary
|
|
214
|
-
* "user login" pattern: set user_id, enrich user properties. `
|
|
213
|
+
* Per-event identify with the full operation vocabulary - this is the
|
|
214
|
+
* "user login" pattern: set user_id, enrich user properties. `silent: true`
|
|
215
215
|
* suppresses the default amplitude.track() call because we're running
|
|
216
216
|
* identity side effects only.
|
|
217
217
|
*/
|
|
218
218
|
declare const userLoginIdentify: AmplitudeStepExample;
|
|
219
219
|
/**
|
|
220
|
-
* User logout
|
|
221
|
-
* and regenerates deviceId. `
|
|
220
|
+
* User logout - reset: true fires amplitude.reset(), which clears userId
|
|
221
|
+
* and regenerates deviceId. `silent: true` because we're only running the
|
|
222
222
|
* reset side effect, no default track().
|
|
223
223
|
*/
|
|
224
224
|
declare const userLogoutReset: AmplitudeStepExample;
|
|
225
225
|
/**
|
|
226
|
-
* Single-product revenue
|
|
226
|
+
* Single-product revenue - resolves `settings.revenue` to one object and
|
|
227
227
|
* fires one amplitude.revenue() call. Note the `{ key: "data.currency",
|
|
228
228
|
* value: "EUR" }` fallback syntax: try data.currency, default to "EUR".
|
|
229
229
|
*
|
|
@@ -231,7 +231,7 @@ declare const userLogoutReset: AmplitudeStepExample;
|
|
|
231
231
|
*/
|
|
232
232
|
declare const subscriptionRenewRevenue: AmplitudeStepExample;
|
|
233
233
|
/**
|
|
234
|
-
* Multi-product order
|
|
234
|
+
* Multi-product order - the canonical Amplitude ecommerce pattern.
|
|
235
235
|
* `revenue.loop: ["nested", { map: ... }]` iterates event.nested and
|
|
236
236
|
* resolves one revenue item per entry. Each becomes a separate
|
|
237
237
|
* amplitude.revenue() call. The order-level track() fires once with
|
package/dist/dev.d.ts
CHANGED
|
@@ -173,13 +173,13 @@ type AmplitudeStepExample = Flow.StepExample & {
|
|
|
173
173
|
configInclude?: string[];
|
|
174
174
|
};
|
|
175
175
|
/**
|
|
176
|
-
* Default event forwarding
|
|
176
|
+
* Default event forwarding - every walkerOS event becomes
|
|
177
177
|
* amplitude.track(event.name, event_properties). With no mapping and
|
|
178
178
|
* no destination-level include, event_properties is `{}`.
|
|
179
179
|
*/
|
|
180
180
|
declare const defaultEventForwarding: AmplitudeStepExample;
|
|
181
181
|
/**
|
|
182
|
-
* Wildcard ignore
|
|
182
|
+
* Wildcard ignore - walkerOS's standard way to drop events. The rule
|
|
183
183
|
* matches but does nothing. The destination fires zero SDK calls.
|
|
184
184
|
*/
|
|
185
185
|
declare const wildcardIgnored: AmplitudeStepExample;
|
|
@@ -210,20 +210,20 @@ declare const ruleIncludeReplaces: AmplitudeStepExample;
|
|
|
210
210
|
*/
|
|
211
211
|
declare const destinationLevelIdentify: AmplitudeStepExample;
|
|
212
212
|
/**
|
|
213
|
-
* Per-event identify with the full operation vocabulary
|
|
214
|
-
* "user login" pattern: set user_id, enrich user properties. `
|
|
213
|
+
* Per-event identify with the full operation vocabulary - this is the
|
|
214
|
+
* "user login" pattern: set user_id, enrich user properties. `silent: true`
|
|
215
215
|
* suppresses the default amplitude.track() call because we're running
|
|
216
216
|
* identity side effects only.
|
|
217
217
|
*/
|
|
218
218
|
declare const userLoginIdentify: AmplitudeStepExample;
|
|
219
219
|
/**
|
|
220
|
-
* User logout
|
|
221
|
-
* and regenerates deviceId. `
|
|
220
|
+
* User logout - reset: true fires amplitude.reset(), which clears userId
|
|
221
|
+
* and regenerates deviceId. `silent: true` because we're only running the
|
|
222
222
|
* reset side effect, no default track().
|
|
223
223
|
*/
|
|
224
224
|
declare const userLogoutReset: AmplitudeStepExample;
|
|
225
225
|
/**
|
|
226
|
-
* Single-product revenue
|
|
226
|
+
* Single-product revenue - resolves `settings.revenue` to one object and
|
|
227
227
|
* fires one amplitude.revenue() call. Note the `{ key: "data.currency",
|
|
228
228
|
* value: "EUR" }` fallback syntax: try data.currency, default to "EUR".
|
|
229
229
|
*
|
|
@@ -231,7 +231,7 @@ declare const userLogoutReset: AmplitudeStepExample;
|
|
|
231
231
|
*/
|
|
232
232
|
declare const subscriptionRenewRevenue: AmplitudeStepExample;
|
|
233
233
|
/**
|
|
234
|
-
* Multi-product order
|
|
234
|
+
* Multi-product order - the canonical Amplitude ecommerce pattern.
|
|
235
235
|
* `revenue.loop: ["nested", { map: ... }]` iterates event.nested and
|
|
236
236
|
* resolves one revenue item per entry. Each becomes a separate
|
|
237
237
|
* amplitude.revenue() call. The order-level track() fires once with
|