> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usequotable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud CDN

> Route Cloud CDN and external Application Load Balancer request logs from AI agents to Agent Analytics with a Log Router sink and an authenticated Pub/Sub push subscription.

This connector uses resources in your own Google Cloud project:

`Cloud Logging sink (filtered)` → `Pub/Sub topic` → `push subscription (OIDC)` → `Quotable`

The sink only forwards load balancer requests from AI agents for your domain, so you don't pay to ship human traffic. Each push is signed by Google with a short-lived OIDC token for a service account you choose, so no long-lived key or bearer token is ever stored in your project.

## Requirements

* Cloud CDN or an external Application Load Balancer serving the domain the source is created for, with request logging enabled on the backend service.
* Permissions in the project to create a service account, a Pub/Sub topic and subscription, a Log Router sink and the IAM bindings between them.
* The `gcloud` CLI, authenticated to that project.

**What it measures:** every field except **country**. Cache status is read from the load balancer's `cacheHit` and `cacheLookup` fields when they're logged.

## Set up

**1. Create the source in Quotable**

In **Agent Analytics**, select **Connect source** and choose **Google Cloud CDN**. Fill in:

| Field | Required | Description |
| - | - | - |
| Push service account | Yes | The service account Pub/Sub signs pushes as, for example `quotable-push@your-project.iam.gserviceaccount.com`. The script creates it if it doesn't exist. |
| Google Cloud project id | No | Written into the script. Without it, the script uses the placeholder `YOUR_GCP_PROJECT`. |
| Forwarding rule | No | Limits the sink to one forwarding rule. |
| URL map | No | Limits the sink to one URL map. |

Select **Generate credentials**. The endpoint URL for this connector ends in `/pubsub`.

**2. Download the setup script**

Select **Download gcloud setup script**. The script is specific to this source: it contains the endpoint, the filter and your service account. It contains no secret.

**3. Run the script**

Run it in a shell authenticated to your project:

```bash theme={"system"}
bash quotable-agent-analytics-gcp-v1.2.0.sh
```

Every step checks before it creates, so you can run it again after a partial failure.

**4. Confirm delivery**

Select **Check now** in Quotable. The source turns active on the first AI agent request that reaches your load balancer.

## What the script creates

| Resource | Name | Purpose |
| - | - | - |
| Service account | The one you entered | Identity Pub/Sub signs each push with. No key is created. |
| Pub/Sub topic | `quotable-agent-analytics-<id>` | Receives the filtered log entries. Messages are kept for 1 day. |
| Log Router sink | `quotable-agent-analytics-<id>` | Sends matching load balancer logs to the topic. Its writer identity gets publisher rights on the topic. |
| Push subscription | `quotable-agent-analytics-<id>-push` | Pushes each entry to your endpoint, authenticated as the service account, with the endpoint as the token audience. Retries back off from 10 seconds to 10 minutes. |

The script also lets the Pub/Sub service agent create tokens for the service account, which is what signing pushes requires.

The sink filter has this shape:

```text theme={"system"}
resource.type="http_load_balancer"
AND httpRequest.requestUrl:"example.com"
AND httpRequest.userAgent=~"(?i)(OAI-SearchBot|ChatGPT-User|GPTBot|ClaudeBot|Claude-SearchBot|Claude-User|PerplexityBot|Perplexity-User|Googlebot|adidxbot|bingbot|Applebot|Bytespider|cohere-ai|meta-externalagent|Amazonbot|meta-externalfetcher|DuckAssistBot|MistralAI-User|OAI-AdsBot|Claude-Agent|Storebot-Google|GoogleOther|Google-CloudVertexBot|Google-GeminiNotebook|Google-NotebookLM|Google-Agent|MicrosoftPreview|meta-webindexer|Amzn-SearchBot|Amzn-User|DuckDuckBot|MistralAI-Index|MistralAI-Training|CCBot|YouBot|PetalBot|YandexAdditional|YandexBot|Baiduspider|Slurp|Kagibot|ExaSearchBot|ExaUser|Diffbot|AI2Bot)"
```

