Cloudflare Logpush
Cloudflare Logpush streams every request's User-Agent to AttractOS for server-side bot detection. This catches AI bots that block JavaScript, providing complete visibility into which crawlers access your content. Setup takes under 5 minutes using our 1-click OAuth flow.
Why Use Cloudflare Logpush?
Client-Side Script
- Only detects bots that run JavaScript
- Detects LLM referrals
- Tracks conversions
- Works on any website
Client Script + Logpush
- Detects ALL bots (JS or not)
- Detects LLM referrals
- Tracks conversions
- Complete AI traffic picture
Prerequisites
- Cloudflare Pro plan or higher — Logpush is not available on Free
- Domain on Cloudflare — DNS must be proxied (orange cloud)
- AttractOS account — Any plan works
Setup via Dashboard (Recommended)
Use our 1-click OAuth integration:
- 1
Go to Integrations
In your AttractOS dashboard, click Integrations in the sidebar.
- 2
Connect Cloudflare
Click Connect Cloudflare. You'll be redirected to Cloudflare to authorize.
- 3
Authorize Access
Grant AttractOS permission to create a Logpush job. We only request the minimum permissions needed.
- 4
Select Zone
Choose which Cloudflare zone (domain) to connect. It should match your AttractOS site.
- 5
Done!
Logpush starts immediately. Bot data will appear in your dashboard within minutes.
Manual Setup (Advanced)
If you prefer to configure Logpush manually via Cloudflare's dashboard or API:
Logpush Configuration
| Destination | https://attractos.com/api/integrations/cloudflare/logpush |
|---|---|
| Dataset | HTTP Requests |
| Fields | ClientRequestURI,ClientRequestUserAgent,ClientCountry,EdgeStartTimestamp |
| Header | X-AttractOS-Site-Key: YOUR_SITE_KEY |
# Create Logpush job
curl -X POST "https://api.cloudflare.com/client/v4/zones/ZONE_ID/logpush/jobs" \
-H "Authorization: Bearer CF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "AttractOS Bot Tracking",
"logpull_options": "fields=ClientRequestURI,ClientRequestUserAgent,ClientCountry,EdgeStartTimestamp",
"destination_conf": "https://attractos.com/api/integrations/cloudflare/logpush?header_X-AttractOS-Site-Key=YOUR_SITE_KEY",
"dataset": "http_requests",
"enabled": true
}'// This is typically done once via Cloudflare dashboard
// or using Terraform/Pulumi for infrastructure-as-code
// Example Terraform configuration:
/*
resource "cloudflare_logpush_job" "attractos" {
zone_id = "your-zone-id"
name = "AttractOS Bot Tracking"
enabled = true
dataset = "http_requests"
logpull_options = "fields=ClientRequestURI,ClientRequestUserAgent,ClientCountry,EdgeStartTimestamp"
destination_conf = "https://attractos.com/api/integrations/cloudflare/logpush?header_X-AttractOS-Site-Key=${var.attractos_site_key}"
}
*/# Using cloudflare-python library
import CloudFlare
cf = CloudFlare.CloudFlare(token='CF_API_TOKEN')
logpush_job = {
'name': 'AttractOS Bot Tracking',
'logpull_options': 'fields=ClientRequestURI,ClientRequestUserAgent,ClientCountry,EdgeStartTimestamp',
'destination_conf': f'https://attractos.com/api/integrations/cloudflare/logpush?header_X-AttractOS-Site-Key={site_key}',
'dataset': 'http_requests',
'enabled': True,
}
result = cf.zones.logpush.jobs.post(zone_id, data=logpush_job)
print(f"Logpush job created: {result['id']}") Verify Integration
After setup, verify data is flowing:
- Go to your AttractOS dashboard
- Check Integrations — Cloudflare should show "Connected"
- Wait 5-10 minutes for initial data
- Check the Bot Visits metric — should start populating
Troubleshooting
No data appearing
- Verify the zone is proxied (orange cloud in Cloudflare DNS)
- Check Cloudflare Logpush status — it should show "Active"
- Ensure the site key in the header matches your AttractOS site
- Wait 15 minutes — there's inherent delay in log delivery
Missing some bot visits
- Cloudflare only logs requests that reach their edge. Cached responses may not be logged.
- If you have page rules bypassing Cloudflare, those requests won't be logged.
Disconnecting
To stop sending data, either disable the Logpush job in Cloudflare or click "Disconnect" in AttractOS Integrations. Your existing data is preserved.