# Change the analytics settings of a site

`PUT /analytics/site/settings` · Rivier · analytics

Change the analytics settings of a site. Anything that collects more is a person's decision and an agent is refused.

- Scope: analytics:write
- Mcp: rivier_analytics_set_settings
- Graphql: Mutation.analyticsSiteSettingsUpdate
- Sdk: analytics.siteSettings.update
- Cli: analytics site settings update

## Parameters

- `project` (query), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "default": true
    },
    "ownerMode": {
      "type": "string",
      "enum": [
        "M0",
        "M1",
        "M2"
      ],
      "default": "M1"
    },
    "childAudience": {
      "type": "boolean",
      "default": false
    },
    "unverifiedRows": {
      "type": "string",
      "enum": [
        "cautious",
        "ceiling"
      ],
      "default": "cautious"
    },
    "signalBehaviour": {
      "type": "string",
      "enum": [
        "totals_only",
        "nothing"
      ],
      "default": "totals_only"
    },
    "modelNonConsented": {
      "type": "boolean",
      "default": false
    },
    "suppressBelow": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "default": 5
    },
    "funnels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,30}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "page": {
                  "type": "string",
                  "maxLength": 200
                },
                "event": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "label"
              ],
              "additionalProperties": false
            },
            "minItems": 2,
            "maxItems": 6
          },
          "windowDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 1
          }
        },
        "required": [
          "id",
          "name",
          "steps"
        ],
        "additionalProperties": false
      },
      "maxItems": 8,
      "default": []
    },
    "goals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,30}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "kind": {
            "type": "string",
            "enum": [
              "page",
              "event",
              "outcome"
            ]
          },
          "match": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "valueMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "match"
        ],
        "additionalProperties": false
      },
      "maxItems": 10,
      "default": []
    },
    "emailReport": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": false
        },
        "weekday": {
          "type": "integer",
          "minimum": 0,
          "maximum": 6,
          "default": 1
        },
        "recipients": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email",
            "maxLength": 200
          },
          "maxItems": 5,
          "default": []
        }
      },
      "additionalProperties": false,
      "default": {}
    },
    "dataRegion": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 2,
          "maxLength": 16
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "counterRetentionDays": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 30,
          "maximum": 3650
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/analytics/site/settings' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "enabled": true,
  "ownerMode": "M1",
  "childAudience": false,
  "unverifiedRows": "cautious",
  "signalBehaviour": "totals_only",
  "modelNonConsented": false,
  "suppressBelow": 5,
  "funnels": []
}'
```
