# PATCH /websites/:website_id/tracking

**Resource:** [Websites](./websites.md)  
**MCP tool:** `set_website_tracking`  
**Scopes:** `websites:write`  
**Write operation:** yes

Switch a website's own tracking on or off: Google Tag Manager, Google Analytics, Google Ads conversions, Meta pixel, Microsoft Clarity and PostHog. Pass the ID for each one to switch on (empty text switches it off); only the fields passed change. Each is loaded on every page by the site code within a minute, with no change to the site itself, and an enquiry, a booking and an order are reported to each as its own event. cookie_notice sets the notice visitors see while any tracking is on, and privacy_page the privacy policy it links to. Returns the launch checklist, as get_website_launch.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `website_id` | path | string | yes | The website id, from list_websites. |
| `google_tag_manager` | body | string | no | Google Tag Manager container ID, like GTM-AB12CDE. Empty text switches it off. |
| `ga4` | body | string | no | Google Analytics measurement ID, like G-AB12CD34EF. Empty text switches it off. |
| `google_ads` | body | string | no | Google Ads conversion ID, like AW-123456789. Empty text switches it off. |
| `google_ads_lead_label` | body | string | no | Google Ads conversion label, like AbC-D_efG-h12_34-567: the conversion an enquiry, booking or order is reported as. Needs google_ads. |
| `meta_pixel` | body | string | no | Meta pixel ID, like 123456789012345. Empty text switches it off. |
| `microsoft_clarity` | body | string | no | Microsoft Clarity project ID, like abcd1234ef. Empty text switches it off. |
| `posthog_key` | body | string | no | PostHog project key, like phc_AbCdEf.... Empty text switches it off. |
| `posthog_host` | body | string | no | Which PostHog cloud the project is on. Default https://us.i.posthog.com. |
| `cookie_notice` | body | string | no | The cookie notice shown while any tracking above is on. auto (default): visitors in the UK and Ireland are asked first, everyone else sees a short notice. ask: everyone is asked before tracking starts. notice: everyone is told. off: no notice. |
| `privacy_page` | body | string | no | Privacy policy page - the page the cookie notice's "Privacy policy" link opens: a path on the site, like /privacy/, or a full https address. Matches the "Privacy policy page" field under Cookie notice on the Your site checklist. Leave it unset and the notice links to the privacy page the site's own pages link to (or shows no link when there is none); empty text goes back to that. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X PATCH   "https://api.trustpager.com/functions/v1/api/v1/websites/:website_id/tracking"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"google_tag_manager":"...","ga4":"...","google_ads":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`