Sign inGet started
Learn

How to track website traffic

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

How to set up website tracking that tells you where visitors come from and what they do: the tag, events, UTM tags, consent, search data and AI crawlers.

Updated

To track website traffic, put an analytics tag on every page, send the actions that matter as events, tag your campaign links, and connect the sources that see what the tag can't, such as Google Search Console. That gives you visits, where they came from and what they led to. With nextanalytica, your agent does most of it: ask "Add nextanalytica to my site", and it adds the tag, shows you the change and asks before committing.

1. Add the tag to every page

The tag is one script line in the shared layout of your site. It counts page views, visits, where they came from, clicks, forms, scroll depth, errors and page speed on its own.

index.html
<script async src="https://t.nextanalytica.app/t.js" data-project="na_…"></script>

Copy the line with your project's key from Site. Where it goes in Next.js, Nuxt, WordPress, Webflow and others: Add the tag.

2. Send what matters as events

Page views don't tell you who signed up or bought. Send those actions yourself:

window.nextanalytica.track("signup_completed", { plan: "team" });
window.nextanalytica.order({ ref: "A-10492", value: 129.9, currency: "EUR" });

Mark the ones that count as conversions, and your agent reads conversion rates by channel and page. See Custom events and Revenue tracking.

Add utm_source, utm_medium and utm_campaign to every link you share in emails, ads and posts, so each visit is credited to its campaign. See UTM tags.

In the EU, analytics that stores something on the device usually needs a yes. nextanalytica's tag counts without cookies until the visitor answers, so you don't lose the visitors who never click your banner. Pass the answer on every page. See Cookieless counting and consent.

5. Connect what the tag can't see

  • Google Search Console: the searches that showed your site, with clicks and positions. See Google Search Console.
  • AI crawlers: bots like GPTBot and ChatGPT-User never run the tag; a sender on your server counts them. See AI crawlers.
  • Your server's events: payments and sign-ups your server confirms. See Revenue tracking.

6. Check it works, then ask

Ask your agent "Check my nextanalytica setup": check_setup says which hosts are sending and what to do next. Then ask the questions you set it up for:

  • "Where did visitors come from this week, and which channel converts best?"
  • "Which pages do people land on from Google?"
  • "How much traffic came from ChatGPT?"

This command adds nextanalytica to Claude Code:

claude mcp add --transport http nextanalytica https://mcp.nextanalytica.app/mcp

Next steps

Related
  • How to check your website traffic: Four ways to check your website's traffic, from analytics to Search Console and server logs, what each one counts, and how to ask your agent instead.
  • Bounce rate: What bounce rate means, how it's calculated in nextanalytica and in GA4, why the two differ, and how to find the pages people leave.
  • UTM tags: What UTM tags are, the parameters and which ones to always set, naming rules that keep reports clean, and how to read campaigns by UTM with your agent.
  • Revenue tracking: Track revenue on your website so every order ties to the visit, channel and campaign it came from, from the browser, your server or WooCommerce.
  • Attribution models: How your agent credits each order to the visits before it, by last click, first click or linear, with ROAS by ad account and LTV by channel.
  • ROAS by ad: How your agent shows spend, orders, revenue and ROAS for each Meta and Google ad, and the one setting Meta needs so a visit names its ad.
Still have questions?
Was this page useful?