CAnalytics Documentation

Privacy-first web analytics. Cookie-free, GDPR compliant, simple to integrate.

Getting Started

CAnalytics tracks pageviews and custom events without cookies or personal data collection.

1. Create an Account

1

Enter your email

Go to the dashboard and enter your email address. You'll receive a 6-digit verification code.

2

Enter the code

Check your inbox and enter the code. Codes expire after 10 minutes.

3

Create your organization

First-time users create an organization to hold their CTags and team members.

2. Create a CTag

A CTag is a tracking configuration with an API key and allowed domains.

1

Go to CTags

Navigate to the CTags page from the sidebar.

2

Click Create CTag

Enter a name (e.g., "Production Website") and allowed domains.

3

Copy your API key

Your key looks like: C-xxxxxxxxxxxxxxxxxxxx

3. Add Allowed Domains

Specify which domains can send events with your API key.

Requests from non-whitelisted domains are rejected with 403 Forbidden.

Installation

Add the tracking script to your website.

Basic Setup

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

Custom Events Only

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.

Next.js

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>
  );
}

Configuration

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.

API Reference

The ctag object is available globally after the script loads.

Automatic Pageviews

Pageviews are tracked automatically on page load. For SPAs without data-spa="true", call manually:

window.ctag.pageview();

Custom Events

Track any event with optional properties:

window.ctag.track('event_name', { 
  key: 'value',
  count: 42 
});

User Identification

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.

Common Tracking Patterns

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' });

Automatically Collected Data

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

Automatic Error Tracking

JavaScript errors and unhandled promise rejections are captured automatically.

What's Captured

Error Event Data

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)

Disabling Error Tracking

To disable automatic error tracking:

<script
  src="https://analytics.cloudlineconsulting.com/ctag.js"
  data-key="C-YOUR_API_KEY"
  data-errors="false"
  async
></script>

Privacy

CAnalytics is designed for privacy compliance.

No Cookies

CAnalytics does not use cookies. User identification relies on localStorage with anonymous IDs.

No Personal Data

Compliance

Data Storage

Team Management

Invite team members and manage permissions.

Roles

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

Inviting Members

  1. Go to Settings in the dashboard
  2. Enter the email address and select a role
  3. Click Send Invite
  4. The invitee receives an email with an accept link
  5. Invites expire after 7 days