ainamika-sdk 1.2.7 → 1.2.9
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 +56 -1
- package/dist/ainamika-sdk.js +1 -1
- package/dist/ainamika-sdk.js.map +1 -1
- package/dist/sdk.d.ts +57 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
10
|
- **AI-Powered Auto-Configuration**: Automatically analyzes your DOM and generates semantic tracking configurations
|
|
11
|
+
- **Session Start Tracking**: Captures device info, landing page, referrer, and UTM params immediately on load
|
|
11
12
|
- **Web Vitals & Performance Tracking**: Core Web Vitals (LCP, FCP, FID, CLS, TTFB) and page load metrics
|
|
12
13
|
- **Engagement Analytics**: Scroll depth, rage clicks, time on page, active/idle time tracking
|
|
13
14
|
- **API Response Tracking**: Track and analyze API calls with timing and response data
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
- **Page Context & Query Params**: Automatic capture of URL, path, query parameters, referrer with every event
|
|
16
17
|
- **Extra Config Support**: Pass custom data (userId, deviceId, appVersion) that's included in all events
|
|
17
18
|
- **Smart Event Naming**: AI generates semantic event names like `game_launch_cubeform` instead of generic names
|
|
19
|
+
- **Framework Detection**: Detects click handlers from React, Vue, Angular, Svelte, and jQuery components
|
|
18
20
|
- **User Journey Analysis**: Track complete user journeys for funnel optimization
|
|
19
21
|
- **Sampling Support**: Server-side sampling to control data volume and costs
|
|
20
22
|
- **Offline Support**: Queue events when offline and sync when back online
|
|
@@ -141,6 +143,58 @@ console.log(metrics);
|
|
|
141
143
|
// }
|
|
142
144
|
```
|
|
143
145
|
|
|
146
|
+
## Session Tracking
|
|
147
|
+
|
|
148
|
+
The SDK automatically sends a `session_start` event immediately when it loads, before any other processing. This ensures you capture data from the moment a user lands on your app.
|
|
149
|
+
|
|
150
|
+
### Session Start Event Data
|
|
151
|
+
|
|
152
|
+
```javascript
|
|
153
|
+
// Automatically sent on SDK initialization
|
|
154
|
+
{
|
|
155
|
+
event: "session_start",
|
|
156
|
+
properties: {
|
|
157
|
+
// Device Information
|
|
158
|
+
userAgent: "Mozilla/5.0...",
|
|
159
|
+
language: "en-US",
|
|
160
|
+
languages: ["en-US", "en"],
|
|
161
|
+
platform: "MacIntel",
|
|
162
|
+
screenWidth: 1920,
|
|
163
|
+
screenHeight: 1080,
|
|
164
|
+
viewportWidth: 1440,
|
|
165
|
+
viewportHeight: 900,
|
|
166
|
+
devicePixelRatio: 2,
|
|
167
|
+
timezone: "America/New_York",
|
|
168
|
+
timezoneOffset: -300,
|
|
169
|
+
cookieEnabled: true,
|
|
170
|
+
onLine: true,
|
|
171
|
+
|
|
172
|
+
// Session Info
|
|
173
|
+
sessionId: "sess_abc123",
|
|
174
|
+
userIdentifier: "anon_xyz789",
|
|
175
|
+
isNewSession: true,
|
|
176
|
+
sdkVersion: "1.2.7",
|
|
177
|
+
|
|
178
|
+
// Landing Page
|
|
179
|
+
landingPage: "/products",
|
|
180
|
+
landingUrl: "https://example.com/products?ref=google",
|
|
181
|
+
referrer: "https://google.com",
|
|
182
|
+
entryTitle: "Products - My Store",
|
|
183
|
+
|
|
184
|
+
// UTM Parameters (if present)
|
|
185
|
+
utmSource: "google",
|
|
186
|
+
utmMedium: "cpc",
|
|
187
|
+
utmCampaign: "summer_sale"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
This gives you complete visibility into:
|
|
193
|
+
- **Traffic sources**: Where users come from (referrer, UTM params)
|
|
194
|
+
- **Device landscape**: Screen sizes, browsers, platforms
|
|
195
|
+
- **Geographic distribution**: Timezone data
|
|
196
|
+
- **Entry points**: Which pages users land on first
|
|
197
|
+
|
|
144
198
|
## Engagement Tracking
|
|
145
199
|
|
|
146
200
|
Track how users interact with your pages:
|
|
@@ -492,10 +546,11 @@ new AInamikaSDK(config: AnalyticsConfig)
|
|
|
492
546
|
|
|
493
547
|
| Category | Events |
|
|
494
548
|
|----------|--------|
|
|
549
|
+
| **Session** | `session_start` - Fires immediately on SDK load with device info, landing page, referrer, UTM params |
|
|
495
550
|
| **Performance** | `performance_lcp`, `performance_fcp`, `performance_fid`, `performance_cls`, `performance_page_load` |
|
|
496
551
|
| **Engagement** | `engagement_scroll_depth`, `engagement_rage_click`, `page_exit` |
|
|
497
552
|
| **API** | `api_call` (when enabled) |
|
|
498
|
-
| **DOM** | Click, submit, view, focus events based on auto-config |
|
|
553
|
+
| **DOM** | Click, submit, view, focus, change events based on auto-config |
|
|
499
554
|
|
|
500
555
|
## Dashboard Queries
|
|
501
556
|
|