# set_page_tracking_rules (/docs/mcp/tools/set-page-tracking-rules)

{/* Generated by scripts/sync-mcp-tools.mjs from happierleads-api. Do not edit: change src/routes/mcp/toolDocs.json there, or add content/mcp-notes/set_page_tracking_rules.mdx. */}

**Set which pages are tracked** · Deletes or overwrites data

Sets the page rules of a website. In exclude mode visitors on matching pages are not identified (e.g. careers or login pages); in include mode only visitors on matching pages are. The rules you send replace the current ones; an empty list removes them. Rules that could never match are refused with the reason.

| Connection | Account URL, team member URL or OAuth |
| --- | --- |

## Parameters [#parameters]

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `websiteId` | `string` | Yes | Website ID from list_websites. |
| `mode` | `"exclude" \| "include"` | No | exclude (default) or include. |
| `rules` | `object[]` | Yes | The full list of rules. |
| `rules[].type` | `"starts-with" \| "ends-with" \| "contains" \| "does-not-contain"` | Yes | starts-with, ends-with, contains or does-not-contain. |
| `rules[].url` | `string` | Yes | The part of the page URL to match, e.g. /careers. |

## Tool definition [#tool-definition]

What your assistant receives from `tools/list`:

```json
{
  "name": "set_page_tracking_rules",
  "title": "Set which pages are tracked",
  "annotations": {
    "title": "Set which pages are tracked",
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": true,
    "openWorldHint": false
  },
  "inputSchema": {
    "type": "object",
    "properties": {
      "websiteId": {
        "type": "string",
        "description": "Website ID from list_websites."
      },
      "mode": {
        "type": "string",
        "enum": [
          "exclude",
          "include"
        ],
        "description": "exclude (default) or include."
      },
      "rules": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "starts-with",
                "ends-with",
                "contains",
                "does-not-contain"
              ],
              "description": "starts-with, ends-with, contains or does-not-contain."
            },
            "url": {
              "type": "string",
              "description": "The part of the page URL to match, e.g. /careers."
            }
          },
          "required": [
            "type",
            "url"
          ]
        },
        "description": "The full list of rules."
      }
    },
    "required": [
      "websiteId",
      "rules"
    ]
  }
}
```
