Skip to main content
Install the browser tag for human traffic, then add crawler, search, and revenue integrations only when needed.

Create/enable analytics site

Open Settings → Analytics in the project you want to track. If analytics is not enabled, enter the production hostname and select Enable Analytics. Use a hostname such as yourdomain.com; do not include https://, a path, or a port. Enabling analytics creates the project’s Tracking ID. The Domain is required both when enabling analytics and afterward: the collector rejects every event until a valid domain is saved.

Required tracking ID and domain

There is no Analytics secret key.

Canonical browser tag

Only 1. Embed Script is required. 2. Ad-block Bypass and 3. Bot / AI Crawler Tracking are independent, optional additions.
1

1. Embed Script (required)

Add the following tag to the <head> shared by every page. Replace YOUR_TRACKING_ID with the Tracking ID shown in Settings → Analytics and replace yourdomain.com with the saved domain.
The direct script posts to Aiola’s collector and preserves accurate visitor IP exclusions, country/city data, and map data.
2

2. Ad-block Bypass (optional)

For a Next.js site, add these rewrites to next.config.ts:
Then use this tag instead of the tag from step 1:
Never install both tags. Proxy only the script. Do not proxy the collector itself: a server-side proxy hides the visitor behind your server, so country, city, map data and IP exclusions are lost. Tags that still set data-host-url keep working — the tracker posts to aiola.app first and only falls back to your proxy when a blocker stops the direct request.
3

3. Bot / AI Crawler Tracking (optional — pick ONE)

AI crawlers never execute JavaScript, so the browser tag cannot see them. Choose exactly one server-side or edge implementation for the stack that receives every page request. These calls post directly to https://aiola.app/api/bot-crawl-ingest; ad blockers do not apply.
Add both sections below. Middleware records normal crawler requests and forwards the requested path; app/not-found.tsx records crawler 404s because middleware runs before the response status is known.
The snippets test the User-Agent before sending anything, skip static assets, keep robots.txt, llms.txt, and sitemap requests, send country in the JSON body when the platform provides it, and report status codes where the stack can observe them.

Setup Health implications of proxying

Setup Health detects a missing tag, tracking-ID mismatch, and collector proxying. Proxy only the script for blocker bypass; visitor geo comes only from direct requests to the aiola.app gateway.

Bot tracking architecture

The optional server/edge snippets above are required because crawlers do not execute the browser tag.

Current supported bot UAs and classification

The generated BOT_RE in each tab is the app’s current supported list. The collector reclassifies matches: fetch → Answers; search/index → Indexing; crawl → Training; ads/social/remaining → Other.

Bot endpoint payload/validation/limits

Optional script-only ad-block bypass

The script rewrite in step 2 is the supported bypass. Do not proxy the collector.

Add to App

The Add to App button in the analytics settings header opens an AI thread with the current Tracking ID, Domain, and endpoints. Its prompt first inspects the project to detect the real framework and runtime, then:
  • installs the browser tag at the correct global layout, template, or entry point
  • avoids duplicating an existing Aiola integration
  • can add the optional same-domain proxy using the stack’s native rewrite mechanism
  • can add optional server-side or edge bot tracking at the request interception point, including 404 handling where supported
  • adds Stripe cookie metadata when Stripe is connected, or shows the manual revenue option otherwise
The Stripe section has its own Add to App action. It searches for the production Checkout Session creation path, detects the server framework, and adds the two Aiola cookie values without duplicating existing metadata.

Complete tracker-attribute reference

Add these attributes to the single installed script tag when needed:
  • data-site-id="YOUR_TRACKING_ID" selects the project and is required.
  • data-domain="yourdomain.com" allows that exact hostname and its subdomains. If the current hostname is not allowed, the tracker exits without sending.
  • data-domains="one.example.com,two.example.com" adds a comma-separated list of allowed hostnames; each entry also allows its subdomains.
  • data-host-url="/api/collect" is a legacy fallback collector URL, used only when the direct request to https://aiola.app/api/collect is blocked. Leave it unset.
  • data-track-query="true" counts a query-string-only URL change as a new pageview. It is off by default; url_query is still sent with events either way.
  • data-track-hash="true" includes the hash in the tracked path and counts hash-router navigation.
  • data-do-not-track="true" makes the tracker honor the browser’s Do Not Track setting.
  • data-auto-track="false" disables automatic page tracking.
  • data-track-scroll="true" is parsed but no collection pipe reads scroll data; treat it as unsupported/diagnostic.
