Browse docs
Sprid docs

Connect Cloudflare (optional)

Read traffic reports for your website.

Before you start

Access to your domain’s Cloudflare account and permission to create a token. Enable Web Analytics for visitor reports; basic request counts include bots.

Set it up

  1. Open Cloudflare → profile icon → My Profile → API Tokens.
  2. Create Token → Custom token → Get started, named Sprid.
  3. Permissions:
    • Zone → Analytics → Read
    • Account → Account Analytics → Read
  4. Zone Resources → Include → Specific zone: your domain.
  5. Account Resources → Include: your account.
  6. Leave Client IP Address Filtering and TTL empty. Continue to summary → Create Token.
  7. Copy the token and leave it on your clipboard. It is shown once.

For a connection that survives you leaving the team, create an account-owned token instead under Manage Account → Account API Tokens, with the same permissions.

Find your Account ID

Your domain → Overview → API card: copy Account ID. Visitor reports need it and your website’s address saved in Sprid. Copy Zone ID too if you also want the domain’s request counts.

Connect to Sprid

Run in your terminal
sprid connect cloudflare --app <slug> --key-from-clipboard --account-id 0123456789abcdef0123456789abcdef

Use your own app slug and Account ID. Add --zone <Zone ID> for request counts. Keep the token out of chat.

Cloudflare answers your website traffic only when no other analytics provider is connected; see Only one provider answers.

Typing the command yourself? Copy the token last, as Keys from your clipboard explains, with the fallback for a shell without a clipboard.

Check the connection

Run sprid status, then ask your agent: “Check that Sprid can read recent Cloudflare traffic for this domain.” The check names the domain and says whether visitor reports or only request counts are available.

If something goes wrong
  • Access denied: API Tokens → ⋯ → Edit. Check both Read permissions and the selected domain and account.
  • Domain not found: use the Zone ID, not the domain name.
  • Visitor reports are empty: enable Analytics & Logs → Web Analytics and check the tracking snippet is on your site.
Investigate with this connection

Reads rum and http. RUM is pinned to the saved account and hostname; beacon traffic is sampled and not verified human.

Run in your terminal
sprid marketing-review capabilities --app <slug> --source cloudflare --json

See connected queries.

Sources and verification

Prefer your terminal? sprid docs cloudflare reads this same guide.

Need a hand?
Colour theme
Back to Sprid ↗