Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ COPY main.py ./

ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.23
LABEL io.airbyte.version=0.2.24
LABEL io.airbyte.name=airbyte/source-google-ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 253487c0-2246-43ba-a21f-5116b20a2c50
dockerImageTag: 0.2.23
dockerImageTag: 0.2.24
dockerRepository: airbyte/source-google-ads
githubIssueLabel: source-google-ads
icon: google-adwords.svg
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
"""
MIT License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.utils import AirbyteTracedException
from google.ads.googleads.errors import GoogleAdsException
from google.ads.googleads.v13.errors.types.authorization_error import AuthorizationErrorEnum
from pendulum import parse, today

from .custom_query_stream import CustomQuery, IncrementalCustomQuery
Expand Down Expand Up @@ -121,6 +122,11 @@ def check_connection(self, logger: logging.Logger, config: Mapping[str, Any]) ->
pass
return True, None
except GoogleAdsException as exception:
if AuthorizationErrorEnum.AuthorizationError.USER_PERMISSION_DENIED in (
x.error_code.authorization_error for x in exception.failure.errors
):
message = f"Failed to access the customer '{exception.customer_id}'. Ensure the customer is linked to your manager account or check your permissions to access this customer account."
raise AirbyteTracedException(message=message, failure_type=FailureType.config_error)
error_messages = ", ".join([error.message for error in exception.failure.errors])
logger.error(traceback.format_exc())
return False, f"Unable to connect to Google Ads API with the provided configuration - {error_messages}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"type": "string",
"description": "Comma separated list of (client) customer IDs. Each customer ID must be specified as a 10-digit number without dashes. More instruction on how to find this value in our <a href=\"https://docs.airbyte.com/integrations/sources/google-ads#setup-guide\">docs</a>. Metrics streams like AdGroupAdReport cannot be requested for a manager account.",
"pattern": "^[0-9]{10}(,[0-9]{10})*$",
"pattern_descriptor": "^[0-9]{10}(,[0-9]{10})*$ . The customer ID must be 10 digits. Separate multiple customer IDs using commas.",
"pattern_descriptor": "The customer ID must be 10 digits. Separate multiple customer IDs using commas.",
"examples": ["6783948572,5839201945"],
"order": 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def read_records(self, sync_mode, stream_slice: Optional[Mapping[str, Any]] = No
for response in response_records:
yield from self.parse_response(response)
except GoogleAdsException as exc:
exc.customer_id = customer_id
if not self.CATCH_API_ERRORS:
raise
for error in exc.failure.errors:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
1 change: 1 addition & 0 deletions docs/integrations/sources/google-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Due to a limitation in the Google Ads API which does not allow getting performan

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------|
| `0.2.24` | 2023-06-06 | [27608](https://github.com/airbytehq/airbyte/pull/27608) | Improve Google Ads exception handling |
| `0.2.23` | 2023-06-06 | [26905](https://github.com/airbytehq/airbyte/pull/26905) | Replace deprecated `authSpecification` in the connector specification with `advancedAuth` |
| `0.2.22` | 2023-06-02 | [26948](https://github.com/airbytehq/airbyte/pull/26948) | Refactor error messages; add `pattern_descriptor` for fields in spec |
| `0.2.21` | 2023-05-30 | [25314](https://github.com/airbytehq/airbyte/pull/25314) | add full refresh custom table `asset_group_listing_group_filter` |
Expand Down