Intro
GPTrends’ Agent Analytics feature 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 toensure 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 4 types of integrations:- Server Log Drain (recommended). No code required direct integration with your server logs from Vercel (Netlify, GCP and AWS coming soon).
- Next.js SDK. Lightweight, easy to install Next.js JavaScript package.
- HTTP API Endpoint. Send event data manually from any backend via an HTTP POST request.
- Wordpress plugin. Integrate directly with your Wordpress site, no code required.
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
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
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.
Security, Privacy & Performance
- No Personal Identifying Information (PII) from users is stored or logged
- The log drain approach occurs outside of the run path and has 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

