{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Google Ads V2 Export Integration CLI In Audience Studio","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"google-ads-v2-export-integration-cli-in-audience-studio","__idx":0},"children":["Google Ads V2 Export Integration CLI In Audience Studio"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-td-command","__idx":1},"children":["Install ‘td’ Command"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the newest ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-google-oauth2-credentials","__idx":2},"children":["Create Google OAuth2 Credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Complete the following steps to create OAuth credentials (",{"$$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":["Open 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":["From the project drop-down (upper left corner), click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Project"]},", enter a name for the project, and optionally, edit the provided Project ID. Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160905.caa8b1cce14fbbb9c01caa3b70963985095e89e53e2c9836292726eb4f5a5da7.7999db90.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On the Credentials page, Create credentials tab, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OAuth client ID"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You may be prompted to set a product name on the Consent screen; if so, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Configure consent screen,"]}," supply the requested information, and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]}," to return to the Credentials screen."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select \"Web Application\" for the Application Type. Provide a name for your OAuth credentials. Make sure that you add the Google OAuth playground URL to \"Authorized redirect URIs\": ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.google.com/oauthplayground"},"children":["https://developers.google.com/oauthplayground"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160917.c527c0b2f63ed9eab48d2decc1395086c4920fc2292223e959db3a620f2a2fd0.7999db90.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy the client ID and client secret to your clipboard. You will need the information when you configure your connector job."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160925.b9931ce15fa920878c8811651e735d917c808063fa76ca0f24488604939e513b.7999db90.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See more ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.google.com/adwords/api/docs/guides/authentication#webapp"},"children":["information on Google credentialing"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authorize-ads-account-to-oauth-credentials","__idx":3},"children":["Authorize Ads Account to OAuth Credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use Google OAuth Playground to generate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refresh_token"]}," from OAuth credentials. This process is to authorize your OAuth app, to access your Ads account."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Go to: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.google.com/oauthplayground"},"children":["https://developers.google.com/oauthplayground"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings"]}," in the upper right corner and check ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use your own OAuth credentials."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Input \"OAuth Client ID\" & \"OAuth Client Secret\" from the preceding section"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Input required scopes (OAuth2 permissions) with:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["https://www.googleapis.com/auth/adwords"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["https://www.googleapis.com/auth/userinfo.profile"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["https://www.googleapis.com/auth/userinfo.email"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191015-160940.bc3fc4fddf91450a594060edc259a955458f58daee8f51806d515370c76a8b87.7999db90.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authorize APIs"]}," and login to your Google Ads account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You are redirected back to OAuth2 Playground, select ",{"$$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.7999db90.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prepare-query-command","__idx":4},"children":["Prepare Query Command"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the Google Ads Remarketing result output destination by using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-r"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--result"]}," option for the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td query"]}," command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query -d mydb 'SELECT email FROM app_users' -r '{\"type\":\"google_adwords_v2\",\"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","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Where:"]},{"$$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"]},": (required) Your Google OAuth2 credentials"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client_secret"]},": (required) Your Google OAuth2 credentials"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refresh_token"]},": (required) Your Google OAuth2 credentials"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["developer_token"]},": (required) Your 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"]},": (required) Your Google Ads Customer ID. Format: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nnn-nnn-nnnn"]}," where ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["n"]}," is a digit."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},": (required) Name of the user list"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]},": (optional) Description of the user list. Default: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["empty."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["app_id"]},": Mobile Application ID (only required for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mobile_id"]}," export)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mode"]},": (optional) Upload mode. Default: append. Supported values:"]},{"$$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":["remove"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["membership_lifespan"]},": (optional) Number of days users' contact info stays on the user list. Default: ",{"$$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"]},": (optional) Number of records to upload in each batch. Default: ",{"$$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"]},": (optional) Number of retries before system gives up. Default: ",{"$$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"]},": (optional) Initial retry time wait in milliseconds. Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500"]},", which is equivalent to 0.5 seconds."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["maximum_retry_interval_millis"]},": (optional) Max retry wait in milliseconds. Default: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["300000"]},", which is equivalent to 5 minutes."]}]}]}]},"headings":[{"value":"Google Ads V2 Export Integration CLI In Audience Studio","id":"google-ads-v2-export-integration-cli-in-audience-studio","depth":1},{"value":"Install ‘td’ Command","id":"install-td-command","depth":2},{"value":"Create Google OAuth2 Credentials","id":"create-google-oauth2-credentials","depth":2},{"value":"Authorize Ads Account to OAuth Credentials","id":"authorize-ads-account-to-oauth-credentials","depth":2},{"value":"Prepare Query Command","id":"prepare-query-command","depth":2}],"frontmatter":{"seo":{"title":"Google Ads V2 Export Integration CLI In Audience Studio"}},"lastModified":"2025-11-07T02:49:55.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/google-ads-v2-export-integration-cli-in-audience-studio","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}