Skip to content

Commit

Permalink
Add login_customer_id config (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerjbeckwith authored Jun 4, 2024
1 parent 5f802f3 commit 0d774ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ Settings required to run this tap.
- `oauth_credentials.refresh_token` (required)
- `developer_token` (required)
- `customer_id` (required)
- `login_customer_id` (optional)
- `start_date` (optional)
- `end_date` (optional)

If using a manager account, `login_customer_id` should be set to the customer ID of the manager account while `customer_id` should be set to the customer ID of the account you want to sync.

How to get these settings can be found in the following Google Ads documentation:

https://developers.google.com/adwords/api/docs/guides/authentication
Expand Down
2 changes: 1 addition & 1 deletion tap_googleads/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def http_headers(self) -> dict:
if "user_agent" in self.config:
headers["User-Agent"] = self.config.get("user_agent")
headers["developer-token"] = self.config["developer_token"]
headers["login-customer-id"] = self.config["customer_id"]
headers["login-customer-id"] = self.config.get("login_customer_id", self.config["customer_id"])
return headers

def get_next_page_token(
Expand Down
5 changes: 5 additions & 0 deletions tap_googleads/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class TapGoogleAds(Tap):
"customer_id",
th.StringType,
),
th.Property(
"login_customer_id",
th.StringType,
description="Value to use in the login-customer-id header, if different from the customer_id to sync. Useful if you are syncing using a manager account.",
),
).to_dict()

def discover_streams(self) -> List[Stream]:
Expand Down

0 comments on commit 0d774ea

Please sign in to comment.