> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/server-side/command-line-interface/ressource-schema/web-experimentation-schema-campaign-targeting.md).

# Campaign targeting

The minimal campaign targeting architecture is the following :

```json
{
    "segment_ids": [
        "segment_id"
    ],
    "url_scopes": [
        {
            "condition": "IS",
            "value": "URL example"
        }
    ],
    "favorite_url_scopes": [
        {
            "include": true,
            "favorite_url_id": "favorite_url_id"
        }
    ],
    "selector_scopes": [
        {
            "condition": "IS_SELECTOR_CLASS",
            "value": "Selector value"
        },
        {
            "condition": "IS_NOT_SELECTOR_ID",
            "value": "Selector value"
        }
    ],
    "code_scope": {
        "id": 12345,
        "value": "Code value"
    },
    "element_appears_after_page_load": false,
    "triggers_ids": [
        "trigger_id"
    ],
    "targeting_frequency": {
        "type": "regular",
        "unit": "day",
        "value": 20
    }
}
```

#### Segment ID (Array of Strings)

Segment corresponds to who will see the test, the key `segment_ids` take an array of segment IDs

#### URL scope (Array of Objects)

Defines conditions for matching URLs. Each object contains:

* condition (String): Specifies the condition to match (e.g., "IS" for exact match).
* value (String): The URL to be matched based on the condition.

#### Favorite URL scope (Array of Objects)

Represents favorite URL scopes. Each object contains:

* include (Boolean): Indicates whether to include the URL.
* favorite\_url\_id (String): Identifier for the favorite URL.

#### Selector scopes (Array of Objects)

Defines conditions for matching selectors. Each object contains:

* condition (String): Specifies the condition for the selector (e.g., "IS\_SELECTOR\_CLASS" to match a CSS class, "IS\_NOT\_SELECTOR\_ID" to exclude based on an ID).
* value (String): The selector value corresponding to the condition.

#### Code scope (Object)

Defines the scope of a specific code block. Contains:

* id (Integer): Numeric identifier for the code scope.
* value (String): The code value associated with this scope.

#### Element appears after page load (Boolean)

Indicates whether the element appears after the page has loaded.

#### Trigger ID (Array of Strings)

Trigger corresponds to How will the test be triggered, the key `trigger_ids` take an array of trigger IDs

#### Targeting frequency (Object)

Defines the targeting frequency for an action or condition. Contains:

* type (String): Type of frequency (e.g., "regular").
* unit (String): Unit of time (e.g., "day", "hour").
* value (Integer): Numerical value specifying the frequency (e.g., 20 days).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.abtasty.com/server-side/command-line-interface/ressource-schema/web-experimentation-schema-campaign-targeting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
