Skip to main content
The Cloudflare integration is a small Worker in your own Cloudflare account. It passes every request straight through to your site and sends RankRaft AI a copy afterwards, so it never slows down or blocks a visitor. Because it runs at the edge, it also sees requests served from Cloudflare’s cache, which a server-side plugin can’t. Sees: AI crawlers and AI referrals, including cached pages. There are two ways to set it up: connect Cloudflare and we install the Worker for you in a few seconds, or set it up by hand.

Before you start

Your domain must be on Cloudflare:
  • Its nameservers point at Cloudflare, and the zone shows Active in your Cloudflare dashboard. A free plan is fine.
  • The DNS record for your site has the orange cloud (proxied) turned on.
A Worker only runs on traffic that passes through Cloudflare. If your DNS is with your host or registrar, the Cloudflare option can’t work. Use the WordPress plugin, server logs or the website snippet instead, or move your DNS to Cloudflare first.
Shopify, Webflow and similar hosted builders often sit behind Cloudflare, but under the platform’s own Cloudflare account, not yours. Only the platform can run Workers there, so use the website snippet.
1

Open the Cloudflare tab

In RankRaft AI, open Integrations and choose Cloudflare.
2

Connect

Click Connect Cloudflare, sign in to Cloudflare and approve RankRaft AI on Cloudflare’s own consent screen. Choose the Cloudflare account that holds your domain.If your Cloudflare admin doesn’t allow third-party apps, open Can’t use Connect? Paste an API token instead. Create a custom token in Cloudflare with the four permissions below, paste it and click Install with this token.
3

We install the Worker

You land back on Integrations, which now says Installed by RankRaft on Cloudflare and lists the routes we added.
4

Set Fail open

Click Open the Worker in Cloudflare, go to Domains & Routes, and set each route’s failure mode to Fail open. This is the one setting Cloudflare doesn’t let apps change. See Why Fail open matters.
5

Check it's working

Visit your site, then press Check again at the top of Integrations. It turns green within a minute.

What we do in your Cloudflare account

When you connect, RankRaft AI:
  1. Finds the zone for your site’s domain in the account you connected.
  2. Checks that the zone is active, that your domain is proxied, and that no other Worker already runs on its routes.
  3. Creates a new site key just for this Worker, so a WordPress plugin or snippet already using your existing key keeps working.
  4. Uploads a Worker named rankraft-ai-<your-domain>, with that key as its only secret, RANKRAFT_SITE_KEY.
  5. Adds the routes example.com/* and, when it’s also proxied, www.example.com/*.
  6. Adds a cron trigger so the Worker checks in every 6 hours.
  7. Revokes and discards your Cloudflare sign-in or token.

Permissions

Connect asks for these four, and the API-token route needs the same ones: Your Cloudflare credential is used once and never stored, not by RankRaft AI and not in the Worker. We keep only non-secret details: the account and zone ids, the Worker’s name and its routes. If you used an API token, you can delete it in Cloudflare as soon as the install finishes.

When we refuse to install

We stop before changing anything, and say why, when:

Why Fail open matters

Cloudflare’s free plan includes 100,000 Worker requests a day. By default a route fails closed: once you pass the limit, visitors see Cloudflare Error 1027 for the rest of the day. With Fail open, your site simply skips the Worker until the limit resets. Cloudflare doesn’t let apps change this setting, so the Installed panel links straight to it. A site that regularly passes the limit needs Workers Paid ($5/month on Cloudflare).

Reconnect and remove

The Installed panel has two buttons:
  • Reconnect installs the Worker again with a fresh key and retires the old one. It doesn’t duplicate routes. Use it if the Worker was deleted or its route changed.
  • Remove from Cloudflare deletes the routes and the Worker we added, and revokes its key. It never touches routes that belong to other Workers.
Both also work with a pasted API token. Remove is available on every plan, including after a trial ends.

If the Worker stops reporting

The Worker checks in every 6 hours, even when nobody visits your site. If we hear nothing from it for 13 hours, owners of the account get one email and the panel turns amber with a Reconnect button. The alert clears by itself once data arrives again. If Cloudflare couldn’t add the cron trigger (the Workers free plan allows 5 per account), the check-in is off and we use traffic instead: the alert fires after 48 hours with no data.

When a trial or plan ends

The Worker pauses itself: it keeps passing every visitor straight through to your site, but stops sending us anything. Owners get one email with Upgrade and Remove links. Upgrade and it resumes on its own within the hour, with nothing to change in Cloudflare. New installs need an active trial or plan; removing always works.

Set it up by hand

Use this if you’d rather not connect your account, or if another Worker already runs on your domain. On the Cloudflare tab, open Set it up by hand instead.
1

Get your site key

Click Create site key and copy it.
2

Create a Worker

In your Cloudflare dashboard, go to Workers & Pages → Create → Start with Hello World!. Name it rankraft-ai and click Deploy.
3

Paste our code

Click Edit code, delete everything in the editor, paste the code shown on the RankRaft AI Integrations page (worker.js), then click Deploy.
4

Add your site key

In the Worker, open Settings → Variables and Secrets → Add. Choose type Secret, name it RANKRAFT_SITE_KEY, paste your key as the value, and click Deploy.
5

Send your site's traffic through it

Open Settings → Domains & Routes → Add → Route. Pick your zone and enter the route example.com/*.Set Failure mode to Fail open, so your site keeps working even if the Worker hits a limit.If visitors also use www.example.com, add a second route www.example.com/*.
6

Check it's working

Open your site in a new tab, then press Check again at the top of the RankRaft AI Integrations page. It turns green within a minute of the first visit.
A Worker set up by hand has no check-in, and we don’t email you if it stops: check Integrations if your data goes quiet. Pasted code doesn’t update itself: to get the latest version, which pauses itself when a plan ends, paste the current code from Integrations again.

Configuration

Deploying with Wrangler

If you manage Workers as code, deploy the same script with a wrangler.jsonc like this:
wrangler.jsonc
Then set the key as a secret:

What it sends

For each request, after the response has been returned to the visitor: timestamp, host, method, path, query string, visitor IP (CF-Connecting-IP), user agent, referrer, response status, response size, country and ASN. WebSocket upgrades and excluded paths are skipped. The Worker never modifies the request or the response.

Troubleshooting

  • Still “Waiting for your first data”. Check the route matches the hostname you visited (www vs apex). For a Worker set up by hand, check the secret is named exactly RANKRAFT_SITE_KEY.
  • Visitors see Error 1027. The Worker passed the free plan’s daily limit and the route fails closed. Set Fail open on each route, or move to Workers Paid.
  • Data stopped after creating a new site key. Create a new key retires every key on the site, including the connected Worker’s own. Click Reconnect to give the Worker a fresh one. A Worker set up by hand needs the new key pasted into its secret.
  • Cloudflare’s “Block AI Scrapers and Crawlers” setting. If it’s on (under Security → Bots), Cloudflare blocks AI crawlers before they reach your Worker or your site. Turn it off if you want AI engines to read your site.