Skip to main content
POST
Public webhook endpoint for storing AI recommendations from tracking scripts embedded in AI-optimized sites. 1 AI recommendation = 1 AI bot visiting your site When GPTBot, ClaudeBot, or any other AI crawler visits your AI site, that counts as one AI recommendation. No authentication required - this is a public webhook similar to the Stripe webhook.

How It Works

  1. AI-optimized sites include a dynamic tracking script loaded from /tracking.js
  2. The script detects AI bots via user-agent patterns
  3. When an AI bot is detected, the script sends the visit to this endpoint
  4. We record it as an AI recommendation in the ai_recommendations table

Supported AI Platforms

Request Body

string
required
Full URL of the page visited (entity is looked up from the domain automatically)
string
default:"ai_site"
Type of page: ai_site or boosted_page
string
Title of the page
string
required
User-Agent header from the request
string
IP address of the visitor
string
Referrer URL if available
integer
Screen width in pixels
integer
Screen height in pixels
string
Browser language (e.g., en-US)
string
Browser timezone (e.g., America/New_York)

What Gets Stored

The backend automatically adds:
  • created_at: Timestamp when the recommendation was recorded (UTC)
  • entity_id: Looked up from the page_url domain
  • ai_site_id: The AI site associated with the entity
  • platform_id: Detected from user_agent (or unknown if not recognized)
  • platform_name: Human-readable platform name

Response

string
"success", "ignored", or "error"
string
ID of the detected AI platform (e.g., chatgpt, claude)
string
Display name of the AI platform (e.g., ChatGPT, Claude)
string
Human-readable status message