Skip to main content
Connect the sensors that feed AI Traffic, in order, and confirm each one works. For which sensors your project needs and what each one measures, read Choose your sensors first. Connect them in this order:
  1. A crawler sensor — Cloudflare pull, edge middleware or a Vercel log drain, one per hostname. This is the only sensor that sees AI crawls, answer fetches, and 404 demand.
  2. Website analytics and Search Console — connect GA4 or PostHog for referral sessions and conversions. Connect Search Console for Google search clicks and impressions.
  3. The tracking snippet — an optional first-party record of AI referral page views. Edge middleware version 0.13.0 or later records them too.

Before you start

  • A paid plan that includes AI Traffic. Without it, Settings › Integrations shows the sensors but can’t connect them.
  • The project Admin role, which team Owners hold on every project.
Each sensor’s guide lists what else it needs.

Where setup lives

Sensors are connected and repaired in Settings › Integrations. You can also reach it from Home: select Coverage, then Integrations. The tab groups connections into Crawler sensors, Website analytics, and Search performance. Each row shows its status and latest activity. Snippet and middleware rows show up to 20 recently observed hostnames from the current configuration, as a recent sample. Choose Set up to connect a provider, or Manage to review an existing connection. Use one analytics provider per site: GA4 or PostHog.

Connect a crawler sensor

AI crawlers and answer fetchers often do not run JavaScript, so DevTune reads them server-side. Choose one crawler sensor per hostname.

Cloudflare pull

For docs, marketing or static hostnames already proxied by Cloudflare. Nothing is installed on your site: Connect Cloudflare pull.

Edge middleware

For Vercel, Next.js, Express or Node apps where request middleware can run. Install @devtune/ai-traffic in your app’s proxy or middleware: Install edge middleware.

Vercel OIDC without an ingest key

On Vercel, link the Vercel project instead of setting an ingest key: Vercel OIDC without an ingest key.

Vercel log drain

For Vercel projects on a Pro or Enterprise team, with no code changes: Connect a Vercel log drain.

Crawler sensor capabilities

What each crawler sensor records, how fresh it is and what it can’t see: Compare the crawler sensors.

Connect Google Analytics 4 and Search Console

Both connect by signing in with Google from Settings › Integrations: Google Analytics 4 under Website analytics, and Google Search Console under Search performance.
  • Google Analytics 4 — choose the property, the web stream, the tracked domain it maps to, and the key events you count as conversions. If you select no key events, sessions still sync but conversions stay empty rather than reading as zero.
  • Google Search Console — choose the property. DevTune uses clicks and impressions to compare AI traffic against classic search, and to avoid recommending a rewrite to a page already earning Google traffic.

Install the tracking snippet

Add the snippet to every page of your site: Install the tracking snippet.

Proxy setup

To send snippet requests through your own domain, for first-party routing or when ad blockers drop the beacon: Proxy setup.

Verifying your sensors

Each sensor confirms itself differently, and they do not all confirm at the same speed.
A quiet site is not a broken one. A hostname that goes an hour without an AI crawler hit still reports as Active — see how current each sensor stays.

Check sensors from an agent

Your agent can read the status of six sensors over the API or the MCP server with the traffic.read scope: GET /projects/{projectId}/traffic/sensors, or the devtune_get_traffic_sensors tool. They are the edge middleware, the tracking snippet, Cloudflare, the Vercel log drain, Search Console and GA4; PostHog and GitBook are not included. For a set-up sensor, the status is the measurement verdict Project Home reports. Each sensor also shows when DevTune last accepted data from it and why its connection needs repair. See the response fields. To be told when a sensor stops reporting and when it recovers, subscribe a webhook to traffic.sensor.stopped and traffic.sensor.recovered.
  • Search Console and GA4 — the response includes a link that starts Google consent. Give it to a person who can manage DevTune on the account: they sign in to DevTune if needed and finish consent in the browser.
  • GA4 — with the setup.write scope, the agent can disconnect a connection: DELETE /projects/{projectId}/traffic/sensors/ga4/{connectionId}, or devtune_disconnect_ga4. It runs as the person the API key or MCP connection acts for, who holds Admin on the project. As with Disconnect here, this works on a paused project and without an AI Traffic plan. DevTune attempts to revoke the Google grant, and a failed revoke doesn’t block the disconnect. If someone reconnects the same stream and domain, the connection keeps its ID, so repeating the call disconnects it again; another stream or domain gets a new ID.
With the setup.write scope, the agent can also make the changes Settings › Integrations makes for these sensors. Each runs as the person the API key or MCP connection acts for, who holds Admin on the project. They work on a paused project, as the settings page does. A write that collides with a change made at the same moment is refused with reason concurrent_update and details.retryable: true; retry it.
  • Edge middleware ingest key — POST /projects/{projectId}/traffic/sensors/edge-middleware/ingest-key/rotate, or devtune_rotate_traffic_ingest_key, issues a new key and returns it. The key is shared by every site that sends traffic to this project, so a person deploys the new key to all of them. The previous key keeps working for 24 hours after the rotate; once every site uses the new key, revoke the previous one with POST .../ingest-key/revoke-previous, or devtune_revoke_previous_traffic_ingest_key. Rotating again while the previous key still works is refused. If a rotate response is lost, don’t revoke the previous key, because your sites still send it: copy the current key from Settings › Integrations and deploy it before the previous key stops working.
  • Cloudflare — save an API token for a zone with POST .../cloudflare/sources, or devtune_save_cloudflare_source, then a hostname with POST .../cloudflare/hostnames, or devtune_save_cloudflare_hostname. To add a hostname on a zone you already connected, use the sourceId the sensor status lists for its Cloudflare connections. Saving the token again replaces it. DevTune doesn’t check the token or zone with Cloudflare when you save, so check the sensor status again after the next hourly pull. Pause or resume a hostname with PATCH .../cloudflare/hostnames/{connectionId}, and delete it with DELETE on the same path. Resuming puts a broken hostname back in the next hourly pull. DevTune never returns the token.
  • Search Console — DELETE .../search-console/{connectionId}, or devtune_disconnect_search_console, disconnects a connection and deletes its stored Google credential. Like the GA4 disconnect, it works without an AI Traffic plan.
  • Vercel log drain — a person installs the Vercel integration once from Settings › Integrations. After that, the agent can list up to 100 of the Vercel projects the install can see with GET .../vercel-drain/projects, or devtune_list_vercel_drain_projects (this needs the setup.read scope), and create the drain on some of them with POST .../vercel-drain, or devtune_create_vercel_drain. The agent can create the drain on a connection that has none yet, or create it again after it errored or needs reconnecting. An active drain is refused, so a retried create never makes a second drain; to change the Vercel projects of a working drain, disconnect it and have a person install the integration again. If the create fails, the connection stays errored with the reason. When Vercel refuses the request, the error has reason vercel_request_rejected and the same request fails again; when the test delivery fails or Vercel can’t be reached, reason vercel_request_failed, and a later retry can succeed. DELETE .../vercel-drain, or devtune_disconnect_vercel_drain, disconnects it and deletes the drain in Vercel, and works without an AI Traffic plan. A disconnect that loses to another made at the same moment finds no drain and returns reason vercel_drain_not_installed. If Vercel stops accepting the install, a person installs the integration again here.
The ingest key, Cloudflare and Vercel drain changes, except disconnecting the drain, need AI Traffic Events in your plan.

Next steps