Web
iOS
tvOS
Android
Alke Analytics SDK
Privacy-first analytics for web and native applications. Track pageviews, custom events, and user engagement with full GDPR compliance.
Quick Start
Get started with Alke Analytics in minutes. Choose your platform below.
1. Include the Collector Script
Add the script to your HTML <head>:
<script src="https://cdn-analytics.alketech.eu/collector.js"></script>
2. Configure the SDK
Initialize with your property ID:
alkeAnalytics.setConfig({
propertyId: 'your-property-uuid',
autoPushPageview: true
});
With autoPushPageview: true, a pageview is automatically tracked when the SDK initializes.
3. Track Pageviews (SPA)
For single-page applications, disable auto-tracking and, on each route change,
call pushNavigation() then pushPageView(). pushNavigation() is the page
boundary: it closes the page being left and opens the next pageviewId. Without
it the whole visit collapses into a single pageview, and its entire ad revenue is
written on every route.
alkeAnalytics.setConfig({
propertyId: 'your-property-uuid',
autoPushPageview: false
});
// On each route change, once the router has rendered
alkeAnalytics.pushNavigation();
alkeAnalytics.pushPageView();
4. Add Custom Dimensions
Enrich your tracking data with custom dimensions:
alkeAnalytics.setCustomData(1, 'category_tech');
alkeAnalytics.setCustomData(2, 'author_john');
alkeAnalytics.setCustomData(3, 42);
alkeAnalytics.pushPageView();
Complete Example
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn-analytics.alketech.eu/collector.js"></script>
<script>
alkeAnalytics.setConfig({
propertyId: 'your-property-uuid',
autoPushPageview: false
});
// Set article metadata
alkeAnalytics.setCustomData(1, 'technology');
alkeAnalytics.setCustomData(2, 'John Doe');
// Track the pageview
alkeAnalytics.pushPageView();
</script>
</head>
<body>
<!-- Your content -->
</body>
</html>
Features
| Feature | Description |
|---|---|
| Privacy First | Full GDPR and IAB TCF 2.0 compliance with consent-aware tracking |
| Cross-Platform | Native SDKs for iOS, tvOS, Android, and Android TV |
| Real-Time Events | Track pageviews, custom events, and engagement in real-time |
| Custom Dimensions | Up to 10 custom data fields per event |
Next Steps
- Initialization — Configure the SDK and explore every setting
- Events — Track pageviews and user interactions
- Video Tracking — Track playback with active time, engagement and performance metrics
- Custom Dimensions — Add contextual data to your events
- Content Dimensions — Report on content hierarchy, article metadata and reader context
- Sessions — Understand session, visitor and traffic source handling
- Deeplinks — Unify web and app analytics behind consistent URLs
- Consent Management — Implement GDPR-compliant tracking
- API Access — Query your analytics data programmatically
- Ad Server Data Transfer — Attribute Google Ad Manager revenue to individual pageviews