Getting started
- Create an account and open the dashboard.
- Type a name under New project and create it. You get a project API key (
ea_...). - Paste the snippet shown on the project page into the
<head>of your site. It looks like this:
<script defer src="https://api.analytics.house/tracker.js" data-key="YOUR_PROJECT_KEY"></script>Page views are tracked automatically and no cookies are set. Whether you still need a consent banner or an opt-out depends on where your visitors are: see Consent and cookie banners.
Optional attributes
data-api: override the API origin (useful when routing through your First-Party Cloudflare Worker proxy).integrity="sha384-..." crossorigin="anonymous": pin the exact Subresource Integrity hash of/tracker.js(available in Project Settings).data-localhost="true": also tracklocalhost(ignored by default).data-respect-dnt="false": disable the default honoring of Global Privacy Control (Sec-GPC: 1) and Do Not Track (DNT: 1).data-hash="true": includelocation.hashin the path (hash-router SPAs).data-vitals="true": automatically measure cookieless Core Web Vitals (LCP,CLS,INP) viaPerformanceObserver.data-clicks="true": record click maps. Loads a separate 1 KB script that counts clicks per page element (tag names and positions only, no text) and flags rage and dead clicks. See the Behaviour page.data-errors="true": report JavaScript errors (message, file and line, at most 5 per page view, with personal data removed). Errors never count as traffic.
The script sets no cookies and stores nothing in the browser. Our servers group a visitor's page views into one visit (the same daily visitor id, at most 30 minutes apart) and carry the landing page's campaign (UTM) tags to the rest of that visit.
Automatic tracking
- Page views, including single-page-app navigation.
- Outbound links: clicks to other sites are recorded as
Outbound Link(URL without query string). - File downloads: links to .pdf, .zip, .csv, .xlsx and similar are recorded as
File Download. data-404="true"on the script tag also sends a404event when the page title looks like a not-found page.data-scroll="true"records how far each pageview was scrolled (one extra stored event per pageview, off by default). Enable it from project settings.
Revenue
analyticsHouse.track('Purchase', { revenue: 49.99, currency: 'EUR' })Amounts are stored per currency and never summed across currencies. They show up as Revenue on the dashboard.
Custom events and goals
No code needed: add an attribute to any element and clicks on it are tracked.
<button data-ea-event="Signup" data-ea-prop-plan="pro">Start free trial</button>Or from JavaScript:
analyticsHouse.track('Signup', { plan: 'pro' })Every custom event appears under Goals & custom events with its conversion rate. Use them as funnel steps too.
Dashboard tips
- Click any row (a page, a country, a browser, an event...) to filter the whole dashboard. Combine up to five filters.
- Compare shows each metric against the previous period.
- Share creates a public, read-only link you can revoke at any time. Export CSV downloads what you see.
- For the full API, see the API reference.