The Analytics settings endpoint controls future Usetix shop analytics collection and the external marketing identifiers loaded after a visitor grants Marketing consent.

Reading requires a token with Read or Read + Write permission. Updating requires Read + Write. See Authentication.

GET /admin/account_settings/analytics

curl \
  -H "Authorization: Bearer your-token-here" \
  -H "Accept: application/json" \
  https://app.usetix.io/admin/account_settings/analytics

Response:

{
  "data": {
    "shop_analytics_enabled": true,
    "marketing_tracking": {
      "google_analytics_id": "G-ABCDE12345",
      "google_ads_id": "AW-123456789",
      "google_ads_purchase_label": "AbCdEfGhIj",
      "meta_pixel_id": "123456789012345",
      "tiktok_pixel_id": "C1234567890ABCDE"
    }
  }
}

marketing_tracking always contains all five keys; an unconfigured value is null. External tags load only after Marketing consent. See External marketing tracking for the event contract and privacy behavior.

PATCH /admin/account_settings/analytics

Send only the fields you want to change, directly at the JSON top level:

curl -X PATCH \
  -H "Authorization: Bearer your-token-here" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"shop_analytics_enabled":false,"google_analytics_id":"G-ABCDE12345"}' \
  https://app.usetix.io/admin/account_settings/analytics

Writable fields:

Field Type Notes
shop_analytics_enabled boolean false pauses future collection while retaining historical reports.
google_analytics_id string GA4 measurement ID matching G- plus 5–20 letters or digits. Send "" to clear.
google_ads_id string Google Ads conversion ID matching AW- plus 5–20 digits. Send "" to clear.
google_ads_purchase_label string Optional purchase-conversion label; requires google_ads_id. Send "" to clear.
meta_pixel_id string Standalone Meta Pixel ID, 5–30 digits. Send "" to clear.
tiktok_pixel_id string TikTok Pixel ID, 10–30 uppercase letters or digits. Send "" to clear.

Response: 200 OK with the complete updated data object in the same shape as GET.

Validation failures return 422 Unprocessable Entity:

{
  "errors": {
    "google_analytics_id": ["is invalid"]
  }
}

A Read token attempting PATCH receives 401 Unauthorized and no settings are changed. The Shop settings endpoint continues to expose and accept these fields for backwards compatibility; new integrations should use this dedicated endpoint.