Intro
GPTrends Agent Analytics allows you to track and analyze how AI agents, bots & crawlers from leading platforms (e.g. OpenAI, Google, Perplexity, and Anthropic) visit and interact with your website.- AI bots & agents regularly visit websites to collect, update, and verify information not only for the training of LLMs, but also to power real-time AI search and live answers.
- This crawling behavior determines which content is available and ingested into AI chat assistants and how your brand and products are represented in AI-generated responses.
- Importantly, AI bots behave differently than the Google web crawler. Most do not run JavaScript or maintain cookies or session state. If your site is JS heavy or not server-side rendered then there’s a risk that your content is not being ingested correctly.
The overall goal of Agent Analytics is to ensure that your most important content & messaging is being discovered and understood by AI platforms.
What’s included in Agent Analytics?
The current version allows you to:- Identify which types of AI agents, bots & crawlers are accessing your site and how often they visit
- See which specific pages & topics are being crawled or overlooked
- Detect patterns, trends, or technical issues that could impact your AI visibility
- Understand how LLMs and AI chatbot apps are building knowledge about your brand, products and services from your website
Implementation
Because most AI bots bypass JavaScript execution, they don’t show up in tools like Google Analytics and must be tracked from the server side. We currently offer 5 types of integrations:- Vercel Log Drain (recommended). No code required direct integration with your server logs from Vercel (Netlify, GCP and AWS coming soon).
- Cloudflare Worker (recommended). Deploy a lightweight worker via the Cloudflare dashboard.
- Wordpress plugin. Integrate directly with your Wordpress site, no code required.
- Next.js SDK. Lightweight, easy to install Next.js JavaScript middleware package.
- HTTP API Endpoint. Send event data manually from any backend via an HTTP POST request.
Get Your Website Key
Before setting up any integration, you’ll need to obtain your GPTrends website key:1
Sign up for GPTrends
Create a free GPTrends account if you haven’t already.
2
Generate Website Key
Navigate to Agent Analytics and click Generate Website Key. Save this key securely - you’ll need it for the integration setup.
Installation Steps
Please find platform specific steps below:Vercel
Vercel
1
Add new 'Custom HTTP endpoint' drain
- In Vercel navigate to Project Settings and select Drains.
- Add a new Custom HTTP endpoint drain.

2
Select "Logs" as data to drain

3
Configure the drain
- Drain Name:
GPTrends Bot Analytics - Projects:
Your website project - Sources: Select all besides
builds - Environment:
Production - Sampling Rate:
100%
4
Set the destination
Add the following POST endpoint URL with your You can find your
GPTrends API Key appended after ?websiteKey=GPTrends API Key in the Bot Analytics section of the platform, either in the set up flow or under “Manage Tracking”5
Select 'Create Drain' to save and finish
Cloudflare
Cloudflare
1
Get Worker Code from GitHub
Navigate to the Cloudflare Worker repository in your browser.
2
Copy Worker Code
- Locate and click on the
src/index.tsfile in the repository - Click the Raw button to view the raw code
- Select all the code and copy
3
Access Cloudflare Dashboard
Navigate to Cloudflare Dashboard and select Workers & Pages from the sidebar.
4
Create New Worker
- Click Create Application > Create Worker
- Give your worker a name like
gptrends-analytics-worker - Click Deploy to create the worker with default code
5
Edit Worker Code
- Click Edit Code button in your newly created worker
- Delete all the default code in the editor
- Paste your copied code from GitHub
- Click Save and Deploy
6
Configure Website Key
- In your worker dashboard, navigate to Settings > Variables
- Under Environment Variables, click Add variable
- Set Variable name to:
SITELINE_WEBSITE_KEY - Set Value to your GPTrends website key
- Check Encrypt to keep your key secure
- Click Save and Deploy
7
Link Worker to Your Website
- In the Cloudflare dashboard, select your domain from the Websites section
- Navigate to Workers Routes (found under Workers in the sidebar)
- Click Add Route
- Set Route to:
*yourdomain.com/*(replace with your actual domain) - Set Worker to:
gptrends-analytics-worker(or whatever you named it) - Click Save
8
Verify Installation
Visit your website and check that requests are being processed. You can view logs in Workers & Pages > Your Worker > Logs to confirm the worker is tracking visits.
Wordpress
Wordpress
See the Agent Analytics Wordpress plugin page for more info.
Prerequisites
Before starting, make sure you have:- Administrator access to your WordPress site
- The possibility to install plugins on your WordPress installation
1
Open the Plugins panel
Open your WordPress website’s admin panel: 
https://<yourwebsite>.com/wp-adminIn the left sidebar, navigate to: Plugins
2
Search for GPTrends
Search for 
GPTrends in the Plugins search bar
3
Install the Plugin
Click
Install Now to install the plugin.4
Activate the Plugin
Back in the Plugins section, you should see GPTrends listed.Click 
Activate under the plugin’s title.
5
Configure the Plugin
Finally, in the left sidebar, click
Settings then GPTrends to open the plugin’s settings page.-
Leave
Enable Trackingchecked: this allows AI agents, bots and crawlers to be tracked. Unchecking this will pause tracking. -
Paste your website’s GPTrends API key. You can get this from the GPTrends dashboard, under
Agent Analytics>Manage Configuration -
Leave
API Endpoingempty (only needed for testing). Finally, click
Save Changesto apply.
6
Recommended: Enable Auto-updates
To keep your integration up to date, we strongly recommend enabling auto-updates from the Plugins page

Next.js
Next.js
1
Step 1
Install the GPTrends tracking package:
2
Step 2
Update your
middleware.ts file:HTTP API
HTTP API
Track bot visits from any backend with a simple GET request:Required Parameters:Notes:
url: Full URL accesseduserAgent: Bot’s User-Agent headerref: Referrer header (empty if none)ip: Visitor IPwebsiteKey: Your GPTrends key
- Only track key pages (blogs, landing pages, robots.txt, sitemap.xml)
- Skip static assets
- Use fire-and-forget requests for zero impact on site speed
- URL-encode all parameters
Security, Privacy & Performance
- No Personal Identifying Information (PII) from users is stored or logged
- The Cloudflare Worker and Vercel Log Drain approaches run outside of the run path and have no impact on your website performance
- The Next.js package and Wordpress plugin run in a fire-and-forget mode inside middleware; requests are not awaited, so it has no impact on site performance or page load times
- All errors are safely caught, logged, and discarded — ensuring your site runs exactly as before, with zero interference to end users

