Documentation
Get started and troubleshoot your setup
Quick Start
- Create an Application at Apps → Create (one per website).
- Add the script tag to your site’s
<head>using your app slug or ID. - Open your site, navigate a couple pages, then check the app dashboard for events.
Using slug (recommended)
<script src="https://monitor.alkenacode.dev/monitor.js" data-app-slug="your-slug" defer></script>Using fixed application ID
<script src="https://monitor.alkenacode.dev/monitor.js" data-app-id="APP_ID" defer></script>Download monitor.jsOr reference directly from
https://monitor.alkenacode.dev/monitor.jsWhat Gets Tracked
- Pageviews (including SPA navigations via History API)
- Referrer and UTM parameters (source, medium, campaign)
- Session heartbeat every 15s (for Active Users metric)
Custom Events (Clicks)
Two easy ways to track button/link clicks without writing JS:
- Add
data-monitor-event="signup"(or any name) to your element. - Or add a class like
monitor-signup(prefixmonitor-+ your event name).
Using data attribute
<button data-monitor-event="signup">Sign up</button>Using classname
<a href="/pricing" class="monitor-pricing">Pricing</a>Optional: add data-monitor-meta='{"plan":"pro"}' to attach extra JSON metadata.
Endpoints
GraphQL:
/api/graphqlWebSocket:
/api/graphqlHealth:
/api/healthzTroubleshooting
- No events appear: Open DevTools → Network, filter by
graphql, ensure POST requests return 200. - CORS error: Ask admin to add your site origin to
APP_ALLOWED_ORIGINS. - Ad-blocking: Some lists may block GraphQL endpoints. If so, serve the script from your own domain or contact us to enable a REST collector.
- SPA not tracking: Ensure the app uses History API routing. The script hooks pushState and popstate.
- Verify API health: Visit
/api/healthz— should return status ok.
Tips
- Use the slug-based snippet so changing app IDs doesn’t break embeds.
- Avoid putting personal data in URLs; UTM values are captured as-is.
- For multiple sites, create one Application per domain or product.