This is a Singer tap that produces JSON-formatted data following the Singer spec.
This tap:
- Pulls raw data from Google Ads API v8
- Extracts the following resources:
- Campaign with selected segments and metrics that we care about
- Outputs the schema for each resource
- Incrementally pulls metrics data based on the input state
pip install git+https://github.com/vibeus/[email protected]
- Follow Singer.io Best Practices for setting up separate
tap
andtarget
virtualenvs to avoid version conflicts. - Create a config file ~/config.json with Google Ads API Credentials.
{ "developer_token": "env[DEVELOPER_TOKEN]", "client_id": "env[GOOGLE_CLIENT_ID]", "client_secret": "env[GOOGLE_CLIENT_SECRET]", "refresh_token": "env[GOOGLE_OAUTH_REFRESH_TOKEN]", "login_customer_id": "1234567890", "customer_ids": ["1234567890"], "start_date": "2021-07-01T00:00:00Z" }
- Discover catalog:
tap-google-ads -c config.json -d > catalog.json
- Select
campaigns
andcampaign_metrics
stream in the generatedcatalog.json
.... "stream": "campaigns", "metadata": [ { "breadcrumb": [], "metadata": { "table-key-properties": [ "resource_name" ], "forced-replication-method": "FULL_TABLE", "valid-replication-keys": [], "inclusion": "available", "selected": true <-- Somewhere in the huge catalog file, in stream metadata. } }, ... ] ... "stream": "campaign_metrics", "metadata": [ { "breadcrumb": [], "metadata": { "table-key-properties": [ "campaign_id", "ad_network_type", "date", "device" ], "forced-replication-method": "INCREMENTAL", "valid-replication-keys": [ "date" ], "inclusion": "available", "selected": true <-- Somewhere in the huge catalog file, in stream metadata. } }, ... ] ...
- Use following command to sync all campaigns and their metrics.
tap-google-ads -c config.json --catalog catalog.json > output.txt
Copyright © 2021 Vibe Inc