diff --git a/README.md b/README.md index b4ba684..09626f3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/tap_googleads/client.py b/tap_googleads/client.py index 24f53ba..27e79a6 100644 --- a/tap_googleads/client.py +++ b/tap_googleads/client.py @@ -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( diff --git a/tap_googleads/tap.py b/tap_googleads/tap.py index ce2c7a3..47140fe 100644 --- a/tap_googleads/tap.py +++ b/tap_googleads/tap.py @@ -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]: