Overview
The integration uses a Cloudflare Worker that runs as middleware to collect request metadata and send it to our Agent Analytics API. The Worker captures important request information like IP addresses, user agents, and referrers without affecting the actual request handling.Prerequisites
- A Cloudflare account with access to Workers
- Node.js installed on your development machine
- Access to your domain’s Cloudflare configuration
- API credentials for the Profound Agent Analytics platform
Using Cloudflare Enterprise plan? Check out our integration guide using Cloudflare Logpush.
Implementation Guide
1
Set Up Your Development Environment
Create a new Worker project and install dependencies:After npm launches, you’ll be prompted to select a starting point. Select “Hello World” as your starting category.
Select the “Hello World” worker template.
Select the “TypeScript” language.
Now the CLI will create a new project with the name 
Deploy the application now. The application will be deployed with a cloudflare development domain and will not affect your production environment.
Cloudflare CLI will prompt you to login and select the account you want to deploy the application to. Please choose the account your domain is associated with.Cloudflare should automatically open a browser window with “Hello World” displayed. You can navigate to the project directory once the application is deployed.
Create a new Worker project
First, use the Cloudflare Worker CLI to create a new Worker project:In this example, we’re using version2.37.4
of the Cloudflare Worker CLI. You may use the latest version, but there might be some minor process differences.


log-collector
and install the necessary dependencies.Select Git for version control.

2
Configure Your Worker
Edit your Then copy the TypeScript code into
wrangler.json
file to configure the PROFOUND_API_URL
environment variable and the route binding:Replace pattern
example.com/*
with your actual domain. Use your target site URL (usually marketing site). For example, if your marketing site is https://www.example.com
, you should use www.example.com/*
as the pattern.
The zone_name
should be your canonical domain without the www.If you are not sure about the correct configuration, please contact Profound support.
wrangler.json
src/index.ts
:src/index.ts
3
Deploy Your Worker
Login to Cloudflare
Use the Wrangler CLI to deploy the Worker:Configure the Profound API key
Secrets is a feature of Cloudflare Workers that allows you to store sensitive information like API keys in a secure environment.
Deploy the Worker
4
Test Your Implementation
Verify your Worker is functioning correctly:Navigate to Profound Analytics and check if the logs are being collected in the Log panel. Note that AI log filter is on by default. Please disable it using the filter on the top right corner of the Logs panel.If logs are appearing, you are all set! You should be able to see data populating in the Analytics dashboard.
Troubleshooting
-
If logs aren’t appearing, verify your
PROFOUND_API_URL
environment variable andPROFOUND_API_KEY
secret are configured correctly - Check Cloudflare Workers > Analytics for any execution errors
- Ensure your route pattern matches your domain configuration
- Verify the Worker is receiving requests by checking the Cloudflare dashboard metrics
Additional Resources
- Cloudflare Workers Documentation
- Wrangler CLI Documentation
- Contact support@profound.com for API-related questions
Security Considerations
- Store API keys as secrets in production environments
- Regularly rotate API keys
- Monitor Worker usage and logs for unusual patterns