# 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
