Skip to main content
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.
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. The first-party proxy can improve collection when ad blockers target the CDN or collector, but the collector sees the proxy rather than the visitor. Accurate IP exclusions, country/city attribution, and map data are therefore lost. Forwarded geo headers do not restore that accuracy.
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.

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

Tracker attributes

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" overrides the default https://aiola.app/api/collect-analytics endpoint. The ad-block bypass tag uses this.
  • 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.
For example, opt into query-string pageviews by adding the attribute to the standard tag:

Custom events, identity, and manual revenue

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.

Connect search keywords

  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.

Connect Stripe 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.

Security and data management

  • 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: 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.

Verify collection

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.
Monthly plan usage is based on billable events: pageviews and custom events, excluding _leave, _identify, and _scroll. If the monthly limit is exceeded, the dashboard is locked until upgrade or reset, but collection continues and no data is lost.