> 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/resource-loader/feature-experimentation/goal.md).

# Goal

#### Definition

A **Goal** defines a conversion or behavioral outcome to measure (e.g., an event name or a screen view). Goals can be attached to campaigns (if supported) and are used for reporting/attribution.

#### Payload Properties

When creating or updating a goal, the `payload` can include:

* **`id`** (String, *optional*) – The goal's unique ID. Include this only when updating an existing goal.
* `type` (String, **required**) — Goal category. Common values: `"screenview"`, `"event"`, `"transaction"`.
* `label` (String, **required**) — Identifier for the goal (e.g., screen name or event label).
* `operator` (String, **required**) — Comparison operator. Examples: `"equals"`, `"contains"`, `"regex"`.
* `value` (String, **required**) — Value to match against (e.g., `"Performance"`).

> Notes\
> • Goals may be referenced by campaigns via `goal_ids` (if supported by your schema).\
> • The analytics pipeline attributes conversions that match `(type, operator, value)` against user activity.

**Example Project Payload:**

```json
{
  "type": "screenview",
  "label": "goal_created_with_resource_loader",
  "operator": "contains",
  "value": "Performance"
}

```

#### Response Fields

When a Goal is returned by the API/Resource Loader, you’ll receive its server-assigned ID and the normalized definition:

* `id` (String) — Unique goal identifier.
* `type` (String) — Goal category (e.g., `"screenview"`).
* `label` (String) — Goal label/identifier.
* `operator` (String) — Comparison operator.
* `value` (String) — Comparison value.

**Example Project Response:**

```json
{
  "id": "goal_id",
  "label": "goal_created_with_resource_loader",
  "operator": "contains",
  "type": "screenview",
  "value": "Performance"
}
```

#### Error Codes

* **InvalidPayload** – Missing project name when creating a project, or other payload formatting issues.
* **PermissionDenied** – User not allowed to create projects (if such permission is restricted).


---

# 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 dynamically by asking a question.

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

```
GET https://docs.abtasty.com/server-side/command-line-interface/resource-loader/feature-experimentation/goal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
