Google Business Profile(旧Google My Business)インポート統合を使用して、顧客情報をインポートできます。このコネクタを使用すると、評価やレビューを含む、すべてのロケーションの統計情報を統合できます。Google Business Profileベータ版への参加に興味がある場合は、Treasure Dataカスタマーサクセス担当者にお問い合わせください。
- Google Business Profileアカウント(www.google.com/business)。
- Google Business Profile前提条件の前提条件リストを完了していること。
- Treasure Data Toolbeltを含むTreasure Dataの基本知識。
Treasure Data Toolbeltをインストールします。
in:
type: google_business_profile
client_id: my-client-id
client_secret: secret
refresh_token: token
data_type: accounts
filters:
type: add_time
- from_value: {mode: upload_time}
to_column: {name: time}
out: {mode: append}in:
type: google_business_profile
client_id: my-client-id
client_secret: secret
refresh_token: token
data_type: locations
filters:
type: add_time
- from_value: {mode: upload_time}
to_column: {name: time}
out: {mode: append}in:
type: google_business_profile
client_id: my-client-id
client_secret: secret
refresh_token: token
data_type: location_reviews
filters:
type: add_time
- from_value: {mode: upload_time}
to_column: {name: time}
out: {mode: append}in:
type: google_business_profile
client_id: my-client-id
client_secret: secret
refresh_token: token
data_type: location_daily_metrics_time_series
daily_metric: BUSINESS_IMPRESSIONS_DESKTOP_MAPS
start_time: "2014-10-02"
end_time: "2014-10-03"
incremental: true
filters:
type: add_time
- from_value: {mode: upload_time}
to_column: {name: time}
out: {mode: append}in:
type: google_business_profile
client_id: my-client-id
client_secret: secret
refresh_token: token
data_type: location_monthly_search_keywords_impressions
start_time: "2014-10-02"
end_time: "2014-10-03"
filters:
type: add_time
- from_value: {mode: upload_time}
to_column: {name: time}
out: {mode: replace}設定キーと説明は以下の通りです:
| 設定キー | タイプ | 必須 | 説明 |
|---|---|---|---|
| client_id | string | yes | OAuth client_id。 |
| client_secret | string | yes | OAuth client_secret。 |
| refresh_token | string | yes | OAuth refresh_tokenはaccess_tokenを交換するために使用されます。 |
| data_type | string | yes | インポートするデータのタイプ: location_reviews、accounts、locations、location_daily_metrics_time_series、またはlocation_monthly_search_keywords_impressions |
| daily_metric | string | yes | サポートされている値は(location_daily_metrics_time_seriesデータタイプにのみ必要): BUSINESS_IMPRESSIONS_DESKTOP_MAPS, BUSINESS_IMPRESSIONS_DESKTOP_SEARCH, BUSINESS_IMPRESSIONS_MOBILE_MAPS, BUSINESS_IMPRESSIONS_MOBILE_SEARCH, BUSINESS_CONVERSATIONS, BUSINESS_DIRECTION_REQUESTS, CALL_CLICKS, WEBSITE_CLICKS, BUSINESS_BOOKINGS, BUSINESS_FOOD_ORDERS |
| start_time | int | no | - ロケーション日次メトリクス時系列: レポート時間範囲の開始時刻(YYYY-MM-DD形式、例: 2022-10-10、範囲は包含的)。 - ロケーション月次検索キーワードインプレッション: レポート時間範囲の開始時刻(YYYY-MM形式、例: 2022-10-10、範囲は包含的) |
| end_time | int | no | - ロケーション日次メトリクス時系列: レポート時間範囲の終了時刻(YYYY-MM-DD形式、例: 2022-10-10、範囲は包含的)。 - ロケーション月次検索キーワードインプレッション: レポート時間範囲の終了時刻(YYYY-MM形式、例: 2022-10-10、範囲は包含的) |
| incremental | boolean | no | インポートを増分にするかどうか。 |
| retry_limit | int | no | 各API呼び出しの最大リトライ回数。デフォルト: 7 |
| initial_retry_wait | int | no | 最初のリトライまでの待機時間。デフォルト: 5秒 |
| max_retry_wait | int | no | リトライ間の最大待機時間。デフォルト: 300秒 |
ロードジョブを送信します。データサイズによっては数時間かかる場合があります。ユーザーはデータが保存されるdatabaseとtableを指定する必要があります。
td connector:issue load.yml \
--database td_sample_db \
--table td_sample_table上記のコマンドは、*database(td_sample_db)とtable(td_sample_table)*がすでに作成されていることを前提としています。TDにdatabaseまたはtableが存在しない場合、このコマンドは成功しないため、databaseとtableを手動で作成するか、~~--auto-create-tableオプションをtd connector:issue~~コマンドと共に使用して、次のようにdatabaseとtableを自動的に作成します。
$ td connector:issue load.yml --database td_sample_db --table td_sample_table --time-column created_at --auto-create-table--time-columnオプションを使用して、Time Format列を「Partitioning Key」に割り当てることができます。
定期的なデータインポートのために、定期的なデータコネクタ実行をスケジュールできます。高可用性を確保するために、スケジューラを注意深く設定しています。この機能を使用することで、ローカルデータセンターにcronデーモンを配置する必要がなくなります。
td connector:createコマンドを使用して新しいスケジュールを作成できます。スケジュールの名前、cron形式のスケジュール、データが保存されるdatabaseとtable、およびデータコネクタ設定ファイルが必要です。
td connector:create \
daily_report_import \
"10 0 * * *" \
td_sample_db \
td_sample_table \
load.ymlcronパラメータは、@hourly、@daily、@monthlyの3つの特別なオプションも受け入れます。
td connector:listでスケジュールエントリのリストを確認できます。
td connector:listtd connector:showは、スケジュールエントリの実行設定を表示します。
$ td connector:show daily_report_import
Name :daily_report_import
Cron : 10 0 * * *
Timezone : UTC
Delay : 0
Database : td_sample_db
Table : td_sample_table
Config
---
// 表示されるload.yml設定。~~td connector:historyは、スケジュールエントリの実行履歴を表示します。個々の実行結果を調査するには、td job jobid~~を使用します。
td connector:deleteは、スケジュールを削除します。
$ td connector:delete daily_report_import