> ## Documentation Index
> Fetch the complete documentation index at: https://996f455-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://996f455-productmetrics.manicule.dev/docs/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://996f455-productmetrics.manicule.dev/docs/api/mcp.
> Every agent surface: https://996f455-productmetrics.manicule.dev/docs/.well-known/llms-manifest.json

# Security and privacy (/docs/overview/security-and-privacy)

<!-- agent-signals: reading_time_min: 7 · est_tokens: 2467 · updated: 2026-11-16 -->
Related: [Use cases](/docs/overview/use-cases.md), [Billing and usage](/docs/overview/billing-and-usage.md)

> How Product Metrics handles consent, customer data, access for the MCP server and CLI, secrets, erasure and cookies.

Product Metrics reads your customers' orders from your shop, and its tracking sends them to Google Ads, Meta and ChatGPT Ads. This page covers what it sends, when, who can reach it, and how data is removed.

## At a glance

| Topic                | How it works                                                                                          |
| -------------------- | ----------------------------------------------------------------------------------------------------- |
| **Consent**          | Starts denied. Your cookie banner is read as the four Consent Mode v2 signals, per visitor.           |
| **Customer data**    | Email, phone, name and postcode are hashed with SHA-256 before they are sent, and only with consent.  |
| **Source of orders** | Your shop's own order data. Only paid orders are sent.                                                |
| **Access**           | OAuth sign-in for the app, the MCP server and the CLI. No API keys. Your role applies everywhere.     |
| **Secrets**          | Setup tokens and store credentials never reach an AI assistant.                                       |
| **Erasure**          | A privacy request erases the customer's records and takes them out of your Google Ads customer lists. |
| **Cookies**          | First-party, on your store's own domain.                                                              |

## Consent first

**Product Metrics follows the choice each visitor makes in your cookie banner. Consent starts denied, and getting through ad blockers never overrides it.**



