Privacy-first web analytics. Cookie-free, GDPR compliant, simple to integrate.
CAnalytics tracks pageviews and custom events without cookies or personal data collection.
Go to the dashboard and enter your email address. You'll receive a 6-digit verification code.
Check your inbox and enter the code. Codes expire after 10 minutes.
First-time users create an organization to hold their CTags and team members.
A CTag is a tracking configuration with an API key and allowed domains.
Navigate to the CTags page from the sidebar.
Enter a name (e.g., "Production Website") and allowed domains.
Your key looks like: C-xxxxxxxxxxxxxxxxxxxx
Specify which domains can send events with your API key.
example.com, www.example.comstaging.example.comlocalhostRequests from non-whitelisted domains are rejected with 403 Forbidden.
Add the tracking script to your website.
Add this snippet before the closing </head> tag:
<script
src="https://analytics.cloudlineconsulting.com/ctag.js"
data-key="C-YOUR_API_KEY"
async
></script>
Pageviews are tracked automatically when the script loads, including SPA navigation (pushState/popstate).
To disable automatic tracking and only use custom events:
<script
src="https://analytics.cloudlineconsulting.com/ctag.js"
data-key="C-YOUR_API_KEY"
data-auto="false"
async
></script>
You can still call window.ctag.pageview() and window.ctag.track() manually.
Add to your app/layout.tsx or pages/_app.tsx:
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html>
<head>
<Script
src="https://analytics.cloudlineconsulting.com/ctag.js"
data-key="C-YOUR_API_KEY"
strategy="afterInteractive"
/>
</head>
<body>{children}</body>
</html>
);
}
Configure the script using data attributes.
| Attribute | Description | Default |
|---|---|---|
data-key required |
Your CTag API key | — |
data-auto |
Enable automatic pageview and navigation tracking (initial pageview + SPA route changes via pushState/popstate). Set to "false" for custom events only. |
"true" |
data-errors |
Enable automatic error tracking (JS errors + unhandled promise rejections) | "true" |
data-userid |
Custom user ID to associate with events (replaces anonymous ID). Use when user is logged in. | — |
The ctag object is available globally after the script loads.
Pageviews are tracked automatically on page load. For SPAs without data-spa="true", call manually:
window.ctag.pageview();
Track any event with optional properties:
window.ctag.track('event_name', {
key: 'value',
count: 42
});
Associate events with a known user (e.g., after login):
// After user logs in
window.ctag.identify('user_12345');
This replaces the anonymous ID with your user ID for all subsequent events. You can also set it statically via data-userid attribute.
Button clicks:
ctag.track('click', { button: 'signup', location: 'header' });
E-commerce:
ctag.track('purchase', { orderId: 'ABC123', total: 99.99 });
ctag.track('add_to_cart', { sku: 'PROD-001', price: 29.99 });
Form submissions:
ctag.track('form_submit', { form: 'newsletter', success: true });
User actions:
ctag.track('signup', { method: 'google' });
ctag.track('login', { method: 'email' });
Every event includes:
| Field | Description |
|---|---|
url |
Full page URL |
path |
URL pathname only |
queryParams |
All URL query parameters (UTM tags, etc.) |
referrer |
Referring page URL |
sessionId |
Session ID (30-minute inactivity timeout) |
userId |
Anonymous persistent visitor ID |
timestamp |
ISO 8601 timestamp |
JavaScript errors and unhandled promise rejections are captured automatically.
window.onerror — Uncaught JavaScript errorsunhandledrejection — Unhandled promise rejections| Field | Description |
|---|---|
message |
Error message text |
filename |
Source file where error occurred |
lineno |
Line number |
colno |
Column number |
stack |
Stack trace (truncated to 1000 chars) |
To disable automatic error tracking:
<script
src="https://analytics.cloudlineconsulting.com/ctag.js"
data-key="C-YOUR_API_KEY"
data-errors="false"
async
></script>
CAnalytics is designed for privacy compliance.
CAnalytics does not use cookies. User identification relies on localStorage with anonymous IDs.
Invite team members and manage permissions.
| Role | Permissions |
|---|---|
| Owner | Full access, manage billing, delete organization |
| Admin | Manage members, CTags, invites |
| Editor | Create and edit CTags, view analytics |
| Viewer | View analytics and CTags only |