> ## Documentation Index
> Fetch the complete documentation index at: https://e328d4e-productmetrics.manicule.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://e328d4e-productmetrics.manicule.dev/docs/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://e328d4e-productmetrics.manicule.dev/docs/api/mcp.
> Every agent surface: https://e328d4e-productmetrics.manicule.dev/docs/.well-known/llms-manifest.json

# Send a store's purchases to Google Ads (/docs/api/stores-and-tracking/tracking-set-scope-destination)

<!-- agent-signals: reading_time_min: 3 · est_tokens: 1788 · updated: 2026-11-16 -->
Related: [Connect a store](/docs/api/stores-and-tracking/stores-connect.md), [New WooCommerce setup token](/docs/api/stores-and-tracking/stores-create-woocommerce-setup-claim.md), [Choose the store platform](/docs/api/stores-and-tracking/stores-select-platform.md), [Assign a store to a property](/docs/api/stores-and-tracking/tracking-assign-property.md), [Track a website](/docs/api/stores-and-tracking/tracking-create-website-installation.md), [Get store connections](/docs/api/stores-and-tracking/tracking-get-commerce-configuration.md)

> Points one storefront scope of an installation at a property: its purchases go to that property's Google Ads purchase conversion action, and pageviewDestination sets where pageviews go (null for none).

`PUT https://prod-backend.productmetrics.io/api/public/v1/companies/{companyId}/tracking/scopes/{scopeId}/destination`

**Scope** `setup` · **Access** Changes data · **Operation id** `tracking.set_scope_destination`

## Try it

`productmetrics` runs after `productmetrics login`; curl needs `PM_TOKEN` (see [Authentication](/docs/api/overview#authentication)). Set `$COMPANY_ID`, `$SCOPE_ID` first.



**productmetrics CLI:**

```bash
productmetrics tracking set-scope-destination \
  --company-id $COMPANY_ID \
  --scope-id $SCOPE_ID \
  --installation-id 6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b \
  --property-id 8c1f4d2e-7a3b-4c5d-9e6f-0a1b2c3d4e5f \
  --pageview-destination / \
  --consent-policy-version 1 \
  --json
```

**curl:**

```bash
curl -X PUT "https://prod-backend.productmetrics.io/api/public/v1/companies/$COMPANY_ID/tracking/scopes/$SCOPE_ID/destination" \
  -H "Authorization: Bearer $PM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "installationId": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "propertyId": "8c1f4d2e-7a3b-4c5d-9e6f-0a1b2c3d4e5f",
    "pageviewDestination": "/",
    "consentPolicyVersion": 1
  }'
```

## Response

API response (200):

```json
{
  "data": {
    "storefront_scope_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "destination_mapping_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "destination_mapping_version": 1,
    "desired_revision": 1
  },
  "request_id": "req_01JPXA468G7BQ25FD996347K02"
}
```

**CLI output:** `productmetrics tracking set-scope-destination --json` prints `{ "ok": true, "data": …, "request_id": "…" }` with the same `data`.

## Before you call

Needs editor or admin access, a Google Ads account connected to the property and its purchase conversion action; otherwise answers 409 naming what is missing. `installationId`, the scope id and `consentPolicyVersion` come from [`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration); read it again afterwards to check the change.

## Path parameters

| Name        | Type          | Description                                                                                                                                                                                                                     |
| ----------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `companyId` | string (uuid) | Your workspace id, from `productmetrics whoami` or [`properties.list`](/docs/api/account/properties-list) (`company_id`).                                                                                                            |
| `scopeId`   | string (uuid) | The tracking scope: its `id` from [`tracking.get_commerce_configuration`](/docs/api/stores-and-tracking/tracking-get-commerce-configuration) or [`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration). |

## Body

| Name                   | Type           | Required | Description                                                                                                                                                                                                                                    |
| ---------------------- | -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `installationId`       | string (uuid)  | Yes      | The tracking installation: `installationId` from [`tracking.get_commerce_configuration`](/docs/api/stores-and-tracking/tracking-get-commerce-configuration) or [`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration). |
| `propertyId`           | string         | Yes      | The property id, from `productmetrics whoami` or [`properties.list`](/docs/api/account/properties-list) (`property_id`).                                                                                                                            |
| `pageviewDestination`  | string or null | Yes      | Points one storefront scope of an installation at a property: its purchases go to that property's Google Ads purchase conversion action, and `pageviewDestination` sets where pageviews go (null for none). 1 to 200 characters.               |
| `consentPolicyVersion` | integer        | Yes      | `installationId`, the scope id and `consentPolicyVersion` come from [`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration); read it again afterwards to check the change. Above 0.                                |

## 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`.

```json
{
  "error": {
    "code": "insufficient_scope",
    "message": "This operation needs the setup scope; connect again and allow it.",
    "details": {
      "required_scope": "setup"
    }
  },
  "request_id": "req_01JFZQ41YSGT76Z9EHXM47PPC3"
}
```

| Status | Code                 | When                                                                                                                                                           |
| ------ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `invalid_request`    | A path, query or body value does not match this page. `details.issues` lists each `location`, `path` and `message`.                                            |
| 401    | `invalid_token`      | The token is missing, expired or revoked: sign in again (`productmetrics login`). The `WWW-Authenticate` header says why.                                      |
| 403    | `insufficient_scope` | The token lacks the `setup` scope (`details.required_scope`): sign in again and allow it.                                                                      |
| 404    | `not_found`          | An id in the path does not exist, or the signed-in person cannot open it.                                                                                      |
| 409    | `conflict`           | Needs editor or admin access, a Google Ads account connected to the property and its purchase conversion action; otherwise answers 409 naming what is missing. |
| 429    | `rate_limited`       | More than 600 requests a minute for this person: wait the `Retry-After` seconds (60) and retry.                                                                |

[All Stores and tracking operations](/docs/api/stores-and-tracking)
