← Back
Track Pageviews for Your Cloudflare Logs
Step 1: Create a Logpush Job
- Select your domain in your Cloudflare dashboard
- In the sidebar, expand Observability, then Export, and click Logpush
- Open the Jobs tab and click Create a Logpush job
- Select HTTP destination
- Paste in this endpoint:
https://api.knownagents.com/logs/cloudflare?header_Authorization=Bearer%20YOUR_ACCESS_TOKEN
- Navigate to the Known Agents Projects page and open your project
- Copy your access token from the Settings page
- Back in Cloudflare, swap in your access token where it says
YOUR_ACCESS_TOKEN(don't delete the "%20") - Click Continue
- Select the HTTP requests dataset
- Give the job a name using only letters, numbers, hyphens, periods, or underscores
- Under If logs match, select All logs
- Make sure these fields are selected:
EdgeStartTimestampClientRequestHostClientIPClientRequestMethodEdgeResponseStatusClientRequestPathClientRequestURIClientRequestUserAgentClientRequestRefererEdgeEndTimestampRequestHeadersEdgeResponseContentType
- Expand Advanced Options and make sure rfc3339 is selected in the Timestamp format dropdown
- Under Log delivery method, select Core (recommended)
- Click Submit
Step 2: Configure Custom Fields
- Open the Configuration tab
- In the Custom log fields section, click Add Custom Fields
- Add the following three Request Header custom fields:
signaturesignature-agentsignature-input
- Click Save
Step 3: Test Your Integration
- Navigate to the Projects page
- Select your project
- Click Settings
- Click Send a Test Visit
- Click Realtime
If your website is correctly connected, you should see visits from a test agent in the realtime timeline within a few seconds.