+
Deploy a Cloudflare Worker for Webflow sites
Promptwatch can capture crawler logs when your Webflow site proxies traffic through your own Cloudflare zone. This is called Origin-to-Origin (O2O) — traffic hits your Cloudflare zone first, then forwards to Webflow. Configure DNS first, then deploy the Cloudflare Worker below.
Step 1: Set Up Proxied DNS for Webflow
Set up proxied DNS for Webflow in your Cloudflare zone. Follow Cloudflare’s Webflow guide:
- Create a proxied CNAME record pointing your domain to
cdn.webflow.com.
- Set Proxy status to Proxied (orange cloud).
Your DNS must be set up via CNAME — A records are not supported for forwarding traffic through Cloudflare Workers.
Create an access token so Promptwatch can deploy the crawler log Worker for you
We’ll automatically discover your Cloudflare zone, upload the script, and configure the route.
The token is only used for this deployment and is never stored.
Step 1: Create an API token on Cloudflare
Go to
dash.cloudflare.com → My Profile → API Tokens
and create a new Custom Token.
Enable the following permissions:
- Account / Workers Scripts / Edit — Upload the crawler-log Worker script
- Zone / Zone / Read — Locate your Cloudflare zone by domain name
- Zone / Workers Routes / Edit — Attach the script to your domain route
Step 2: Paste the token and deploy
We’ll take it from here — the rest is automatic.
Auto-deploy is only available inside the Promptwatch app. Open Crawler Logs → Settings, select Webflow + Cloudflare, switch to the Auto Deploy tab, paste your Cloudflare API token, and click Deploy Worker.
Step 2: Create an API Key
Create an API key in Promptwatch. Go to Settings → API Keys in your Promptwatch dashboard.Step 3: Create an Application
Create a new application in your Cloudflare account:
- Go to your Cloudflare dashboard → Workers & Pages
- Click Create application
- Click Start with Hello World!
- Give it a name (e.g.,
promptwatch-analytics)
- Click Deploy
Step 4: Paste the Worker Script
On the Worker page, click Edit in the top right corner and paste in the code below:Promptwatch identifies AI crawlers automatically and only stores AI crawler visits, all other traffic is discarded. You can safely send all your server logs without worrying about non-crawler data being retained.If you prefer to only forward AI crawler traffic, you can use the user agents listed below to pre-filter on your side. Keep in mind that you’ll need to maintain this list yourself as new crawlers emerge.Step 5: Environment Variables
In your Worker settings, add a secret for your API key:
- Open the Settings tab for your Worker
- Under Variables and secrets, click Add
- Select Secret
- Set the name to
ANALYTICS_KEY
- Set the value to the API key you created in step 2
Step 6: Deploy to a Route
Deploy your Worker to a route:
- Navigate to Domains
- Select the domain you’re setting up
- In the left-hand navigation, click Worker Routes
- Add a new route:
yourdomain.com/*
- Select your Worker from the dropdown
- Save and deploy
The Worker will intercept all requests to your domain. It transparently passes through all traffic while logging HTML page views to Promptwatch.
Step 7: Verify Cloudflare Proxy is Enabled
Verify your domain’s DNS records have the Cloudflare proxy enabled (orange cloud icon). Workers Routes only intercept traffic that flows through the Cloudflare network. If the proxy is off (gray cloud / “DNS only”), requests go directly to your origin and bypass the Worker entirely.Go to your Cloudflare dashboard → DNS → Records and make sure the Proxy status shows the orange cloud (“Proxied”) for your domain’s A/AAAA/CNAME records.
Step 8: Finish
Once deployed, your Worker will automatically send crawler logs to Promptwatch.