Documentation

Friction signals and traffic quality

AnalyticFast can show where people struggle (rage clicks, fields that fail validation, forms started but never sent, checkouts that never turned into a payment) and how much of your traffic looks automated. Traffic quality works with the normal tracking script. Friction signals need one optional add-on.

Install the friction add-on

Open Settings → General → Tracking add-ons and tick Friction and site search (or use Turn on in the empty Friction card). Your main tracking tag then loads the add-on by itself within a minute. It sends through the main tracker, so it follows the same visitor, consent, cookieless and opt-out settings. If you serve the tracker through a first-party proxy, forward all of /js/*, not only /js/script.js, so the tracker can load its add-ons from the same place.

Or add the script by hand after your main analytics tag. It needs no site ID, and a hand-installed copy and the one the tracker loads never both run:

<script defer src="https://t.analyticfast.com/js/behavior.js"></script>

Use the tracking origin shown in Settings → General if you use a first-party proxy. If the add-on loads before the main tracker, its signals wait in the tracker's queue and are sent once it loads.

The add-on records:

SignalWhen
rage_clickThree clicks within 800 ms and 30 px of each other
form_invalidA field fails the browser's built-in validation (reported once per field per page, with the reason, such as valueMissing or typeMismatch)
form_submitA tracked form is submitted
form_abandonSomeone typed into or focused a form field, then left the page without submitting (sent on pagehide, with the last field touched)
checkout_startA click on any element marked data-af-checkout

At most 20 signals are sent per page. Single-field search forms and forms with role="search" are skipped.

Attributes

Checkout errors

Payment widgets render inside iframes the add-on cannot see. Report failures yourself from your payment library's error callback:

window.analyticfast('track', 'af_friction', { k: 'checkout_error', detail: 'card_declined' });

detail is a short reason code, clipped to 120 characters. Don't put personal data in it.

What counts as an abandoned checkout

A checkout click is abandoned when the same visitor has no payment within 24 hours. Clicks newer than 24 hours are shown as pending. Counts are per visitor, so someone who clicks "Buy" five times counts once. Attribution of the payment itself still uses your connected payment provider; see the provider guides.

Privacy

The add-on never reads or sends field values, typed text, passwords or page text. It sends only the form name, the field's name/id/type, the validity reason, and a short label for clicked elements (tag, id, up to two class names, and the visible label of buttons and links, at most 30 characters). If a button label or class name could contain personal data, put data-af-ignore on it. Friction signals don't create sessions, don't appear as goals and don't count toward plan event quotas. They follow your plan's data retention.

Traffic quality and bots

Every session gets a suspect flag computed at ingest from three signals:

Known bots and crawlers are already dropped before this point. The flag catches what remains: scrapers, headless browsers and click farms running from servers. VPN users on commercial VPNs may be flagged as datacenter traffic, so treat the share as a signal, not a verdict.

The Traffic quality report shows the human and suspect counts, the networks sending the most traffic, sources whose traffic is mostly flagged, and hours with sudden bursts. Add the filter traffic=human (or traffic=suspect) to any dashboard report, API query or MCP tool to count only one kind, and as_org to filter by network owner.

First-party proxies: if you send tracking through your own proxy, the network seen is the proxy's, not the visitor's. Behind a Vercel rewrite or a Cloudflare Worker proxy, AnalyticFast ignores the network so your visitors aren't flagged. With other proxies, the report warns when a single hosting network sends more than half your traffic.

Read API and MCP

Authenticated dashboard reads: GET /api/sites/:siteId/traffic-quality and GET /api/sites/:siteId/friction, with the usual period, from and to parameters; traffic quality also accepts filters. Ranges are capped at 31 days. MCP tools: traffic_quality, friction and investigate_site, which combines revenue, traffic, bots, friction and Search Console into ranked findings with the records behind each one.

Sources: Cloudflare request.cf properties, User-Agent client hints, invalid event, ValidityState, pagehide.