Skip to content

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.

  1. 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
  2. Paste this before </body> (or anywhere in <head>) on every page you want tracked. The snippet never carries a key. data-domain just 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 to location.hostname at runtime.

  3. /ingest always answers 204, 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: true means a real visitor’s events will be accepted. wouldAccept: false comes with a reasons array explaining exactly why. See troubleshooting for the field-by-field walkthrough.

  4. 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.