For example, opt into query-string pageviews by adding the attribute to the standard tag:

Browser payload and public APIs

The exact browser envelope and every field are listed in Analytics.

Browser/collector limits

Custom events and identity

After the script loads, use the global API:
The signatures are window.aiola.track(name, props) and window.aiola.identify(id, props). Event names are limited to 100 characters, and oversized event properties are discarded if their serialized data exceeds 6,000 characters. You can also track a click declaratively:
The tracker creates aiola_visitor_id with a 365-day cookie expiry and aiola_session_id with a sliding 30-minute expiry. Both use SameSite=Lax, path=/, and Secure on HTTPS. The visitor ID also uses local storage as a fallback.

Exclude unwanted traffic

Configure exclusions in Settings → Analytics:
  • IP addresses: one IPv4 or IPv6 address, or an IPv4 CIDR range such as 203.0.113.0/24.
  • Paths: an exact path such as /admin, or a prefix ending in *, such as /admin/*. Query strings are not used for path matching.
  • Countries: visitors whose signed worker geo resolves to the selected two-letter country code.
  • Hostnames: an exact hostname and all its subdomains, such as preview.yourdomain.com.
The settings page shows Desktop public IP: … — click to exclude. This is the desktop app’s current public IP; a visitor on another network or IP family can still appear under a different address. IP exclusions match the address seen by the direct Aiola worker request, so they are not reliable through the optional proxy.

Search-provider mapping

  1. Open Settings → Integrations and connect Google Search Console and/or Bing Webmaster Tools.
  2. Return to Settings → Analytics → Search Keywords.
  3. Select the Google Search Console property and Bing Webmaster site for this project. If multiple connected accounts exist, the selector groups properties by account.
The dashboard can then display search queries and pages, and the Indexing panel can report Google indexing reasons and Bing crawl issues. Search Console data has an approximately 48-hour delay.

Stripe/manual revenue

Connect Stripe from Settings → Integrations. Once the analytics setting shows Connected, pass the tracker cookies as Checkout Session metadata so the webhook can attribute revenue to the correct visitor and marketing channel.
Choose Display Currency in Settings → Analytics to control how the dashboard converts and presents revenue totals.

Exclusions and Attack Mode

Each per-site exclusion list is capped at 50 entries. Attack Mode applies the stricter limits and UA/IP checks in Analytics.

Import/export/clear/disable limits

  • Attack Mode: enables stricter bot and headless-browser detection, per-IP limits, and per-site limits. Use it when analytics is receiving spam or the site is under attack.
  • Export: downloads CSV for this month, last month, the current or previous year, or a custom month range. An export is truncated at 100,000 rows; narrow the range if that happens.
  • Import: accepts at most 10 MiB, 100,000 source rows, and 500,000 expanded events.
  • Import: Fix CSV with AI converts a CSV from another provider into Aiola’s UTC schema and saves the fixed file to Downloads for re-upload. Direct Import (auto-detect) imports CSV or TSV directly.
  • Clear Data: permanently deletes all pageviews, events, sessions, charts, breakdowns, and historical analytics for the project. Export first if the data may be needed.
  • Disable Analytics: pauses collection while preserving existing data. Re-enable it later to resume collection.
Aiola stores timestamps in UTC and displays them in the workspace timezone configured in Central settings. Imported local timestamps must be converted to UTC.

Verification

After deployment:
  1. Visit the production domain and navigate between a few pages.
  2. Open the project’s Analytics dashboard and verify visitors, sessions, and Views.
  3. Open the realtime globe to confirm the active visitor and event stream.
  4. If crawler tracking is installed, test the server route with a matching crawler User-Agent and verify the AI view. The browser tag alone cannot perform this test.
  5. If Stripe or search providers are connected, verify the selected property/site and the Checkout Session metadata before expecting attribution.
  6. Use the project dashboard’s Analyze with AI action to open a reporting thread for a preset or custom date range.
Retention is not a dashboard section. Request it through the Aiola MCP by calling get_analytics with the analytics_retention pipe and the workspace timezone.

Confirmed quota behavior only

Monthly plan usage counts pageviews and custom events, excluding _leave, _identify, and _scroll. Monthly-quota overages are never rejected: enforcement is dashboard-side, so collection and storage continue and upgrading unlocks the analytics. The collectors return 402 and do not store events when subscription access fails because the owner has neither a Pro plan nor an active trial.