← Back
Connect Your Fastly Website to Agent & LLM Analytics
Overview
This integration uses a Fastly logging endpoint to send analytics events to Dark Visitors. Please contact us if you need help.
Step 1: Create a Logging Endpoint
- Select your website's CDN service in your Fastly dashboard
- Click Edit configuration and clone the active version if needed
- In the sidebar, click Logging
- Create an endpoint for HTTPS
- Click attach a condition at the very top
- For the name, choose something like
Domain Matches - Enter the following for Apply if...:
req.http.host == "YOUR_DOMAIN"
- Swap in your domain (e.g.
example.com) where it saysYOUR_DOMAIN - Click Save and apply to this to return to the endpoint setup form
- For the endpoint Name, choose something like
Dark Visitors - Enter the following for Log format:
{
"timestamp": "%{strftime(\{"%Y-%m-%dT%H:%M:%S%z"\}, time.start)}V",
"client_ip": "%{req.http.Fastly-Client-IP}V",
"host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V",
"url": "%{json.escape(req.url)}V",
"request_method": "%{json.escape(req.method)}V",
"request_referer": "%{json.escape(req.http.referer)}V",
"request_user_agent": "%{json.escape(req.http.User-Agent)}V",
"request_signature": "%{json.escape(req.http.Signature)}V",
"request_signature_input": "%{json.escape(req.http.Signature-Input)}V",
"request_signature_agent": "%{json.escape(req.http.Signature-Agent)}V"
}
- Enter this URL:
https://api.darkvisitors.com/logs/fastly
- Expand the Advanced Options section
- For Content type, enter:
text/plain
- For Custom header name, enter:
Authorization
- For Custom header value, enter:
Bearer YOUR_ACCESS_TOKEN
- Navigate back to the Dark Visitors Projects page and open your project
- Copy your access token from the Settings page
- Back in Fastly, swap in your access token where it says
YOUR_ACCESS_TOKEN - For JSON log entry format, select Newline delimited
- For Compression, select Gzip
- Click Create, then Activate to deploy the new version
Step 2: 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 the Dark Visitor agent in the realtime timeline within a few seconds.