> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ein neues Ziel für ein Experiment erstellen

> Erstellen Sie ein Klick-Tracking-Ziel für ein Experiment mithilfe des Goals-Endpoints der Automation API.

## Ziel

Ziele sind Metriken zur Verfolgung des Kampagnenerfolgs.
Dieses Tutorial erstellt ein **Klick-Ziel**, um Klicks auf das Element `.cta-button` zu zählen.
Weitere Informationen finden Sie im [Leitfaden zur Zielerstellung](/user-manual/assets/goals/create-a-goal).

## Voraussetzungen

* `access token`

Die Automation API erfordert ein [Access Token](/developer-docs/apis/automation-api-rest/get-started/get-started).
Rufen Sie das Token programmgesteuert ab, indem Sie den Anweisungen im Abschnitt [Access Token abrufen](/developer-docs/apis/automation-api-rest/get-started/get-started#1-obtain-an-access-token) folgen.

## Das Ziel erstellen

**Endpoint:**

```
POST https://api.kameleoon.com/goals
```

| Name        | Typ    | Beschreibung                                             |
| ----------- | ------ | -------------------------------------------------------- |
| description | String | Zielbeschreibung (zum Beispiel „Anzahl der CTA-Klicks"). |
| name        | String | Zielname (zum Beispiel „Klicks auf CTA").                |
| siteId      | String | Die `siteId` des Projekts.                               |
| params      | Object | Enthält Element-Selektoren für das Klick-Tracking.       |

**Beispiel:**

```bash theme={null}
curl -L -X POST 'https://api.kameleoon.com/goals' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
--data-raw '{
  "description": "Number of times CTA button was clicked",
  "hasMultipleConversions": true,
  "name": "Clicks on CTA",
  "params": {
    "customSelectors": [
      {
        "mode": "CUSTOM",
        "selector": ".cta-button, #bloc-789"
      }
    ]
  },
  "siteId": 29353,
  "status": "ACTIVE",
  "type": "CLICK"
}'
```
