Skip to content
Stores and tracking

Set the cookie consent manager and tracking features

Sets which cookie consent manager (CMP) an installation's tracking script follows, together with its other script features.

PUT /companies/{companyId}/tracking/installations/{installationId}/features

Scope setup · Access Changes data · Operation id tracking.update_installation_features

Try it

productmetrics runs after productmetrics login; curl needs PM_TOKEN (see Authentication). Set $COMPANY_ID, $INSTALLATION_ID first.

productmetrics tracking update-installation-features \
  --company-id $COMPANY_ID \
  --installation-id $INSTALLATION_ID \
  --identity-discovery \
  --dynamic-checkout-observation \
  --cmp-adapter shopify_customer_privacy \
  --expanded-bot-signals \
  --server-authoritative-attribution-mode off \
  --json

Response

API response (200):

{
  "data": {
    "installation_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "desired_revision": 1
  },
  "request_id": "req_01JA9N485VRTD7Z7GT5NT3400R"
}

CLI output: productmetrics tracking update-installation-features --json prints { "ok": true, "data": …, "request_id": "…" } with the same data.

Before you call

cmpAdapter is the consent manager the website uses: shopify_customer_privacy, onetrust, cookiebot, usercentrics or osano, or null when the website has none; tracking then follows the visitor’s choice in that banner. The other fields: identityDiscovery, dynamicCheckoutObservation, expandedBotSignals (booleans) and serverAuthoritativeAttributionMode. Every field is required and replaces the stored value, so read the installation’s current featureFlags first (tracking.get_configuration or tracking.get_commerce_configuration, installations[].featureFlags), change only what the person asked for, and send all of them back. pageviewPolicy may be sent back with them; it is ignored and stays as stored. Needs editor or admin access. Answers the installation id and the new configuration revision, which the tracking script picks up once it is published; read tracking.get_configuration again to check it.

Path parameters

NameTypeDescription
companyIdstring (uuid)Your workspace id, from productmetrics whoami or properties.list (company_id).
installationIdstring (uuid)The tracking installation: installationId from tracking.get_commerce_configuration or tracking.get_configuration.

Body

NameTypeRequiredDescription
identityDiscoverybooleanYesThe other fields: identityDiscovery, dynamicCheckoutObservation, expandedBotSignals (booleans) and serverAuthoritativeAttributionMode.
dynamicCheckoutObservationbooleanYesThe other fields: identityDiscovery, dynamicCheckoutObservation, expandedBotSignals (booleans) and serverAuthoritativeAttributionMode.
cmpAdapterenum or nullYescmpAdapter is the consent manager the website uses: shopify_customer_privacy, onetrust, cookiebot, usercentrics or osano, or null when the website has none; tracking then follows the visitor’s choice in that banner. One of shopify_customer_privacy, onetrust, cookiebot, usercentrics, osano.
expandedBotSignalsbooleanYesThe other fields: identityDiscovery, dynamicCheckoutObservation, expandedBotSignals (booleans) and serverAuthoritativeAttributionMode.
serverAuthoritativeAttributionModeenumYesThe other fields: identityDiscovery, dynamicCheckoutObservation, expandedBotSignals (booleans) and serverAuthoritativeAttributionMode. One of off, shadow, fixed, rolling.
pageviewPolicyenumNopageviewPolicy may be sent back with them; it is ignored and stays as stored. One of on_change, always.

Errors

A failure answers with its HTTP status and { error: { code, message, details? }, request_id }. Branch on code (stable, lower_snake); show message to the person. The CLI prints the same error with "ok": false.

{
  "error": {
    "code": "insufficient_scope",
    "message": "This operation needs the setup scope; connect again and allow it.",
    "details": {
      "required_scope": "setup"
    }
  },
  "request_id": "req_01JX9N4C7PP318JTB7NZZK328X"
}
StatusCodeWhen
400invalid_requestA path, query or body value does not match this page. details.issues lists each location, path and message.
401invalid_tokenThe token is missing, expired or revoked: sign in again (productmetrics login). The WWW-Authenticate header says why.
403insufficient_scopeThe token lacks the setup scope (details.required_scope): sign in again and allow it.
404not_foundAn id in the path does not exist, or the signed-in person cannot open it.
429rate_limitedMore than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry.

All Stores and tracking operations