Skip to content
Last updated

Zendesk Export Integration

Zendesk® Sunshineのモダンなクラウドベースの CRM プラットフォームは、顧客のニーズやトレンドを特定するために使用されます。Zendesk Export Integration コネクタを使用して、Events データを Zendesk Sunshine にエクスポートできます。

前提条件

  • Treasure Data の基本知識
  • Zendesk Sunshine アカウント

制限事項

結果の出力スキーマは、ターゲットイベントで要求される列(名前とデータ型)と一致する必要があります。

profile_identifier は最大20列まで設定できます(1から20まで連続した昇順で設定)。

ActionTargetColumn requiredColumn requires at least 1Column optionalNote
CreateEvents for profilesprofile_source(String), profile_type(String), event_source(String), event_type(String), event_properties(JSON String)profile_identifier_1 to profile_identifier_20 (String)profile_name, profile_created_at, profile_attributes, event_description, event_created_at, event_received_at形式と制限については、以下の「識別子列」を参照してください。
CreateEvents for a profile IDprofile_id(String), event_source(String), event_type(String), event_properties(JSON String)event_description, event_created_at, event_received_at「Events for a profile ID」の詳細を参照してください。
CreateEvents for a user IDuser_id(String), profile_source(String), profile_type(String), event_source(String), event_type(String), event_properties(JSON String)profile_identifier_1 to profile_identifier_20 (String)profile_name, profile_created_at, profile_attributes, event_description, event_created_at, event_received_at形式と制限については、以下の「識別子列」を参照してください。

列の詳細

Events for profiles

必須列

  • profile_source (String)
  • profile_type (String)
  • event_source (String)
  • event_type (String)
  • event_properties (JSON String) – イベントペイロードのシリアル化されたキーと値のペアを提供します。

識別子(少なくとも1つ)

  • profile_identifier_1 から profile_identifier_20 という名前の最大20列。
  • 各値は type,value パターンに従う必要があります(例: email,example@gmail.com)。

オプション列

  • profile_name
  • profile_created_at
  • profile_attributes
  • event_description
  • event_created_at
  • event_received_at

Events for a profile ID

必須列

  • profile_id (String)
  • event_source (String)
  • event_type (String)
  • event_properties (JSON String)

オプション列

  • event_description
  • event_created_at
  • event_received_at

Events for a user ID

必須列

  • user_id (String)
  • profile_source (String)
  • profile_type (String)
  • event_source (String)
  • event_type (String)
  • event_properties (JSON String)

識別子(少なくとも1つ)

  • 上記と同じ profile_identifier_1 から profile_identifier_20 列および type,value ルール。

オプション列

  • profile_name
  • profile_created_at
  • profile_attributes
  • event_description
  • event_created_at
  • event_received_at

Zendesk Sunshine の制限事項

レート制限

API は標準の作成エンドポイントにレート制限を適用します。制限には、Zendesk Apps フレームワークから行われたリクエストも含まれます。各プランタイプのレート制限は以下の通りです:

Sunshine LiteSunshine ProfessionalSunshine Enterprise
Custom objects500 requests per minute750 requests per minute1,000 requests per minute
ProfilesNot included250 requests per minute500 requests per minute
EventsNot included250 requests per minute500 requests per minute

Profiles の制限

次の表は、プロファイルのハード制限を示しています。可用性と制限は Sunshine プランタイプによって異なる場合があります。

CategoryLimit
Profiles30,000,000
Profile sources50
Profile types2500
Identifiers per profile20
Profile source character length40
Profile type character length40
Identifier source character length60
Identifier type character length60

Event の制限

次の表は、イベントのハード制限を示しています。可用性と制限は Sunshine プランタイプによって異なる場合があります。

CategoryLimit
Event sources50
Event types2500
Event source character length40
Event type character length40

TD Console を使用して接続を作成する

新しい接続を作成する

