rozmova-analytics 1.1.51 → 1.1.53
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 +0 -23
- package/dist/index.cjs +82 -27941
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +66 -27933
- package/dist/index.umd.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,6 @@ Initializes the analytics library, setting up Mixpanel, Google Analytics, Custom
|
|
|
72
72
|
- `config.locale?: string` - The locale for analytics data (default: auto-detected or "uk")
|
|
73
73
|
- `config.platform?: string` - The platform identifier (default: "web")
|
|
74
74
|
- `config.isClearly?: boolean` - Whether to enable Clearly-specific features like cookie consent banner
|
|
75
|
-
- `config.trackPageScroll?: boolean` - Whether to automatically track page scroll to bottom (default: true)
|
|
76
75
|
- `config.config?: object` - Initial configuration object with userId and email
|
|
77
76
|
- `config.config.userId?: string` - Initial user ID
|
|
78
77
|
- `config.config.email?: string` - Initial user email
|
|
@@ -188,28 +187,6 @@ Updates the locale for analytics data.
|
|
|
188
187
|
Analytics.setLocale("es");
|
|
189
188
|
```
|
|
190
189
|
|
|
191
|
-
### `trackPageScroll(bodyElementQuerySelector?)`
|
|
192
|
-
|
|
193
|
-
Tracks a `page_scroll` event in Mixpanel when the user scrolls to the bottom of the page. Called automatically during `init()` unless `trackPageScroll` is set to `false`.
|
|
194
|
-
|
|
195
|
-
**Parameters:**
|
|
196
|
-
- `customElement?: HTMLElement` - Optional scrollable HTML element to track. If not provided, defaults to tracking the window scroll against `document.body`.
|
|
197
|
-
|
|
198
|
-
**Returns:** `() => void` - A cleanup function that removes the scroll listener.
|
|
199
|
-
|
|
200
|
-
**Example:**
|
|
201
|
-
```javascript
|
|
202
|
-
// Automatically tracked during init (default behavior)
|
|
203
|
-
Analytics.init({ locale: "en", platform: "web" });
|
|
204
|
-
|
|
205
|
-
// Disable automatic tracking and call manually
|
|
206
|
-
Analytics.init({ locale: "en", trackPageScroll: false });
|
|
207
|
-
const cleanup = Analytics.trackPageScroll(document.querySelector(".main-content"));
|
|
208
|
-
|
|
209
|
-
// Remove the scroll listener when no longer needed
|
|
210
|
-
cleanup();
|
|
211
|
-
```
|
|
212
|
-
|
|
213
190
|
### `trackPageView(options?)`
|
|
214
191
|
|
|
215
192
|
Tracks a page view event with current page information including title, location, and referrer.
|