---
title: "Ga Auth Url"
method: GET
path: "/ga/auth-url"
tags: ["google-analytics"]
---

# Ga Auth Url

`GET /ga/auth-url`

## Request

- Base URL: `https://api.xeorank.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xeorank.com/ga/auth-url`
- Auth: API key in header `X-Agent-Key`

Return the Google OAuth URL for GA4 analytics.readonly scope.

Before generating the URL the endpoint checks the user's billing
plan to ensure they haven't exceeded their ``ga_connections.count``
cap.

## Query parameters

- `email` string, required: Signed-in user email
- `site_id` string, required: Site UUID to connect GA4 to
- `origin` string: Frontend origin to return to after auth (e.g. https://xeorank.com)

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xeorank/apis/seo-intelligence-engine.md) · [All operations](https://skmtc.dev/xeorank/apis/seo-intelligence-engine/llms.txt) · [OpenAPI document](https://skmtc.dev/xeorank/apis/seo-intelligence-engine/revisions/449a3fd73454?raw)
