Quickstart
Adding CanaryLytics to a site takes three things: a project, one script tag, and a page load. No account signup, no config file, no build step.
-
Create a project
Section titled “Create a project”Projects are invite-gated. Open the CanaryLytics dashboard, paste your invite code, name the project, and list the domain(s) it will run on (for example
myapp.com). You get back a secret key:cly_live_5f3a9c2e1b7d4a80f6c3e9d2a1b4c7e0 -
Add the tracking snippet
Section titled “Add the tracking snippet”Paste this before
</body>(or anywhere in<head>) on every page you want tracked. The snippet never carries a key.data-domainjust needs to match one of the project’s trusted domains:<script src="https://cdn.analytics.canarycoders.es/lytics.js" data-domain="myapp.com" defer></script>If you omit
data-domain, it defaults tolocation.hostnameat runtime. -
Verify the setup
Section titled “Verify the setup”/ingestalways answers204, even when an event is silently dropped, so there is no error to watch for in the browser. Dry-run the acceptance rules with your key instead:Terminal window curl "https://api.analytics.canarycoders.es/v1/validate?domain=myapp.com&origin=https://myapp.com" \-H "Authorization: Bearer cly_live_5f3a9c2e1b7d4a80f6c3e9d2a1b4c7e0"{ "domain": "myapp.com", "origin": "https://myapp.com", "wouldAccept": true, "checks": { "...": "..." }, "reasons": [] }wouldAccept: truemeans a real visitor’s events will be accepted.wouldAccept: falsecomes with areasonsarray explaining exactly why. See troubleshooting for the field-by-field walkthrough. -
Watch the data arrive
Section titled “Watch the data arrive”Load a page on the tracked domain, then open the CanaryLytics dashboard. Sessions, pageviews, and the live-visitors counter update within a couple of seconds.