Treasure Data では、クエリを実行する前に、エクスポート時に使用するデータ接続を作成および設定する必要があります。データ接続の一部として、インテグレーションにアクセスするための認証を提供します。

  1. TD Console を開きます。

  2. Integrations Hub > Catalog に移動します。

  3. Zendesk を検索して選択します。

  1. Create をクリックします。認証済み接続を作成しています。次のダイアログが開きます。

  1. イベントデータをエクスポートするには、Zendesk のログイン URL を入力します。例: https://{your_domain}.zendesk.com

  2. Auth method には、basic、token、OAuth の異なるオプションがあります。

  3. オプションで、基本認証の場合は、username と password の値を入力します。

  4. オプションで、token の場合は、username と token の値を入力します。

  5. オプションで、OAuth の場合は、OAuth Access Token の値を入力します。

  6. Continue を選択します。

  7. 新しい Zendesk 接続に名前を付けます。

  8. Done を選択します。

データ接続でエクスポート結果を設定する

クエリを作成または再利用します。

場合によっては、クエリで列マッピングを定義する必要があります。

  1. TD Console を開きます。

  2. Data Workbench > Queries に移動します。

  3. データのエクスポートに使用する予定のクエリを選択します。各タイプのリソースには特定の列正確な列名(大文字小文字を区別)およびデータ型が必要です。データのエクスポートに使用できるコード例:

Events for profiles

SELECT
 profile_source,
 profile_type,
 profile_identifier_1,
 event_source,
 event_type,
 event_properties
FROM
  your_table;

Events for profile ID

SELECT p
 profile_id,
 event_source,
 event_type,
 event_properties
FROM
 your_table;

Events for user id

SELECT
 user_id,
 profile_source,
 profile_type,
 profile_identifier_1,
 event_source,
 event_type,
 event_properties
FROM
 your_table;
  1. クエリエディタの上部にある Export Results を選択します。Choose Integration ダイアログが開きます。結果をエクスポートする接続を選択する際には、既存の接続を使用するか、新しい接続を作成するかの2つのオプションがあります。これらの手順では、既存の接続を選択することを前提としています。

  2. 検索ボックスに接続名を入力してフィルタリングします。

  3. 接続を選択します。

  4. 次のいずれかを選択します:

  1. オプションで、Skip invalid records を選択します。

  2. Done を選択します。

(オプション) Query Export ジョブをスケジュールする

Scheduled Jobs と Result Export を使用して、指定したターゲット宛先に出力結果を定期的に書き込むことができます。

Treasure Data のスケジューラー機能は、高可用性を実現するために定期的なクエリ実行をサポートしています。

2 つの仕様が競合するスケジュール仕様を提供する場合、より頻繁に実行するよう要求する仕様が優先され、もう一方のスケジュール仕様は無視されます。

例えば、cron スケジュールが '0 0 1 * 1' の場合、「月の日」の仕様と「週の曜日」が矛盾します。前者の仕様は毎月 1 日の午前 0 時 (00:00) に実行することを要求し、後者の仕様は毎週月曜日の午前 0 時 (00:00) に実行することを要求するためです。後者の仕様が優先されます。

TD Console を使用してジョブをスケジュールする

  1. Data Workbench > Queries に移動します

  2. 新しいクエリを作成するか、既存のクエリを選択します。

  3. Schedule の横にある None を選択します。

  4. ドロップダウンで、次のスケジュールオプションのいずれかを選択します:

    ドロップダウン値説明
    Custom cron...Custom cron... の詳細を参照してください。
    @daily (midnight)指定されたタイムゾーンで 1 日 1 回午前 0 時 (00:00 am) に実行します。
    @hourly (:00)毎時 00 分に実行します。
    Noneスケジュールなし。

Custom cron... の詳細

Cron 値説明
0 * * * *1 時間に 1 回実行します。
0 0 * * *1 日 1 回午前 0 時に実行します。
0 0 1 * *毎月 1 日の午前 0 時に 1 回実行します。
""スケジュールされた実行時刻のないジョブを作成します。
 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

次の名前付きエントリを使用できます:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat.
  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.

各フィールド間には単一のスペースが必要です。各フィールドの値は、次のもので構成できます:

