diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 472eed0f77c3a..f438766feeb43 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -311,7 +311,7 @@ - name: Google Ads sourceDefinitionId: 253487c0-2246-43ba-a21f-5116b20a2c50 dockerRepository: airbyte/source-google-ads - dockerImageTag: 0.1.41 + dockerImageTag: 0.1.42 documentationUrl: https://docs.airbyte.io/integrations/sources/google-ads icon: google-adwords.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index a48f87472e6bc..5c3280d98b759 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -2780,7 +2780,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-google-ads:0.1.41" +- dockerImage: "airbyte/source-google-ads:0.1.42" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/google-ads" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-google-ads/Dockerfile b/airbyte-integrations/connectors/source-google-ads/Dockerfile index 3ff82c8e08f09..32322371644a2 100644 --- a/airbyte-integrations/connectors/source-google-ads/Dockerfile +++ b/airbyte-integrations/connectors/source-google-ads/Dockerfile @@ -13,5 +13,5 @@ COPY main.py ./ ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.41 +LABEL io.airbyte.version=0.1.42 LABEL io.airbyte.name=airbyte/source-google-ads diff --git a/airbyte-integrations/connectors/source-google-ads/setup.py b/airbyte-integrations/connectors/source-google-ads/setup.py index 5323ff07478a4..4f0bf491da5f8 100644 --- a/airbyte-integrations/connectors/source-google-ads/setup.py +++ b/airbyte-integrations/connectors/source-google-ads/setup.py @@ -5,9 +5,9 @@ from setuptools import find_packages, setup -# grpcio-status is required by google ads but is not listed in its dependencies. -# this package must be of the same version range that grpcio is. -MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1", "google-ads==14.1.0", "grpcio-status >= 1.38.1, < 2.0.0", "pendulum"] +# pin protobuf==3.20.0 as other versions may cause problems on different architectures +# (see https://github.com/airbytehq/airbyte/issues/13580) +MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1", "google-ads==15.1.1", "protobuf==3.20.0", "pendulum"] TEST_REQUIREMENTS = ["pytest~=6.1", "pytest-mock", "freezegun", "requests-mock"] diff --git a/airbyte-integrations/connectors/source-google-ads/source_google_ads/google_ads.py b/airbyte-integrations/connectors/source-google-ads/source_google_ads/google_ads.py index 4950f820f3c0f..b39d282a79243 100644 --- a/airbyte-integrations/connectors/source-google-ads/source_google_ads/google_ads.py +++ b/airbyte-integrations/connectors/source-google-ads/source_google_ads/google_ads.py @@ -30,6 +30,7 @@ "geographic_report": "geographic_view", "keyword_report": "keyword_view", } +API_VERSION = "v9" class GoogleAds: @@ -39,7 +40,7 @@ def __init__(self, credentials: MutableMapping[str, Any]): # `google-ads` library version `14.0.0` and higher requires an additional required parameter `use_proto_plus`. # More details can be found here: https://developers.google.com/google-ads/api/docs/client-libs/python/protobuf-messages credentials["use_proto_plus"] = True - self.client = GoogleAdsClient.load_from_dict(credentials) + self.client = GoogleAdsClient.load_from_dict(credentials, version=API_VERSION) self.ga_service = self.client.get_service("GoogleAdsService") def send_request(self, query: str, customer_id: str) -> Iterator[SearchGoogleAdsResponse]: diff --git a/airbyte-integrations/connectors/source-google-ads/unit_tests/common.py b/airbyte-integrations/connectors/source-google-ads/unit_tests/common.py index eb396a16ef002..0038abf2f2dc9 100644 --- a/airbyte-integrations/connectors/source-google-ads/unit_tests/common.py +++ b/airbyte-integrations/connectors/source-google-ads/unit_tests/common.py @@ -5,7 +5,7 @@ import json from google.ads.googleads.errors import GoogleAdsException -from google.ads.googleads.v8 import GoogleAdsFailure +from google.ads.googleads.v9 import GoogleAdsFailure class MockSearchRequest: diff --git a/airbyte-integrations/connectors/source-google-ads/unit_tests/test_streams.py b/airbyte-integrations/connectors/source-google-ads/unit_tests/test_streams.py index acb65d2d75cd0..5973871bc234e 100644 --- a/airbyte-integrations/connectors/source-google-ads/unit_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-google-ads/unit_tests/test_streams.py @@ -7,8 +7,8 @@ import pytest from airbyte_cdk.models import SyncMode from google.ads.googleads.errors import GoogleAdsException -from google.ads.googleads.v8.errors.types.errors import ErrorCode, GoogleAdsError, GoogleAdsFailure -from google.ads.googleads.v8.errors.types.request_error import RequestErrorEnum +from google.ads.googleads.v9.errors.types.errors import ErrorCode, GoogleAdsError, GoogleAdsFailure +from google.ads.googleads.v9.errors.types.request_error import RequestErrorEnum from grpc import RpcError from source_google_ads.google_ads import GoogleAds from source_google_ads.streams import ClickView diff --git a/docs/integrations/sources/google-ads.md b/docs/integrations/sources/google-ads.md index 320b07da468d4..305eb6d570c2f 100644 --- a/docs/integrations/sources/google-ads.md +++ b/docs/integrations/sources/google-ads.md @@ -5,24 +5,27 @@ This page contains the setup guide and reference information for the Google Ads ## Prerequisites Google Ads registered account with -* Customer ID -* Login Customer ID (you can find more information about this field in [Google Ads docs](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid)) -* Custom GAQL Queries (if needed) + +- Customer ID +- Login Customer ID (you can find more information about this field in [Google Ads docs](https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid)) +- Custom GAQL Queries (if needed) Also: -* Start Date -* End Date -* Conversion Window + +- Start Date +- End Date +- Conversion Window For Airbyte OSS: Google Ads Account with an approved Developer Token. (note: In order to get API access to Google Ads, you must have a "manager" account; standard accounts cannot generate a Developer Token. This manager account must be created separately from your standard account. You can find more information about this distinction in the [Google Ads docs](https://support.google.com/google-ads/answer/6139186).) You'll also need to find these values. See the [setup guide](#setup-guide) for instructions. -* Client ID -* Client Secret -* Refresh Token +- Client ID +- Client Secret +- Refresh Token ## Setup guide + ### Step 1: Set up Google Ads This guide will provide information as if starting from scratch. Please skip over any steps you have already completed. @@ -32,18 +35,20 @@ This guide will provide information as if starting from scratch. Please skip ove 3. You should now have two Google Ads accounts: a normal account and a manager account. Link the Manager account to the normal account following [Google's documentation](https://support.google.com/google-ads/answer/7459601). 4. Select your `customer_id`. The `customer_id` refers to the id of each of your Google Ads accounts. This is the 10 digit number in the top corner of the page when you are in Google Ads UI. The source will only pull data from the accounts for which you provide an id. If you are having trouble finding it, check out [Google's instructions](https://support.google.com/google-ads/answer/1704344). - ### Airbyte Open Source additional setup steps - 1. Apply for a developer token (**make sure you follow our** [**instructions**](google-ads.md#how-to-apply-for-the-developer-token) on your Manager account. This token allows you to access your data from the Google Ads API. Here are [Google's instructions](https://developers.google.com/google-ads/api/docs/first-call/dev-token). The docs are a little unclear on this point, but you will _not_ be able to access your data via the Google Ads API until this token is approved. You cannot use a test developer token, it has to be at least a basic developer token. It usually takes Google 24 hours to respond to these applications. This developer token is the value you will use in the `developer_token` field. - 2. Fetch your `client_id`, `client_secret`, and `refresh_token`. Google provides [instructions](https://developers.google.com/google-ads/api/docs/first-call/overview) on how to do this. +### Airbyte Open Source additional setup steps + +1. Apply for a developer token (**make sure you follow our** [**instructions**](google-ads.md#how-to-apply-for-the-developer-token) on your Manager account. This token allows you to access your data from the Google Ads API. Here are [Google's instructions](https://developers.google.com/google-ads/api/docs/first-call/dev-token). The docs are a little unclear on this point, but you will _not_ be able to access your data via the Google Ads API until this token is approved. You cannot use a test developer token, it has to be at least a basic developer token. It usually takes Google 24 hours to respond to these applications. This developer token is the value you will use in the `developer_token` field. +2. Fetch your `client_id`, `client_secret`, and `refresh_token`. Google provides [instructions](https://developers.google.com/google-ads/api/docs/first-call/overview) on how to do this. - ### How to apply for the developer token - Google is very picky about which software and which use case can get access to a developer token. The Airbyte team has worked with the Google Ads team to whitelist Airbyte and make sure you can get one (see [issue 1981](https://github.com/airbytehq/airbyte/issues/1981) for more information). - When you apply for a token, you need to mention: +### How to apply for the developer token - - Why you need the token (eg: want to run some internal analytics...) - - That you will be using the Airbyte Open Source project - - That you have full access to the code base (because we're open source) - - That you have full access to the server running the code (because you're self-hosting Airbyte) +Google is very picky about which software and which use case can get access to a developer token. The Airbyte team has worked with the Google Ads team to whitelist Airbyte and make sure you can get one (see [issue 1981](https://github.com/airbytehq/airbyte/issues/1981) for more information). +When you apply for a token, you need to mention: + +- Why you need the token (eg: want to run some internal analytics...) +- That you will be using the Airbyte Open Source project +- That you have full access to the code base (because we're open source) +- That you have full access to the server running the code (because you're self-hosting Airbyte) ## Step 2: Set up the Google Ads connector in Airbyte @@ -59,6 +64,7 @@ This guide will provide information as if starting from scratch. Please skip ove 8. You're done. ### For Airbyte OSS: + 1. Create a new Google Ads source with a suitable name. 2. Get the customer ID for your account. Learn how to do that [here](https://support.google.com/google-ads/answer/1704344) 3. If your access to the account is through a manager account, get the customer ID of the manager account. @@ -69,10 +75,11 @@ This guide will provide information as if starting from scratch. Please skip ove ## Supported sync modes The Google Ads source connector supports the following[ sync modes](https://docs.airbyte.com/cloud/core-concepts#connection-sync-modes): - - Full Refresh | Overwrite - - Full Refresh | Append - - Incremental Sync | Append - - Incremental Sync | Deduped History + +- Full Refresh | Overwrite +- Full Refresh | Append +- Incremental Sync | Append +- Incremental Sync | Deduped History ## Supported Streams @@ -124,6 +131,7 @@ This source is constrained by whatever API limits are set for the Google Ads tha | Version | Date | Pull Request | Subject | |:---------|:-----------|:---------------------------------------------------------|:---------------------------------------------------------------------------------------------| +| `0.1.42` | 2022-06-08 | [13624](https://github.com/airbytehq/airbyte/pull/13624) | Update `google-ads` to 15.1.1, pin `protobuf==3.20.0` to work on MacOS M1 machines (AMD) | | `0.1.41` | 2022-06-08 | [13618](https://github.com/airbytehq/airbyte/pull/13618) | Add missing dependency | | `0.1.40` | 2022-06-02 | [13423](https://github.com/airbytehq/airbyte/pull/13423) | Fix the missing data [issue](https://github.com/airbytehq/airbyte/issues/12999) | | `0.1.39` | 2022-05-18 | [12914](https://github.com/airbytehq/airbyte/pull/12914) | Fix GAQL query validation and log auth errors instead of failing the sync |