> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryprofound.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare Integration (Logpush)

> This documentation explains how to set up and deploy a Cloudflare Worker that captures HTTP request data and forwards it to Profound Agent Analytics platform using Cloudflare Logpush.

## Overview

The integration uses a Cloudflare Logpush that runs as middleware to collect request metadata and send it to our Agent Analytics API. Cloudflare Logpush is a Cloudflare Enterprise feature that allows you to forward Cloudflare logs to a non-Cloudflare destination like Profound. For more information related to Cloudflare Logpush, [visit the documentation site](https://developers.cloudflare.com/logs/about/).

## Prerequisites

* A Cloudflare account with Enterprise plan

* Access to your domain's Cloudflare configuration

* A Profound Log Ingestion Token for Agent Analytics

<Tip>
  Using Cloudflare Free/Pro plan? Check out our <a href="/agent-analytics/cloudflare_worker" target="_self">integration guide using Cloudflare Workers</a>.
</Tip>

<img src="https://mintcdn.com/profound-37face47/dU1U8PbY91PjiXyk/images/agent-analytics/cloudflare_logpush/logpush_setup.png?fit=max&auto=format&n=dU1U8PbY91PjiXyk&q=85&s=1f3d1936ae852ac98962c9167a90e126" alt="Logpush Detected" width="3680" height="2390" data-path="images/agent-analytics/cloudflare_logpush/logpush_setup.png" />

## Configuration

<Steps>
  <Step title="Step 1">
    Select your domain on Cloudflare Dashboard, go to **Analytics & Logs -> Logpush**

    <img src="https://mintcdn.com/profound-37face47/dU1U8PbY91PjiXyk/images/agent-analytics/cloudflare_logpush/cloudflare_logpush_nav.png?fit=max&auto=format&n=dU1U8PbY91PjiXyk&q=85&s=625b1175af5e6297333789cb96f6da7b" alt="Cloudflare Logpush Navigation" width="248" height="258" data-path="images/agent-analytics/cloudflare_logpush/cloudflare_logpush_nav.png" />
  </Step>

  <Step title="Step 2">
    Create a new Logpush job, select HTTP destination

    <img src="https://mintcdn.com/profound-37face47/dU1U8PbY91PjiXyk/images/agent-analytics/cloudflare_logpush/cloudflare_http_destination.png?fit=max&auto=format&n=dU1U8PbY91PjiXyk&q=85&s=ed84b38394cdeec008e1ce996f9115d6" alt="Cloudflare HTTP Destination" width="246" height="296" data-path="images/agent-analytics/cloudflare_logpush/cloudflare_http_destination.png" />
  </Step>

  <Step title="Step 3">
    Use the following API URL format to include your Profound Log Ingestion Token and continue

    ```http theme={null}
    https://artemis.api.tryprofound.com/v1/logs/cloudflare_logpush?header_X-API-Key=bot_PROFOUND_LOG_INGESTION_TOKEN
    ```
  </Step>

  <Step title="Step 4">
    Select `Filtered logs` under **If logs match...**

    And filter by the `ClientRequestHost` field to match your domain

    <Tip>
      Ensure you use your domain in the filter. Do not use `www.tryprofound.com`, this is only an example.
    </Tip>

    <img src="https://mintcdn.com/profound-37face47/dU1U8PbY91PjiXyk/images/agent-analytics/cloudflare_logpush/cloudflare_filter_logs.png?fit=max&auto=format&n=dU1U8PbY91PjiXyk&q=85&s=39352a097e7fc3cfd9248d64b684c3ee" alt="Cloudflare Filter Logs" width="1297" height="258" data-path="images/agent-analytics/cloudflare_logpush/cloudflare_filter_logs.png" />
  </Step>

  <Step title="Step 5">
    Select HTTP requests dataset, and choose the following fields to send:

    * Request

      * `ClientIP` - IP Address of the client.

      * `ClientRequestHost` - Host requested by the client.

      * `ClientRequestMethod` - HTTP method of client request.

      * `ClientRequestReferer` - HTTP request referrer.

      * `ClientRequestURI` - URI requested by the client.

      * `ClientRequestUserAgent` - User agent reported by the client

    * Performance

      * `EdgeStartTimestamp` - Timestamp at which the edge received request from the client.

      * `EdgeEndTimestamp` - Timestamp at which the edge finished sending response to the client.

    * Response

      * `EdgeResponseBytes` - Number of bytes returned by the edge to the client.

      * `EdgeResponseStatus` - HTTP status code returned by Cloudflare to the client.

    That's it! You have now successfully configured Profound Agent Analytics for your website. Data should begin to populate on your dashboard within an hour.
  </Step>
</Steps>

## Troubleshooting

* If logs aren't appearing, verify your Log Ingestion Token and URL

* Check 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 Logpush Documentation](https://developers.cloudflare.com/logs/about/)

* [Cloudflare Enable HTTP destination Documentation](https://developers.cloudflare.com/logs/get-started/enable-destinations/http/)

* Contact [support@tryprofound.com](mailto:support@tryprofound.com) for API-related questions

## Security Considerations

* Store Log Ingestion Tokens as secrets in production environments

* Regularly rotate Log Ingestion Tokens

* Monitor Worker usage and logs for unusual patterns
