Documentation
Everything you need to integrate AxiaStats analytics into your website or application.
Quick Start
Adding AxiaStats to your site takes less than a minute. Just paste the tracking script into your HTML.
Step 1 — Add the Script
Paste this snippet in the <head> of every page you want to track:
<script defer data-website-id="YOUR_WEBSITE_ID" src="https://axiastats.com/js/ax.js"></script>
Tip: Replace YOUR_WEBSITE_ID with your actual website ID from the dashboard. The script is only ~2 KB gzipped.
Step 2 — Verify Installation
After adding the script, visit your website and open the browser console. You should see a network request to axiastats.com/api/collect.
Return to your AxiaStats dashboard and you should see data appearing within a few seconds.
Tracking Functions
axia.track()
Send a custom event from anywhere in your code:
axia.track('signup-click');
axia.track('purchase', { plan: 'pro', amount: 29 });
axia.track('pageview', { url: '/dashboard/reports' });
axia.identify()
Identify users for more detailed analytics:
axia.identify({
userId: 'user_12345',
email: 'user@example.com',
plan: 'pro'
});
Single Page Applications
For React, Vue, or other SPAs, use the data-auto-track="false" attribute and trigger pageviews manually:
<script defer data-auto-track="false" data-website-id="YOUR_ID" src="https://axiastats.com/js/ax.js"></script>
Then in your router (React example):
useEffect(() => {
window.axia.track('pageview', { url: location.pathname });
}, [location]);
API Access
Query your analytics data programmatically using the REST API. All endpoints require an API key passed in the X-API-Key header.
Get Website Stats
{
"pageviews": { "value": 1250, "change": 12.3 },
"visitors": { "value": 892, "change": 8.1 },
"bounceRate": { "value": 34, "change": -2.4 },
"avgSession": { "value": 145, "change": 5.2 }
}
Get Time Series
Privacy & Compliance
- GDPR: AxiaStats does not use cookies. No cookie consent banner required.
- No IP storage: Visitor IPs are hashed and never stored in plain text.
- EU hosting: Data is processed on EU-based servers.
- Data ownership: You own your analytics data. Export or delete anytime.