Integrating With Fastly Log Streaming
This guide walks you through the process of implementing AI Bot Analytics on your website using Fastly's realtime log streaming.
Prerequisites
- An active Writesonic account
- A Fastly CDN Service configured for your website
- Access/permission to edit Logging Endpoints in Fastly
Phase 1: Start in Writesonic
- Head over to the AI Bot Analytics page on Writesonic and choose ‘Fastly’ as a provider
- Click on ‘Continue’ to initialize the integration.
- Writesonic will generate the following information that you'll need during the Fastly configuration:
- Log Format
- Endpoint URL
- Custom Header Value
Phase 2: Get Your Fastly Service ID
- Log in to your Fastly dashboard
- Navigate to your CDN Service for which you want to configure AI Bot Analytics
- Copy the Fastly Service ID from your service dashboard
- Return to Writesonic and paste the Service ID there and click “Submit”.
- Click on “Continue” to proceed to the next step.
Phase 3: Configure Logging in Fastly
Step 1: Navigate to Logging Configuration
- In your Fastly CDN Service, navigate to: "Service Configuration" > "Logging" > "Create endpoint" > "HTTPS" > “Create endpoint”
Step 2: Configure the HTTPS Logging Endpoint
- Name: Give a name to your logging endpoint (e.g. Fastly Log Streaming).
- Log Format: Copy the Log Format from Writesonic and paste it in the ‘Log Format’ field in Fastly
- URL: Copy the Endpoint URL from Writesonic and paste it in the 'URL' field in Fastly
Step 3: Configure Advanced Options
Navigate to Advanced options and set the following:
- Content Type: Set to
application/json - Custom Header Key: Set to
x-api-key - Custom Header Value: Copy the value from Writesonic and paste it there
Rest of the fields in the configuration are optional and can be left as such
Step 4: Create and Activate
- Click 'Create' and wait for the configuration to be applied
- Once the configuration is ready, click 'Activate' to finalize the setup
Phase 4: Verify Installation in Writesonic
- Wait for 5-10 minutes for Logging Endpoint to activate.
- Return to AI Bot Analytics Page in Writesonic.
- Click on "Verify Integration" to confirm that your Fastly integration is working properly
- Once verified, you'll be redirected to your analytics dashboard. The process typically finishes in 1–2 minutes but may take up to 5 minutes.
Understanding the Integration
This integration works by:
- Traffic Capture: Fastly captures all incoming requests to your website
- Log Formatting: The custom log format extracts relevant information about AI crawler requests
- Real-time Streaming: Logs are streamed in real-time to Writesonic's analytics endpoint
- AI Detection: Writesonic processes the logs to identify and analyze AI Bot traffic
Troubleshooting
If you encounter any issues during setup:
- Service ID Issues: Ensure you've copied the correct Fastly Service ID
- Configuration Problems: Verify that the log format, endpoint URL, and headers are copied exactly as provided
- Activation Delays: Allow a few minutes for Fastly configuration changes to propagate
- Missing Data: Check that your website is receiving traffic and that the logging endpoint is properly configured
- Header Authentication: Confirm that the
x-api-keyheader value matches exactly what Writesonic provided - Make sure to ‘Activate’ the logging configuration after it’s been created/updated.
For assistance, contact [email protected]
Managing the Integration
Modifying the Configuration
To modify your Fastly logging configuration:
- Navigate back to Service Configuration > Logging > Edit Configuration
- Find your Writesonic endpoint
- Update the logging configuration and click ‘Update’
- Don't forget to "Activate" your changes
Updated about 3 hours ago
