> ## 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.

# 実験用に新しいゴールを作成する

> Automation API のゴールエンドポイントを使用して、実験用のクリックトラッキングゴールを作成します。

## ゴール

ゴールはキャンペーンの成功を追跡するための指標です。
このチュートリアルでは、`.cta-button` 要素のクリック数をカウントする **Click goal** を作成します。
詳細については、[ゴール作成ガイド](/user-manual/assets/goals/create-a-goal) を参照してください。

## 要件

* `access token`

Automation API には [アクセストークン](/developer-docs/apis/automation-api-rest/get-started/get-started) が必要です。
[アクセストークン取得セクション](/developer-docs/apis/automation-api-rest/get-started/get-started#1-obtain-an-access-token) の手順に従って、プログラムでトークンを取得します。

## ゴールを作成する

**エンドポイント:**

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

| 名前          | 型      | 説明                                 |
| ----------- | ------ | ---------------------------------- |
| description | String | ゴールの説明（例: "Number of CTA clicks"）。 |
| name        | String | ゴール名（例: "Clicks on CTA"）。          |
| siteId      | String | プロジェクトの `siteId`。                  |
| params      | Object | クリックトラッキング用の要素セレクタを含みます。           |

**例:**

```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"
}'
```
