Skip to article
On this page

Ahrefs Web Analytics explained: cookieless traffic data

NyXi

NyXi

7 min read

Ahrefs Web Analytics is a free, cookieless analytics script that reports traffic, top pages and referrers. What the data-key identifies, what cookieless costs you in reporting.

If Tag Explorer has shown you an Analytics card pointing at analytics.ahrefs.com, that is Ahrefs Web Analytics. It is a free, deliberately small analytics script from Ahrefs, and its selling point is what it leaves out: it sets no cookies and it is a fraction of the size of a full analytics stack. Paste your page into Tag Explorer to see this tag on your own site.

What it gives you is the plain version of the question every site owner asks. How much traffic did I get, which pages got it, and where did it come from. What it does not give you is the deep event and conversion model that GA4 provides, which is why the two usually run together rather than one replacing the other.

What it actually does

The script records page views and reports them back to Ahrefs, where they become a small set of straightforward views: traffic over time, your top pages, and your referrers, meaning which sites and search engines sent people to you.

That is close to the whole feature set, and the simplicity is deliberate. There is no funnel builder, no audience editor and no custom event schema to design. For a site owner who opens analytics once a week to check whether things are going up or down, that can genuinely be more useful than a platform they never learn.

The second attraction is weight. It is one small script with no cookie writing and no identity stitching, so it costs the page very little. Ahrefs’ own Web Analytics page is the reference for the current feature set and limits, which do change.

What the ID means

This one does not follow the usual pattern, which is why people miss it in a page source. There is no prefixed code like G-XXXXXXXXXX or GTM-XXXXXXX. Instead the script tag carries a data-key attribute holding a long random-looking string, and the script itself is loaded from analytics.ahrefs.com.

That key is what tells Ahrefs which project the data belongs to. It is public, in the sense that anyone viewing your page source can read it, exactly like every other tracking ID on the page.

You get the snippet, key included, from the Web Analytics section of your Ahrefs account. The site also needs to be verified in that account before the data is of any use to you, which is the step most often skipped when somebody pastes a snippet they were sent.

Cookieless, and what that costs you

Cookieless is the headline feature, and it is a real one. Third-party cookies keep getting restricted and browser tracking prevention keeps tightening, so a tool that never depended on cookies in the first place is not exposed to that direction of travel at all. Nothing about it degrades as the rules change.

The cost is identity. Without a cookie there is no reliable way to recognise that today’s visitor is the same person who came last week, so the reporting is naturally oriented around page views and sources rather than individual journeys over time. If your question is “how many people came back and eventually bought”, this is not the tool that answers it.

The consent picture follows from the same fact. Ahrefs states that it sets no cookies and collects no personal data, which is why sites frequently treat it differently from cookie-based analytics. Whether that actually changes your obligations depends on the consent rules that apply to your traffic, so take the technical fact from Ahrefs and the legal conclusion from whoever advises you. They are not the same statement.

How it sits alongside GA4

Expect the two to disagree, permanently, and stop trying to reconcile them. They count differently, treat sessions differently, filter bots differently, and one of them may be held back by a consent banner while the other is not. Two analytics tools producing identical totals would be the surprising outcome.

What that disagreement is good for is sanity checking. If GA4 shows a sudden collapse in traffic and Ahrefs Web Analytics shows a flat line, the likely problem is your GA4 setup rather than your traffic. That is a genuinely useful second opinion and a decent reason to keep a lightweight tool running.

What it cannot do is feed advertising. There is no conversion export, no audience building and no link into ad platforms, so if a campaign needs measuring, that job stays with GA4 and the relevant conversion tags.

What this looks like in Tag Explorer

Tag Explorer draws your page as a tree. Each Tag Manager container is a branch, the tags inside it are leaves underneath, and anything hard coded into the page HTML sits under DIRECT ON PAGE.

Ahrefs Web Analytics appears as an Analytics card. Because the identifier lives in a data-key attribute rather than a recognisable prefixed code, you may see the tag type as the card title with no copy button rather than a key you can lift. That is normal and not a fault. The info icon opens a short definition and the Learn more link that brought you here.

This tag very often sits under DIRECT ON PAGE, because the snippet is usually pasted straight into the site’s <head> or added through a theme setting. That is fine. It only matters when it is also present in a container, which means it is installed twice: the tool then shows a duplicate banner and tints the affected cards red with an attention badge.

The usual limits apply. The public container file never contains the human names you gave your tags, only the tag type and the tracking ID. The tool reads the published container only, so a tag added in a Tag Manager workspace nobody submitted will not appear. And a scan proves the tag is installed, not that it fired: for that, open the page with the browser DevTools Network tab and watch for the request to analytics.ahrefs.com, or look for your own visit in the Ahrefs dashboard.

What to do if it is missing, duplicated or dead

Missing. If you expected it and there is no card, the script is not on the page you scanned. Because it is so often hard coded, the usual cause is a page template that never received the snippet, for example a landing page built outside the main theme. Scan two or three different page types rather than the homepage alone. Analytics is not retrospective, so a template that has been missing the tag for months cannot be backfilled.

Duplicated. Two cards means the script loads twice, usually a theme install plus a later Tag Manager install added by somebody who did not know about the first. Page views are counted twice and your traffic graph is wrong by an amount nobody can calculate. Keep one copy, and prefer the container copy, because it is the one you can change without a developer. If the two cards carry different keys, the site is reporting into two projects, so pick the one you actually log into and remove the other.

Dead or stale. The tool is current, so no tag here is dead by age. The stale case is a key belonging to an Ahrefs account nobody on your side can open, which leaves a script running on every page view for reporting you will never see. Replace it with a key from an account you control, or remove it outright. A tag that only serves somebody else is weight with no return.

If you want to know whether your analytics is installed once, twice, or feeding an account nobody can open, run the page through Tag Explorer and check a few different page types while you are there. Making sure the pages those numbers describe are actually built to be found and to convert is what our content and SEO structure work covers.

Frequently asked questions

What does the Ahrefs Web Analytics data-key look like?

It is a long random-looking string carried in a data-key attribute on the script tag itself, rather than a prefixed code like GA4's G- measurement ID. The script is loaded from analytics.ahrefs.com. You get the snippet, data-key included, from the Web Analytics section of your Ahrefs account.

Can Ahrefs Web Analytics replace GA4?

For most sites, no. It reports traffic, top pages and referrers clearly, but it has no event and conversion model, no audience building, and no link into advertising platforms. It works best as a simple second opinion running alongside GA4, not as the only thing measuring your site.

Does it need a cookie consent banner?

Ahrefs states that it sets no cookies and collects no personal data, which is why sites often place it differently from cookie-based analytics. Whether that changes your own obligations depends on the consent rules that apply to your traffic, so confirm it with whoever advises you rather than assuming. The technical fact and the legal conclusion are separate things.

Why do its numbers disagree with GA4?

They will always disagree, and that is expected. The two tools count differently, define a session differently, filter bots differently, and one of them is blocked by consent choices while the other is not. Use each for trends over time rather than trying to reconcile the totals.

Why is it showing on a scan but reporting nothing?

The usual cause is that the script is installed but the site was never verified in the Ahrefs account it belongs to, or the data-key is from a different account. Another is that the tag only loads on some pages. Check the key in your account matches the one on the card, then scan a second page.

More articles