Skip to content
Settings and rules

Save Product Segmentation settings

Saves the property's Product Segmentation settings.

PUT /properties/{propertyId}/settings

Scope write · Access Changes data · Operation id settings.update

Try it

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

# body.json holds the JSON body from the curl example
productmetrics settings update \
  --property-id $PROPERTY_ID \
  --body-file body.json \
  --if-match '"<settings_version>"' \
  --json

Response

API response (200), shortened:

{
  "data": {
    "success": true,
    "labelizer_settings": {
      "category_cols": [
        "custom_label_0"
      ],
      "category_col_source": "auto",
      "min_clicks": 120,
      "data_range": "L30D"
      // … 5 more fields
    },
    "settings_source": "legacy_property",
    "settings_version": 0
    // … 1 more field
  },
  "request_id": "req_01J365TMRYHPP8CQGDN3E94S9E"
}

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

Before you call

Read them with settings.get first, send the whole labelizer_settings object with your changes, and send its settings_version as If-Match: "<settings_version>" (leave the header out only when settings_version is null, meaning nothing was saved yet). A 409 settings_conflict means someone else saved in between: read again, reapply the change and retry. The saved settings reach the feed at the nightly run, or now with feed.generate. Needs an editor or admin of the workspace.

Path parameters

NameTypeDescription
propertyIdstring (uuid)A property_id from properties.list.

Query parameters

NameTypeRequiredDescription
feed_scopestringNoWhich feed of the property: a feed id, or all for the property-wide settings. Omitted: the property’s default scope.

Body

NameTypeRequiredDescription
labelizer_settingsobjectYesRead them with settings.get first, send the whole labelizer_settings object with your changes, and send its settings_version as If-Match: "<settings_version>" (leave the header out only when settings_version is null, meaning nothing was saved yet).
labelizer_settings.weightsobjectYesHow much each signal counts in a product’s score. Send back what settings.get returned unless you mean to change it.
labelizer_settings.weights.w_ctrnumberYesWeight of click-through rate in a product’s score.
labelizer_settings.weights.w_cvrnumberYesWeight of conversion rate in a product’s score.
labelizer_settings.weights.w_roasnumberYesWeight of ROAS in a product’s score.
labelizer_settings.weights.w_revenuenumberYesWeight of revenue in a product’s score.
labelizer_settings.weights.w_click_ranknumberYesWeight of click rank in a product’s score.
labelizer_settings.weights.w_click_boostnumberYesWeight of click boost in a product’s score.
labelizer_settings.weights.w_conversionsnumberYesWeight of conversions in a product’s score.
labelizer_settings.weights.w_cost_penaltynumberYesWeight of cost penalty in a product’s score.
labelizer_settings.weights.w_click_potentialnumberYesWeight of click potential in a product’s score.
labelizer_settings.weights.w_impression_boostnumberYesWeight of impression boost in a product’s score.
labelizer_settings.weights.w_spend_share_boostnumberYesWeight of spend share boost in a product’s score.
labelizer_settings.saved_atstringYesWhen the settings were last saved. Send back what settings.get returned.
labelizer_settings.min_clicksnumberYesClicks a product needs before its results count; fewer means it is judged on potential.
labelizer_settings.category_colsarray of stringYesThe product column that holds the category, for example product_type_l1; the first one is used.
labelizer_settings.category_col_sourceenumNoWhere the category column comes from: merchant (Merchant Center) or auto. One of auto, merchant.
labelizer_settings.saved_by_user_idstringYesWho saved the settings last. Send back what settings.get returned.
labelizer_settings.roas_threshold_lownumberYesThe ROAS below which a product with few clicks counts as low-performing.
labelizer_settings.min_conversions_for_growthnumberYesConversions a product needs before it can move up as a growing product.
labelizer_settings.penalty_no_conversion_or_revenuenumberYesHow much a product with clicks but no conversions or revenue loses in its score.
labelizer_settings.data_rangeenumNoHow many days of Google Ads results the segments use: L30D is the last 30 days. One of L7D, L14D, L30D, L45D, L60D, L75D, L90D, L180D, L365D. Default L30D.
labelizer_settings.excluded_campaign_idsarray of stringNoGoogle Ads campaign ids whose results the segments leave out. Up to 500 items. Default [].
labelizer_settings.supplemental_feed_source_settingsobjectNoWhere the supplemental feed writes the labels, as feed_source_settings.get returns them.
labelizer_settings.supplemental_feed_source_settings.product_segmentobjectYesWhere the supplemental feed writes the product segment.
labelizer_settings.supplemental_feed_source_settings.category_priorityobjectYesWhere the supplemental feed writes the category priority.
labelizer_settings.supplemental_feed_source_settings.force_overridebooleanNoWrite to a custom label that already holds product values from your own feed.
labelizer_settings.supplemental_feed_source_settings.custom_fieldsanyNoExtra feed columns, as feed_source_settings.get returns them.
labelizer_settings.auto_optimizedobjectNoSet by Product Metrics’ first run. Send back what settings.get returned.
labelizer_settings.auto_optimized.sourcestringYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned. Always first_labelizer_call.
labelizer_settings.auto_optimized.modeenumYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned. One of aggressive, standard.
labelizer_settings.auto_optimized.target_stars_revenue_minnumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.target_stars_revenue_maxnumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.target_stars_revenue_idealnumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.recommended_min_clicksnumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.confidenceenumYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned. One of high, medium, low.
labelizer_settings.auto_optimized.reason_codestringYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.stars_revenue_sharenumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.stars_product_sharenumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.stars_countnumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.total_productsnumberYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.auto_optimized.optimized_atstringYesPart of auto_optimized, set by Product Metrics. Send back what settings.get returned.
labelizer_settings.strategy_adjustmentsobjectNoOptional adjustments to the segmentation: margin (POAS), a target ROAS anchor, seasonality, price ratio and inventory. Default {"margin_poas":{"enabled":false,"margin_value_kind":"percent"},"target_anchor":{"enabled":false,"target_roas":null},"seasonality":{"enabled":false},"price_ratio":{"enabled":false}}.
labelizer_settings.strategy_adjustments.margin_poasobjectNoJudge products on margin (POAS) instead of revenue; margin_value_kind says whether margins are percentages or ratios. Default {"enabled":false,"margin_value_kind":"percent"}.
labelizer_settings.strategy_adjustments.target_anchorobjectNoAnchor the segments on your target ROAS (target_roas). Default {"enabled":false,"target_roas":null}.
labelizer_settings.strategy_adjustments.seasonalityobjectNoTake seasonal patterns into account. Default {"enabled":false}.
labelizer_settings.strategy_adjustments.price_ratioobjectNoTake your price against competitors’ prices into account. Default {"enabled":false}.
labelizer_settings.strategy_adjustments.inventoryobjectNoInventory-aware segments: what to optimise for, stock-out protection and how long a new segment holds.

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 write scope; connect again and allow it.",
    "details": {
      "required_scope": "write"
    }
  },
  "request_id": "req_01JPSQJGD2KDTZ53ME5W85YCXG"
}
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 write 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.
409settings_conflictA 409 settings_conflict means someone else saved in between: read again, reapply the change and retry.
429rate_limitedMore than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry.

All Settings and rules operations