フィールド値 例の説明
各フィールドに対して上記で表示された制限内の単一の値。
フィールドに基づく制限がないことを示すワイルドカード '*''0 0 1 * *'毎月 1 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。
範囲 '2-5' フィールドの許可される値の範囲を示します。'0 0 1-10 * *'毎月 1 日から 10 日までの午前 0 時 (00:00) に実行するようにスケジュールを設定します。
カンマ区切りの値のリスト '2,3,4,5' フィールドの許可される値のリストを示します。0 0 1,11,21 * *'毎月 1 日、11 日、21 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。
周期性インジケータ '*/5' フィールドの有効な値の範囲に基づいて、 スケジュールが実行を許可される頻度を表現します。'30 */2 1 * *'毎月 1 日、00:30 から 2 時間ごとに実行するようにスケジュールを設定します。 '0 0 */5 * *' は、毎月 5 日から 5 日ごとに午前 0 時 (00:00) に実行するようにスケジュールを設定します。
'*' ワイルドカードを除く上記の いずれかのカンマ区切りリストもサポートされています '2,*/5,8-10''0 0 5,*/10,25 * *'毎月 5 日、10 日、20 日、25 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。
  1. (オプション) Delay execution を有効にすることで、クエリの開始時刻を遅延させることができます。

クエリを実行する

クエリに名前を付けて保存して実行するか、単にクエリを実行します。クエリが正常に完了すると、クエリ結果は指定された宛先に自動的にエクスポートされます。

設定エラーにより継続的に失敗するスケジュールジョブは、複数回通知された後、システム側で無効化される場合があります。

(オプション) Delay execution を有効にすることで、クエリの開始時刻を遅延させることができます。

Audience Studio で Segment をアクティベートする

Audience Studio で activation を作成することで、segment データをターゲットプラットフォームに送信することもできます。

  1. Audience Studio に移動します。
  2. parent segment を選択します。
  3. ターゲット segment を開き、右クリックして、Create Activation を選択します。
  4. Details パネルで、Activation 名を入力し、前述の Configuration Parameters のセクションに従って activation を設定します。
  5. Output Mapping パネルで activation 出力をカスタマイズします。

  • Attribute Columns
    • Export All Columns を選択すると、変更を加えずにすべての列をエクスポートできます。
    • + Add Columns を選択して、エクスポート用の特定の列を追加します。Output Column Name には、Source 列名と同じ名前があらかじめ入力されます。Output Column Name を更新できます。+ Add Columns を選択し続けて、activation 出力用の新しい列を追加します。
  • String Builder
    • + Add string を選択して、エクスポート用の文字列を作成します。次の値から選択します:
      • String: 任意の値を選択します。テキストを使用してカスタム値を作成します。
      • Timestamp: エクスポートの日時。
      • Segment Id: segment ID 番号。
      • Segment Name: segment 名。
      • Audience Id: parent segment 番号。
  1. Schedule を設定します。

  • スケジュールを定義する値を選択し、オプションでメール通知を含めます。
  1. Create を選択します。

batch journey の activation を作成する必要がある場合は、Creating a Batch Journey Activation を参照してください。

Workflow でエクスポート結果を設定する(オプション)

ワークフローでデータコネクタを使用してデータをエクスポートする方法の詳細については、About Using Workflows to Export Data with the TD Toolbelt を参照してください。

Events for Profiles のエクスポート例

Basic Auth を使用:

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: basic
    username: {username}
    password: {password}
    target: event_profile
    skip_invalid_records: true

Auth Token を使用:

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: token
    username: {username}
    token: {token}
    target: event_profile
    skip_invalid_records: true

OAuth Token を使用

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: oauth
    access_token: {access_token}
    target: event_profile
    skip_invalid_records: true

Events for Profile ID のエクスポート例

Basic Auth を使用

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: basic
    username: {username}
    password: {password}
    target: event_profile_id
    skip_invalid_records: true

Basic Auth を使用

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    login_url: https://{example}.zendesk.com
    auth_method: basic
    username: {username}
    password: {password}
    target: event_user_id
    skip_invalid_records: true