@walkeros/web-destination-mixpanel 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 +18 -17
- package/dist/dev.d.mts +10 -10
- package/dist/dev.d.ts +10 -10
- 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 +10 -10
- package/dist/examples/index.d.ts +10 -10
- package/dist/examples/index.js +34 -29
- package/dist/examples/index.mjs +34 -29
- 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 +42 -175
- 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-mixpanel)
|
|
12
12
|
• [Documentation](https://www.walkeros.io/docs/destinations/web/mixpanel)
|
|
13
13
|
|
|
14
|
-
This package forwards walkerOS events to [Mixpanel](https://mixpanel.com/)
|
|
14
|
+
This package forwards walkerOS events to [Mixpanel](https://mixpanel.com/) -
|
|
15
15
|
product analytics for tracking user behaviour, funnels, retention, and
|
|
16
16
|
group-level metrics. Built on the official
|
|
17
17
|
[`mixpanel-browser`](https://www.npmjs.com/package/mixpanel-browser) SDK.
|
|
@@ -23,20 +23,20 @@ group assignments, and consent changes.
|
|
|
23
23
|
|
|
24
24
|
## Features
|
|
25
25
|
|
|
26
|
-
- **Default event forwarding**
|
|
26
|
+
- **Default event forwarding** - every walkerOS event becomes
|
|
27
27
|
`mixpanel.track(name, properties)` with no extra config
|
|
28
|
-
- **Identity**
|
|
28
|
+
- **Identity** - destination- or per-event `settings.identify` resolves to
|
|
29
29
|
`{ distinctId }` → `mixpanel.identify(distinctId)`, with runtime state diffing
|
|
30
30
|
so identical distinct IDs don't re-fire
|
|
31
|
-
- **Full people vocabulary**
|
|
31
|
+
- **Full people vocabulary** - all eight Mixpanel operations supported: `set`,
|
|
32
32
|
`set_once`, `increment`, `append`, `union`, `remove`, `unset`, `delete_user`
|
|
33
|
-
- **Groups**
|
|
33
|
+
- **Groups** - user→group association via `mixpanel.set_group(key, id)` and
|
|
34
34
|
group-profile properties via `mixpanel.get_group(key, id).set/set_once/…`
|
|
35
|
-
- **Reset on logout**
|
|
35
|
+
- **Reset on logout** - `settings.reset: true` calls `mixpanel.reset()` so the
|
|
36
36
|
next session starts with a fresh anonymous distinct ID
|
|
37
|
-
- **Consent**
|
|
37
|
+
- **Consent** - `on('consent')` handler derives required keys from
|
|
38
38
|
`config.consent` and toggles `opt_in_tracking` / `opt_out_tracking`
|
|
39
|
-
- **Full SDK passthrough**
|
|
39
|
+
- **Full SDK passthrough** - every `mixpanel-browser` `Config` option
|
|
40
40
|
(`api_host`, `persistence`, `batch_requests`, `record_sessions_percent`,
|
|
41
41
|
`cross_subdomain_cookie`, etc.) flows through directly
|
|
42
42
|
|
|
@@ -78,7 +78,7 @@ await startFlow({
|
|
|
78
78
|
| `api_host` | `string` | Ingestion host. Default `https://api-js.mixpanel.com`. Use `https://api-eu.mixpanel.com` for EU. | No |
|
|
79
79
|
| `persistence` | `'cookie' \| 'localStorage'` | Client-side persistence backend. Default `cookie`. | No |
|
|
80
80
|
| `batch_requests` | `boolean` | Use the `/batch` endpoint. Default `true`. | No |
|
|
81
|
-
| `record_sessions_percent` | `number` | Session replay sampling (0
|
|
81
|
+
| `record_sessions_percent` | `number` | Session replay sampling (0-100). Default `0`. | No |
|
|
82
82
|
| `track_pageview` | `boolean \| string` | Mixpanel auto-pageview. walkerOS default `false` (walkerOS sources handle page views). | No |
|
|
83
83
|
| `autocapture` | `boolean \| object` | Mixpanel autocapture. walkerOS default `false`. | No |
|
|
84
84
|
| `include` | `string[]` | Event sections flattened into `track()` properties (`data`, `globals`, `context`, `user`, …) | No |
|
|
@@ -86,7 +86,8 @@ await startFlow({
|
|
|
86
86
|
| `group` | `Mapping.Value` | Destination-level group assignment; resolves to `{ key, id }` | No |
|
|
87
87
|
|
|
88
88
|
All other `mixpanel-browser` `Config` options (snake_case) pass through directly
|
|
89
|
-
|
|
89
|
+
|
|
90
|
+
- the destination's `Settings` type extends `Partial<Config>`.
|
|
90
91
|
|
|
91
92
|
### Mapping (`rule.settings`)
|
|
92
93
|
|
|
@@ -120,13 +121,13 @@ mapping: {
|
|
|
120
121
|
```
|
|
121
122
|
|
|
122
123
|
For revenue events the Mixpanel `people.track_charge` API is deprecated
|
|
123
|
-
(v2.78+); pass revenue fields as regular event properties instead
|
|
124
|
+
(v2.78+); pass revenue fields as regular event properties instead - currency
|
|
124
125
|
values in sample events use `"EUR"`.
|
|
125
126
|
|
|
126
127
|
## Identity
|
|
127
128
|
|
|
128
129
|
```typescript
|
|
129
|
-
// Destination-level
|
|
130
|
+
// Destination-level - every push with a user.id fires identify
|
|
130
131
|
settings: {
|
|
131
132
|
apiKey: 'YOUR_TOKEN',
|
|
132
133
|
identify: { map: { distinctId: 'user.id' } },
|
|
@@ -145,7 +146,7 @@ mapping: {
|
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
Runtime state diffing means identical `distinctId` values don't re-fire
|
|
148
|
-
`mixpanel.identify()`
|
|
149
|
+
`mixpanel.identify()` - the SDK call only runs when the resolved value changes.
|
|
149
150
|
|
|
150
151
|
## People
|
|
151
152
|
|
|
@@ -167,7 +168,7 @@ key in the resolved object fires a separate `mixpanel.people.*` call:
|
|
|
167
168
|
mapping: {
|
|
168
169
|
user: {
|
|
169
170
|
login: {
|
|
170
|
-
|
|
171
|
+
silent: true,
|
|
171
172
|
settings: {
|
|
172
173
|
identify: { map: { distinctId: 'data.user_id' } },
|
|
173
174
|
people: {
|
|
@@ -205,7 +206,7 @@ Group profile properties use `mixpanel.get_group(key, id).set/…`:
|
|
|
205
206
|
mapping: {
|
|
206
207
|
company: {
|
|
207
208
|
update: {
|
|
208
|
-
|
|
209
|
+
silent: true,
|
|
209
210
|
settings: {
|
|
210
211
|
groupProfile: {
|
|
211
212
|
map: {
|
|
@@ -229,7 +230,7 @@ mapping: {
|
|
|
229
230
|
mapping: {
|
|
230
231
|
user: {
|
|
231
232
|
logout: {
|
|
232
|
-
|
|
233
|
+
silent: true,
|
|
233
234
|
settings: { reset: true },
|
|
234
235
|
},
|
|
235
236
|
},
|
|
@@ -243,7 +244,7 @@ state so the next identify call will fire again.
|
|
|
243
244
|
## Consent
|
|
244
245
|
|
|
245
246
|
Mixpanel consent is wired via the destination's `on('consent')` handler. Declare
|
|
246
|
-
`config.consent` on the destination
|
|
247
|
+
`config.consent` on the destination - the handler requires **all** declared keys
|
|
247
248
|
to be granted to opt in:
|
|
248
249
|
|
|
249
250
|
```typescript
|
package/dist/dev.d.mts
CHANGED
|
@@ -155,13 +155,13 @@ type MixpanelStepExample = Flow.StepExample & {
|
|
|
155
155
|
configInclude?: string[];
|
|
156
156
|
};
|
|
157
157
|
/**
|
|
158
|
-
* Default event forwarding
|
|
158
|
+
* Default event forwarding - every walkerOS event becomes
|
|
159
159
|
* mixpanel.track(event.name, properties). With no mapping and no
|
|
160
160
|
* destination-level include, properties is `{}`.
|
|
161
161
|
*/
|
|
162
162
|
declare const defaultEventForwarding: MixpanelStepExample;
|
|
163
163
|
/**
|
|
164
|
-
* Wildcard ignore
|
|
164
|
+
* Wildcard ignore - walkerOS's standard way to drop events. The rule
|
|
165
165
|
* matches but does nothing. The destination fires zero SDK calls.
|
|
166
166
|
*/
|
|
167
167
|
declare const wildcardIgnored: MixpanelStepExample;
|
|
@@ -184,34 +184,34 @@ declare const ruleIncludeReplaces: MixpanelStepExample;
|
|
|
184
184
|
*/
|
|
185
185
|
declare const destinationLevelIdentify: MixpanelStepExample;
|
|
186
186
|
/**
|
|
187
|
-
* Per-event identify + people operations
|
|
188
|
-
* pattern. `
|
|
187
|
+
* Per-event identify + people operations - the canonical "user login"
|
|
188
|
+
* pattern. `silent: true` suppresses the default mixpanel.track() call
|
|
189
189
|
* because we're running identity side effects only.
|
|
190
190
|
*/
|
|
191
191
|
declare const userLoginIdentifyAndPeople: MixpanelStepExample;
|
|
192
192
|
/**
|
|
193
|
-
* Full people operation vocabulary
|
|
193
|
+
* Full people operation vocabulary - a profile update rule that exercises
|
|
194
194
|
* set, set_once, increment, append, union, remove, and unset in a single
|
|
195
|
-
* rule. `
|
|
195
|
+
* rule. `silent: true` because only side effects are needed.
|
|
196
196
|
*/
|
|
197
197
|
declare const profileUpdateAllPeopleOperations: MixpanelStepExample;
|
|
198
198
|
/**
|
|
199
|
-
* people.delete_user
|
|
199
|
+
* people.delete_user - destructive operation. The resolved people object
|
|
200
200
|
* uses `{ delete_user: true }` to trigger the call.
|
|
201
201
|
*/
|
|
202
202
|
declare const accountDeleteUser: MixpanelStepExample;
|
|
203
203
|
/**
|
|
204
|
-
* User logout
|
|
204
|
+
* User logout - reset: true fires mixpanel.reset(), which clears all
|
|
205
205
|
* persistence and generates a new anonymous distinct_id.
|
|
206
206
|
*/
|
|
207
207
|
declare const userLogoutReset: MixpanelStepExample;
|
|
208
208
|
/**
|
|
209
|
-
* User-group association
|
|
209
|
+
* User-group association - settings.group resolves to { key, id } and
|
|
210
210
|
* calls mixpanel.set_group(key, id). Fires default track too.
|
|
211
211
|
*/
|
|
212
212
|
declare const userGroupAssociation: MixpanelStepExample;
|
|
213
213
|
/**
|
|
214
|
-
* Group profile properties
|
|
214
|
+
* Group profile properties - settings.groupProfile resolves to
|
|
215
215
|
* { key, id, set?, set_once?, ... } and calls
|
|
216
216
|
* mixpanel.get_group(key, id).set(...), .set_once(...), etc.
|
|
217
217
|
*/
|
package/dist/dev.d.ts
CHANGED
|
@@ -155,13 +155,13 @@ type MixpanelStepExample = Flow.StepExample & {
|
|
|
155
155
|
configInclude?: string[];
|
|
156
156
|
};
|
|
157
157
|
/**
|
|
158
|
-
* Default event forwarding
|
|
158
|
+
* Default event forwarding - every walkerOS event becomes
|
|
159
159
|
* mixpanel.track(event.name, properties). With no mapping and no
|
|
160
160
|
* destination-level include, properties is `{}`.
|
|
161
161
|
*/
|
|
162
162
|
declare const defaultEventForwarding: MixpanelStepExample;
|
|
163
163
|
/**
|
|
164
|
-
* Wildcard ignore
|
|
164
|
+
* Wildcard ignore - walkerOS's standard way to drop events. The rule
|
|
165
165
|
* matches but does nothing. The destination fires zero SDK calls.
|
|
166
166
|
*/
|
|
167
167
|
declare const wildcardIgnored: MixpanelStepExample;
|
|
@@ -184,34 +184,34 @@ declare const ruleIncludeReplaces: MixpanelStepExample;
|
|
|
184
184
|
*/
|
|
185
185
|
declare const destinationLevelIdentify: MixpanelStepExample;
|
|
186
186
|
/**
|
|
187
|
-
* Per-event identify + people operations
|
|
188
|
-
* pattern. `
|
|
187
|
+
* Per-event identify + people operations - the canonical "user login"
|
|
188
|
+
* pattern. `silent: true` suppresses the default mixpanel.track() call
|
|
189
189
|
* because we're running identity side effects only.
|
|
190
190
|
*/
|
|
191
191
|
declare const userLoginIdentifyAndPeople: MixpanelStepExample;
|
|
192
192
|
/**
|
|
193
|
-
* Full people operation vocabulary
|
|
193
|
+
* Full people operation vocabulary - a profile update rule that exercises
|
|
194
194
|
* set, set_once, increment, append, union, remove, and unset in a single
|
|
195
|
-
* rule. `
|
|
195
|
+
* rule. `silent: true` because only side effects are needed.
|
|
196
196
|
*/
|
|
197
197
|
declare const profileUpdateAllPeopleOperations: MixpanelStepExample;
|
|
198
198
|
/**
|
|
199
|
-
* people.delete_user
|
|
199
|
+
* people.delete_user - destructive operation. The resolved people object
|
|
200
200
|
* uses `{ delete_user: true }` to trigger the call.
|
|
201
201
|
*/
|
|
202
202
|
declare const accountDeleteUser: MixpanelStepExample;
|
|
203
203
|
/**
|
|
204
|
-
* User logout
|
|
204
|
+
* User logout - reset: true fires mixpanel.reset(), which clears all
|
|
205
205
|
* persistence and generates a new anonymous distinct_id.
|
|
206
206
|
*/
|
|
207
207
|
declare const userLogoutReset: MixpanelStepExample;
|
|
208
208
|
/**
|
|
209
|
-
* User-group association
|
|
209
|
+
* User-group association - settings.group resolves to { key, id } and
|
|
210
210
|
* calls mixpanel.set_group(key, id). Fires default track too.
|
|
211
211
|
*/
|
|
212
212
|
declare const userGroupAssociation: MixpanelStepExample;
|
|
213
213
|
/**
|
|
214
|
-
* Group profile properties
|
|
214
|
+
* Group profile properties - settings.groupProfile resolves to
|
|
215
215
|
* { key, id, set?, set_once?, ... } and calls
|
|
216
216
|
* mixpanel.get_group(key, id).set(...), .set_once(...), etc.
|
|
217
217
|
*/
|