The user agent list is every [recognized AI agent](https://docs.usequotable.com/agent-analytics/overview.md#recognized-ai-agents), matched without regard to case. A token also matches the longer names that contain it, so `Googlebot` covers Googlebot-Image and `Diffbot` covers Diffbot-User. When agents are added, download the script again and run it: it updates the existing sink's filter in place. Sinks created with version 1.0.0 of the script miss Meta-ExternalFetcher, DuckAssistBot and MistralAI-User. A script downloaded before 11 November 2026 misses the agents added on 11 November 2026, from OAI-AdsBot onwards in the list above, and AdIdxBot.

When you entered a forwarding rule or URL map, the filter adds `resource.labels.forwarding_rule_name` or `resource.labels.url_map_name`. Hostnames are checked again on our side, so a broad filter only costs you egress, never accuracy.

## How pushes are authenticated

Every push must carry a token signed by Google for this source's endpoint and by the service account you entered. Pushes signed for another endpoint or by another account are refused.

The push body can be the standard Pub/Sub envelope or the bare log entry (payload unwrapping). Both are accepted.

## Volume limit

Pub/Sub pushes one log entry at a time, so each AI agent request is one delivery. A Google Cloud source accepts up to 6,000 deliveries per 5-minute window, about 20 AI agent requests per second on average. Pushes above that are refused with `429`; Pub/Sub retries them with backoff, and messages older than one day are discarded. For sustained traffic above that rate, use the [Custom HTTP](https://docs.usequotable.com/agent-analytics/connectors/custom-http.md) connector with batched records.

## Test the endpoint

The endpoint also accepts the source token directly, which lets you send a test log entry:

```bash theme={"system"}
curl -sS -X POST '<your endpoint URL>' \
  -H 'Authorization: Bearer aa_live_...' \
  -H 'Content-Type: application/json' \
  -H 'x-agent-analytics-test: 1' \
  -d '{"insertId":"test-1","httpRequest":{"requestUrl":"https://example.com/","requestMethod":"GET","status":200,"userAgent":"Mozilla/5.0 (compatible; GPTBot/1.2; +https://openai.com/gptbot)","remoteIp":"203.0.113.10"}}'
```

## Rotate the token

Rotating the token in Quotable needs no change in Google Cloud: pushes are authenticated by the service account, not the token. The service account is fixed when the source is created; contact support if you need to change it.

## Disconnect

Run the teardown lines at the bottom of the script, which delete the subscription, the sink, the topic and the service account in that order. Then disconnect the source in Quotable.

## Troubleshooting

`401` responses carry a `code` that names the problem:

| Code | Cause | Fix |
| - | - | - |
| `wrong_audience` | The subscription's token audience isn't this endpoint | Set `--push-auth-token-audience` to the endpoint URL, or run the script again. |
| `wrong_service_account` | The subscription signs as a different service account | Point the subscription at the account you entered in Quotable, or run the script again. |
| Any other code | The token isn't a valid Google-signed token | Make sure pushes come from the Pub/Sub subscription. |

| Symptom | Cause | Fix |
| - | - | - |
| "Source has no push identity bound" | The source has no service account bound | Contact support with the source ID. |
| Backlog grows in the subscription | Quotable answers non-2xx | Check the codes above, and the volume limit. |
| Nothing arrives | Request logging is off on the backend service, or the filter matches nothing | Enable logging, then check the sink in Logs Explorer with the same filter. |

## Next steps

> [card] [How verification works](https://docs.usequotable.com/agent-analytics/how-verification-works.md)
>
> The load balancer's `remoteIp` is used for verification.

> [card] [Troubleshooting](https://docs.usequotable.com/agent-analytics/troubleshooting.md)
>
> Fix deliveries that fail or arrive empty.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.