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

# BigQuery をデスティネーションとして使用する

> Kameleoonの実験露出イベントをGoogle BigQueryに送信し、キャンペーンの結果を一元化して既存のデータとともに分析します。

> [!NOTE]
>
> データウェアハウス統合は、Web Experimentation および Feature Experimentation モジュールのプレミアムアドオンとして利用できます。詳細については、カスタマーサクセスマネージャーにお問い合わせください。

アナリストがBigQueryで実験データをクエリする場合、Kameleoonの露出データは、ウェアハウスの残りのデータとは別に保管されています。**Use BigQuery as a destination**をオンにすると、Kameleoonは各実験の露出イベントをBigQuery プロジェクト内のテーブルに書き込むため、アナリストはそこで作業できます。先に[BigQuery をセットアップする](https://docs.kameleoon.com/ja/user-manual/integrations/data-warehouses/bigquery/setting-up-bigquery.md)を完了してください。セットアップでは「kameleoon」データセットが作成され、デスティネーション機能で使用するサービスアカウントへのアクセス権が付与されます。

## BigQueryをデスティネーションとして有効化する

機能を有効にするには、プロジェクトで**Use BigQuery as a destination**をオンにします。

![Kameleoon から BigQueryへのデータフローを示す表。共有データとして実験の露出イベントがあり、Web experiments、Web personalizations、Feature experimentsにチェックマークが付いている](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/data-warehouses/bigquery/setting-up-bigquery/bigquery.png)

次の手順に従ってください:

1. 選択したプロジェクトの構成で、**Use BigQuery as a destination**のラベルが付いたチェックボックスをオンにして、機能を有効にします。

![BigQuery 統合設定でUse BigQuery as a destinationがオンになっており、BigQuery project ID フィールドは空の状態になっている](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/data-warehouses/bigquery/use-bigquery-as-a-destination/0.png)

2. **BigQuery project ID** フィールドに、Google BigQuery プロジェクトのプロジェクト IDを入力します。

![BigQuery 統合設定で、BigQuery project ID フィールドにサンプルのプロジェクト IDが入力されている](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/data-warehouses/bigquery/use-bigquery-as-a-destination/1.png)

3. **Validate**をクリックして変更を保存します。

![BigQuery 統合設定の右下隅にValidate ボタンがあり、矢印で示されている](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/integrations/data-warehouses/bigquery/use-bigquery-as-a-destination/2.png)

構成を保存すると、Kameleoonは各露出イベントを`kameleoon_experiment_event` テーブルに書き込みます。

## 「Use BigQuery as a destination」の機能

Kameleoonは、各実験の露出イベントを、「kameleoon」データセット内の`kameleoon_experiment_event`という名前のテーブルに書き込みます。書き込みには、Kameleoon サービスアカウントに付与した書き込みアクセス権を使用します。テーブルのSQLスキーマは次のとおりです:

```sql theme={null}
CREATE TABLE kameleoon_experiment_event (
  nonce INT64 PRIMARY KEY NOT ENFORCED, -- unique identifier of the event
  timestamp INT64, -- timestamp in millis of the event
  visitor_code STRING, -- Kameleoon visitor identifier
  custom_visitor_id STRING, -- Visitor identifier used by your company
  experiment_id INT64, -- Kameleoon id of the experiment
  variation_id INT64 -- Kameleoon id of the variation
);
```

設定されている場合、Kameleoonは[クロスデバイス履歴調整のカスタムデータ](https://docs.kameleoon.com/ja/developer-docs/cross-device-experimentation.md)から `custom_visitor_id`を読み取ります。