![A matrix of the visitor's consent choice against Google Ads, Meta and ChatGPT Ads. Everything allowed sends the full conversion everywhere. Ad user data without ad storage sends customer data without the ad click. Ad storage alone sends only the Google Ads order with the click. Marketing without analytics drops the custom events on Meta and ChatGPT Ads. Nothing allowed sends nothing.](/docs/_assets/cfe7b679758a0f358dde86b20b0a855c2a24208ca921ec164dc21283e4fcbdd0)

*Figure: What each consent choice lets through, per channel.*

The tracking script reads your banner (Shopify Customer Privacy, OneTrust, Cookiebot, Usercentrics or Osano, per store) as the four Consent Mode v2 signals: `ad_storage`, `ad_user_data`, `ad_personalization` and `analytics_storage`. When the order is confirmed, those signals decide what may go to each channel:

| Visitor allowed                   | Google Ads                                | Meta                          | Customer lists            |
| --------------------------------- | ----------------------------------------- | ----------------------------- | ------------------------- |
| Nothing                           | Order sent without customer data or click | Nothing sent                  | Not added                 |
| Ad user data                      | Order with hashed customer data           | Events sent                   | Not added                 |
| Ad user data + ad storage         | Order with customer data and the ad click | Events plus `_fbp` and `_fbc` |                           |
| Ad user data + ad personalisation |                                           |                               | Added to Google Ads lists |

A visitor who withdraws consent after checkout: the order isn't sent. A store with a banner that isn't configured is treated as no consent. Details: [Consent](/docs/concepts/consent); setup: [Choose your consent banner](/docs/using/consent).

## Customer data is hashed

With each paid order, and only when the visitor allowed **ad user data**, Product Metrics adds the customer's **email, phone, name and postcode, hashed with SHA-256**. The ad platform matches the hash to the person who clicked; it never receives the plain values.

| Field                     | Google Ads                     | Meta                              |
| ------------------------- | ------------------------------ | --------------------------------- |
| Email, phone              | Hashed                         | Hashed                            |
| Name, country, postcode   | Hashed, only as a complete set | Hashed                            |
| Your shop's customer ID   | Not sent                       | Hashed, as `external_id`          |
| IP address and user agent | Not sent                       | Sent unhashed: Meta requires them |

Customer lists send the same hashed fields through Google's Data Manager. When Product Metrics matches a customer to their earlier orders to tell new from returning, email and phone are hashed first. See [Enhanced Conversions](/docs/features/enhanced-conversions) and [Customer lists](/docs/features/customer-list).

## Data comes from your own shop

* **Orders** are read from your store platform's own order data, not trusted from the browser. Only orders your platform marks paid are sent; refunds adjust Google Ads conversions later.
* **Costs** come from your platform's cost prices, your Merchant Center cost of goods, or the costs you enter. See [Profit](/docs/concepts/profit).
* **Google data** (Google Ads, Merchant Center, your Google profile and email) is reached through OAuth, limited to the scopes those features need.

## Access: OAuth for the MCP server and the CLI

The MCP server (`https://www.productmetrics.io/mcp`) and the `productmetrics` CLI sign in through the same OAuth server, with PKCE. There is no API key to copy or leak.

You approve each client once on the Product Metrics consent page, which lists what it **Can read** and **Can change**.

| Scope   | Allows                                                                       |
| ------- | ---------------------------------------------------------------------------- |
| `mcp`   | The MCP analysis tools: reading, and filing proposals a person approves      |
| `read`  | Reading your setup and data                                                  |
| `setup` | Connecting accounts and stores, completing setup steps, removing connections |
| `write` | Changing settings, product rules and feeds, and inviting people              |

* **Scopes never widen your role.** A client acts as you, with your role in each workspace. An operation that needs a workspace admin still fails for an editor.
* **Access is checked on every request.** Lose access to a workspace and every client loses it at once.
* **Token lifetimes:** access token one hour, refresh token 30 days. The refresh token rotates each time it is used.
* **Destructive operations need you.** Through the MCP server, an operation that deletes something runs only after you agree. A Code Mode run makes at most 25 requests.
* **CLI credentials** live in `${XDG_CONFIG_HOME:-~/.config}/product-metrics/credentials.json`, file mode `0600` in a `0700` directory, one entry per API origin. `productmetrics logout` revokes the tokens and removes the entry.

```bash
# signed in, scopes, token expiry; never calls the API
productmetrics status --json

productmetrics login --scopes read
productmetrics logout
```

Details: [CLI authentication](/docs/cli/authentication), [Connect your assistant](/docs/mcp/connect).

## Secrets

Some setup steps return a secret: the one-time **setup token** you paste into the WooCommerce or Shopware plugin, for example.

* **Through the MCP server**, secret fields never reach the assistant. They come back as `<hidden: shown only in the Product Metrics app or CLI>`, and the assistant tells you where to find them.
* **In the CLI**, secret fields print as `<hidden: pass --show-secrets>`. Pass `--show-secrets` only to show the value to the person who pastes it.
* **Setup tokens are one-time** and expire at `expiresAt`. If one expires, create a new one (`productmetrics stores create-woocommerce-setup-claim`).
* **Lightspeed API keys** are credentials you enter yourself. An assistant must never invent, reuse or repeat them.



**Show a setup token in the CLI**

To show a WooCommerce setup token to the person who pastes it:

```bash
productmetrics stores connect \
  --company-id <company_id> \
  --provider woocommerce \
  --store-url https://shop.example.com \
  --auto-idempotency-key \
  --show-secrets
```

## Erasure

* **Customer requests.** On Shopify, the `customers/redact` privacy webhook starts an erasure. Before anything is deleted, the customer leaves every Google Customer Match list. Then their orders, identity records and pending sends are erased, and their unsent events are never sent.
* **Uninstalling.** Shopify's `shop/redact` webhook erases the shop's store data.
* **Your own data.** To have your personal data deleted, including data reached through Google APIs, email [support@productmetrics.io](mailto:support@productmetrics.io).

## Cookies on your store's domain

The tracking script runs on a unique endpoint on your own store domain, so its cookies are **first-party**: set by your store, readable only by your store.

* `_pm_id` (visitor) and `_pm_adc` (the first ad click), with a session cookie the browser script can't read (HttpOnly).
* Meta's `_fbp` and `_fbc`, and the ChatGPT Ads (OpenAI) cookies `__oppref` and `__obref`, are written only when missing, so an existing pixel's values are kept.
* Ad click IDs travel with the order only when the visitor allowed **ad storage**.
* Under Safari ITP, standard tags' cookies are cut to 7 days. The Product Metrics first-party cookie lasts 30 days.

## Related



* [Consent](/docs/concepts/consent): how the banner's choice decides what is sent.
* [Enhanced Conversions](/docs/features/enhanced-conversions): exactly which hashed fields go where.
* [CLI authentication](/docs/cli/authentication): sign-in, scopes and tokens for `productmetrics`.
* [Billing and usage](/docs/overview/billing-and-usage): plans, prices and how billing works.
