Skip to main content
DevTune pulls hourly AI bot counts for a published GitBook site from GitBook’s site insights. Use it for docs hosted on GitBook, where you can’t put Cloudflare in front of the domain or run edge middleware. GitBook doesn’t share visitors’ IP addresses or response status codes, so every GitBook count is unverified: DevTune can’t confirm a bot is who it claims to be. GitBook reports a 404 only for page views on the site itself, so 404 Demand gets GitBook’s 404 page views, never its server-side or Markdown fetches.

Before you start

  • A paid plan that includes AI Traffic, and the project Admin role. See Set up AI Traffic.
  • A published GitBook site. DevTune records counts under the site’s published URL.
  • A GitBook API token that can read the site. Create one in GitBook under Settings › Developer settings. DevTune uses it only to read the site’s analytics.
Each project connects one GitBook site.

Connect the site

  1. Open the site’s dashboard in GitBook and copy the two IDs from its URL: app.gitbook.com/o/<organization ID>/sites/<site ID>. The site ID starts with site_.
  2. In DevTune, open Settings › Integrations and select Set up on GitBook under Crawler sensors.
  3. Enter the Organization ID, the Site ID and the GitBook API token.
  4. Select Connect GitBook.
DevTune reads the site from GitBook to check the token and find its published URL, then stores the token encrypted. It never shows the token again. If Cloudflare or edge middleware already counts the site’s hostname, the GitBook row says so, and GitBook’s counts for that hostname are not added. Keep one crawler sensor per hostname.

What happens next

The pull runs hourly. The first sync reads the last 30 days, so a site AI crawlers already visit arrives with last month’s crawls and answer fetches in it. Later syncs read the hours since the last one. GitBook counts appear in Insights › AI Traffic as crawls and answer fetches on the site’s hostname, and its 404 page views appear in 404 Demand. When a window includes GitBook counts, AI Traffic and 404 Demand say so and name the hostnames. Over the API, GET /projects/{projectId}/traffic/summary labels them the same way in its gitbook field, as does the MCP server’s devtune_get_traffic_summary tool.

Check GitBook is working

  1. Until the first sync runs, the GitBook row reads Waiting for first sync.
  2. After the next hourly sync, reload Settings › Integrations. The row reads Active, with Last synced and the time of the sync.
  3. Open Insights › AI Traffic and select Crawls & fetches. The first sync’s 30 days appear here.

Fix a connection error

If GitBook stops syncing

When GitBook rejects the token, for example after it was revoked, the row reads Reconnect needed and syncing pauses. DevTune tells the account owners in the app and by email. Select Manage, then Reconnect with a new token, and paste a new token. Syncing resumes on the next hourly run.

Disconnect GitBook

Select Manage on the GitBook row, then Disconnect GitBook, and confirm. DevTune deletes the API token and stops reading the site. Counts already recorded stay, still labelled as unverified GitBook counts. Revoke the token in GitBook to remove its access there. You can disconnect GitBook without AI Traffic in your plan, so a connection is never stuck after a downgrade. Connecting or reconnecting needs AI Traffic again.