There are two ways to connect a Netlify site. Use an Edge Function on any plan, or a Log Drain if you are on Enterprise and prefer no code.
Prerequisites. A site deployed on Netlify and a verified domain in Rankly. Your ingest token is in Settings and is baked into the script Rankly generates.
Works on every Netlify plan. You add one file and a short config block.
1

Add the edge function

Save this as netlify/edge-functions/rankly-bot-tracker.ts.
rankly-bot-tracker.ts
import type { Context } from 'https://edge.netlify.com'

const RANKLY_INGEST = 'https://ingest.tryrankly.com/ingest/netlify'
const RANKLY_TENANT_TOKEN = 'tnt_your_token'

const BOT_UA_RE = /\b(GPTBot|ChatGPT-User|OAI-SearchBot|ClaudeBot|Claude-User|PerplexityBot|Perplexity-User|Google-Extended|Bytespider|Amazonbot|Applebot-Extended|DuckAssistBot|GrokBot|CCBot|Meta-ExternalAgent|MistralAI-User|cohere-ai|Amazon-Rufus|Shop-Agent)\b/i

export default async (request: Request, context: Context) => {
  const ua = request.headers.get('user-agent') || ''
  const sigAgent = request.headers.get('signature-agent')
  const u = new URL(request.url)
  const isFavicon = /^\/favicon[.-]|^\/apple-touch-icon/i.test(u.pathname)
  const LLM_REF_RE = /(^|\.)(chatgpt\.com|openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com|you\.com|grok\.com|mistral\.ai)$/i
  let llmReferred = false
  try { const rh = request.headers.get('referer'); if (rh) llmReferred = LLM_REF_RE.test(new URL(rh).hostname) } catch (_) {}

  if (BOT_UA_RE.test(ua) || sigAgent || isFavicon || llmReferred) {
    const payload = {
      ts: Date.now(),
      method: request.method,
      url: request.url,
      host: u.host,
      user_agent: ua,
      client_ip: context.ip || request.headers.get('x-nf-client-connection-ip') || null,
      country: context.geo?.country?.code || null,
      referer: request.headers.get('referer') || null,
      request_id: request.headers.get('x-nf-request-id') || null,
      signatureAgent: sigAgent,
      signatureInput: request.headers.get('signature-input'),
      signature: request.headers.get('signature'),
    }
    context.waitUntil(
      fetch(RANKLY_INGEST + '?tenant=' + RANKLY_TENANT_TOKEN, {
        method: 'POST',
        headers: { 'content-type': 'application/json' },
        body: JSON.stringify(payload),
      }).catch(() => {})
    )
  }
  return
}
2

Bind it in netlify.toml

Add this to your netlify.toml:
netlify.toml
[[edge_functions]]
  function = "rankly-bot-tracker"
  path     = "/*"
3

Commit and deploy

Push your change. Netlify auto-deploys the edge function.
4

Send a test request

curl -A "GPTBot/1.0" https://your-domain.com/
Events appear within a minute.