Initialization
Configure the Alke Analytics SDK with your property settings and customize behavior for your application.
Configuration Options
Each platform SDK accepts configuration parameters that control how analytics data is collected and sent.
setConfig(options)
alkeAnalytics.setConfig({
propertyId: 'your-property-uuid', // Required
autoPushPageview: true, // Default: true
countryCode: 'FR', // Optional
cookie: {
domain: '.example.com' // Optional
},
monitoring: {
googletag: true // Optional, default: false
}
});
| Parameter | Type | Description |
|---|---|---|
propertyId | stringrequired | Your Alke Analytics property UUID from the dashboard |
autoPushPageview | booleanoptional | Automatically track a pageview on initialization. Default: `true` |
countryCode | stringoptional | ISO 3166-1 alpha-2 country code. Overrides automatic detection. |
cookie.domain | stringoptional | Custom cookie domain for cross-subdomain tracking |
monitoring.googletag | booleanoptional | Pass the current pageview ID to Google Publisher Tag via `googletag.setConfig({ targeting: { alke_id } })` so ad requests include it. Default: `false` |
Asynchronous loading (command queue)
The collector script is loaded asynchronously, so window.alkeAnalytics may not exist yet when your page code runs. Use the command queue window.alkeAnalyticsCmd to defer calls until the SDK is ready — any function you push runs as soon as the SDK has initialized (and immediately once it’s already loaded):
<script async src="https://…/collector.js"></script>
<script>
window.alkeAnalyticsCmd = window.alkeAnalyticsCmd || [];
window.alkeAnalyticsCmd.push(function () {
// window.alkeAnalytics is guaranteed to be available here
window.alkeAnalytics.setConfig({ propertyId: 'your-property-uuid' });
});
</script>
This is the supported way to guarantee ordering under async loading: push your setConfig, your video setup, and anything that reads from the SDK (e.g. getVideoAdTargeting) inside a queued callback so it never runs before the SDK is ready.
getVideoAdTargeting(playerId) when building a VAST ad tag — read them from inside a queued callback (where window.alkeAnalytics exists), not before the SDK has loaded.Verifying Installation
Open your browser’s Developer Tools (F12) and check the Network tab for requests to ca.alketech.eu.
// Check if alkeAnalytics is available
console.log(typeof alkeAnalytics); // Should output: "object"
For mobile SDKs, enable debugMode to see detailed logs in the console.
debugMode during development to see detailed logs. Remember to disable it in production builds.