{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Google Ads Remarketing Export Integration CLI","description":"Google Ads Remarketing用のCLIツールで、OAuth認証情報の取得と設定方法を詳細に解説する技術文書です。","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"google-ads-remarketing-export-integration-cli","__idx":0},"children":["Google Ads Remarketing Export Integration CLI"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"td-コマンドのインストール","__idx":1},"children":["'td' コマンドのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["最新の",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"をインストールします。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"google-oauth2-認証情報の作成","__idx":2},"children":["Google OAuth2 認証情報の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["OAuth認証情報(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]},"と",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]},")を作成するには、以下の手順を実行します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Google API Console Credentialsを開きます:",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://console.developers.google.com/apis/credentials"},"children":["https://console.developers.google.com/apis/credentials"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["プロジェクトドロップダウン(左上隅)から、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Project"]},"をクリックし、プロジェクト名を入力し、必要に応じて提供されたProject IDを編集します。",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},"をクリックします。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160905.caa8b1cce14fbbb9c01caa3b70963985095e89e53e2c9836292726eb4f5a5da7.381d5938.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Credentialsページの「Create credentials」タブで、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth client ID"]},"を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Consent画面でプロダクト名を設定するよう求められる場合があります。その場合は",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Configure consent screen"]},"を選択し、要求された情報を入力して",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"をクリックし、Credentials画面に戻ります。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Application Typeに「Web Application」を選択します。OAuth認証情報の名前を入力します。「Authorized redirect URIs」にGoogle OAuth playground URLを必ず追加してください。"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"https://developers.google.com/oauthplayground\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160917.c527c0b2f63ed9eab48d2decc1395086c4920fc2292223e959db3a620f2a2fd0.381d5938.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},"を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["client IDとclient secretをクリップボードにコピーします。コネクタージョブを設定する際にこの情報が必要になります。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160925.b9931ce15fa920878c8811651e735d917c808063fa76ca0f24488604939e513b.381d5938.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.google.com/adwords/api/docs/guides/authentication#webapp"},"children":["Googleの認証情報に関する情報"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"adsアカウントの認証をoauth認証情報に紐付ける","__idx":3},"children":["Adsアカウントの認証をOAuth認証情報に紐付ける"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Google OAuth Playgroundを使用して、OAuth認証情報から",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refresh_token"]},"を生成できます。このプロセスは、OAuthアプリがAdsアカウントにアクセスすることを認証するためのものです。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.google.com/oauthplayground"},"children":["https://developers.google.com/oauthplayground"]},"にアクセスします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["右上隅の",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings"]},"を選択し、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use your own OAuth credentials"]},"にチェックを入れます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["前のセクションの「OAuth Client ID」と「OAuth Client Secret」を入力します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["必要なスコープ(OAuth2権限)を以下のように入力します。"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"https://www.googleapis.com/auth/adwords https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160940.bc3fc4fddf91450a594060edc259a955458f58daee8f51806d515370c76a8b87.381d5938.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorize APIs"]},"を選択し、Google Adsアカウントにログインします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["OAuth2 Playgroundにリダイレクトされたら、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Exchange authorization codes for tokens"]},"を選択します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160952.f30746ee731818a9d52d272f96540aaf935a9cd5296e0d9dcfad3ec212819438.381d5938.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"クエリコマンドの準備","__idx":4},"children":["クエリコマンドの準備"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td query"]},"コマンドの",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-r"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--result"]},"オプションを使用して、Google Ads Remarketingの結果出力先を追加します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td query -d mydb 'SELECT email FROM app_users' -r '{\"type\":\"google_adwords\",\"client_id\":\"773#######################################j33.apps.googleusercontent.com\",\"client_secret\":\"A######################N\",\"developer_token\":\"9####################Q\",\"refresh_token\":\"1/CG#######################################KI\",\"client_customer_id\":\"111-222-3333\",\"name\":\"abc_app_user_list\",\"description\":\"User list from mobile app abc\",\"app_id\":\"abc\",\"mode\":\"append\",\"membership_lifespan\":10000,\"batch_size\":100000,\"maximum_retries\":5,\"initial_retry_interval_millis\":500,\"maximum_retry_interval_millis\":300000}'\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パラメータ:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_id"]},": (必須) Google OAuth2認証情報"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]},": (必須) Google OAuth2認証情報"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refresh_token"]},": (必須) Google OAuth2認証情報"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["developer_token"]},": (必須) Google Ads Developer Token"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_customer_id"]},": (必須) Google Ads Customer ID。形式: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nnn-nnn-nnnn"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["n"]},"は数字)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},": (必須) ユーザーリストの名前"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]},": (オプション) ユーザーリストの説明。デフォルト: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["空"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["app_id"]},": モバイルアプリケーションID(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mobile_id"]},"エクスポートの場合のみ必須)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mode"]},": (オプション) アップロードモード。デフォルト: append。サポートされる値:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["append"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["replace"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["remove"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["membership_lifespan"]},": (オプション) ユーザーの連絡先情報がユーザーリストに保持される日数。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10000"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["batch_size"]},": (オプション) 各バッチでアップロードされるレコード数。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["100000"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["maximum_retries"]},": (オプション) システムが諦めるまでのリトライ回数。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initial_retry_interval_millis"]},": (オプション) 初期リトライ待機時間(ミリ秒単位)。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500"]},"(0.5秒に相当)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["maximum_retry_interval_millis"]},": (オプション) 最大リトライ待機時間(ミリ秒単位)。デフォルト: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["300000"]},"(5分に相当)"]}]}]}]},"headings":[{"value":"Google Ads Remarketing Export Integration CLI","id":"google-ads-remarketing-export-integration-cli","depth":1},{"value":"'td' コマンドのインストール","id":"td-コマンドのインストール","depth":2},{"value":"Google OAuth2 認証情報の作成","id":"google-oauth2-認証情報の作成","depth":2},{"value":"Adsアカウントの認証をOAuth認証情報に紐付ける","id":"adsアカウントの認証をoauth認証情報に紐付ける","depth":2},{"value":"クエリコマンドの準備","id":"クエリコマンドの準備","depth":2}],"frontmatter":{"seo":{"title":"Google Ads Remarketing Export Integration CLI","description":"Google Ads Remarketing用のCLIツールで、OAuth認証情報の取得と設定方法を詳細に解説する技術文書です。"}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/google-ads-remarketing-export-integration-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}