Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Source Google Ads: Add fields to the campaign stream 🚨 #18069

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
- name: Google Ads
sourceDefinitionId: 253487c0-2246-43ba-a21f-5116b20a2c50
dockerRepository: airbyte/source-google-ads
dockerImageTag: 0.2.2
dockerImageTag: 0.2.3
documentationUrl: https://docs.airbyte.com/integrations/sources/google-ads
icon: google-adwords.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3785,7 +3785,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-google-ads:0.2.2"
- dockerImage: "airbyte/source-google-ads:0.2.3"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/google-ads"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The resources are listed [here](https://developers.google.com/google-ads/api/ref
When querying data, there are three categories of information that can be fetched:

- **Attributes**: These are properties of the various entities in the API e.g: the title or ID of an ad campaign.
- **Metrics**: metrics are statistics related to entities in the API. For example, the number of impressions for an ad or an ad campaign. All available metrics can be found [here](https://developers.google.com/google-ads/api/fields/v8/metrics).
- **Metrics**: metrics are statistics related to entities in the API. For example, the number of impressions for an ad or an ad campaign. All available metrics can be found [here](https://developers.google.com/google-ads/api/fields/v11/metrics).
- **Segments**: These are ways to partition metrics returned in the query by particular attributes. For example, one could query for the number of impressions (views of an ad) by running SELECT
metrics.impressions FROM campaigns which would return the number of impressions for each campaign e.g: 10k impressions. Or you could query for impressions segmented by device type e.g; SELECT
metrics.impressions, segments.device FROM campaigns which would return the number of impressions broken down by device type e.g: 3k iOS and 7k Android. When summing the result across all segments,
Expand Down
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.2
LABEL io.airbyte.version=0.2.3
LABEL io.airbyte.name=airbyte/source-google-ads
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@
"metrics.clicks": {
"type": ["null", "integer"]
},
"metrics.ctr": {
"type": ["null", "number"]
},
"metrics.conversions": {
"type": ["null", "integer"]
},
"metrics.conversions_value": {
"type": ["null", "integer"]
},
"metrics.cost_micros": {
"type": ["null", "integer"]
},
Expand All @@ -260,6 +269,9 @@
"segments.date": {
"type": ["null", "string"],
"format": "date"
},
"segments.hour": {
"type": ["null", "number"]
}
}
}
27 changes: 14 additions & 13 deletions docs/integrations/sources/google-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,33 +78,33 @@ The Google Ads source connector can sync the following tables. It can also sync

### Main Tables

- [accounts](https://developers.google.com/google-ads/api/fields/v9/customer)
- [ad_group_ads](https://developers.google.com/google-ads/api/fields/v9/ad_group_ad)
- [ad_group_ad_labels](https://developers.google.com/google-ads/api/fields/v9/ad_group_ad_label)
- [ad_groups](https://developers.google.com/google-ads/api/fields/v9/ad_group)
- [ad_group_labels](https://developers.google.com/google-ads/api/fields/v9/ad_group_label)
- [campaign_labels](https://developers.google.com/google-ads/api/fields/v9/campaign_label)
- [click_view](https://developers.google.com/google-ads/api/reference/rpc/v9/ClickView)
- [keyword](https://developers.google.com/google-ads/api/fields/v9/keyword_view)
- [geographic](https://developers.google.com/google-ads/api/fields/v9/geographic_view)
- [accounts](https://developers.google.com/google-ads/api/fields/v11/customer)
- [ad_group_ads](https://developers.google.com/google-ads/api/fields/v11/ad_group_ad)
- [ad_group_ad_labels](https://developers.google.com/google-ads/api/fields/v11/ad_group_ad_label)
- [ad_groups](https://developers.google.com/google-ads/api/fields/v11/ad_group)
- [ad_group_labels](https://developers.google.com/google-ads/api/fields/v11/ad_group_label)
- [campaign_labels](https://developers.google.com/google-ads/api/fields/v11/campaign_label)
- [click_view](https://developers.google.com/google-ads/api/reference/rpc/v11/ClickView)
- [keyword](https://developers.google.com/google-ads/api/fields/v11/keyword_view)
- [geographic](https://developers.google.com/google-ads/api/fields/v11/geographic_view)

Note that `ad_groups`, `ad_group_ads`, and `campaigns` contain a `labels` field, which should be joined against their respective `*_labels` streams if you want to view the actual labels. For example, the `ad_groups` stream contains an `ad_group.labels` field, which you would join against the `ad_group_labels` stream's `label.resource_name` field.

### Report Tables

- [campaigns](https://developers.google.com/google-ads/api/fields/v9/campaign)
- [campaigns](https://developers.google.com/google-ads/api/fields/v11/campaign)
- [account_performance_report](https://developers.google.com/google-ads/api/docs/migration/mapping#account_performance)
- [ad_group_ad_report](https://developers.google.com/google-ads/api/docs/migration/mapping#ad_performance)
- [display_keyword_report](https://developers.google.com/google-ads/api/docs/migration/mapping#display_keyword_performance)
- [display_topics_report](https://developers.google.com/google-ads/api/docs/migration/mapping#display_topics_performance)
- [shopping_performance_report](https://developers.google.com/google-ads/api/docs/migration/mapping#shopping_performance)
- [user_location_report](https://developers.google.com/google-ads/api/fields/v9/user_location_view)
- [user_location_report](https://developers.google.com/google-ads/api/fields/v11/user_location_view)

:::note
Due to Google Ads API constraints, the `click_view` stream retrieves data one day at a time and can only retrieve data newer than 90 days ago. Also, [metrics](https://developers.google.com/google-ads/api/fields/v9/metrics) cannot be requested for a Google Ads Manager account. Report streams are only available when pulling data from a non-manager account.
Due to Google Ads API constraints, the `click_view` stream retrieves data one day at a time and can only retrieve data newer than 90 days ago. Also, [metrics](https://developers.google.com/google-ads/api/fields/v11/metrics) cannot be requested for a Google Ads Manager account. Report streams are only available when pulling data from a non-manager account.
:::

For incremental streams, data is synced up to the previous day using your Google Ads account time zone since Google Ads can filter data only by [date](https://developers.google.com/google-ads/api/fields/v9/ad_group_ad#segments.date) without time. Also, some reports cannot load data real-time due to Google Ads [limitations](https://support.google.com/google-ads/answer/2544985?hl=en).
For incremental streams, data is synced up to the previous day using your Google Ads account time zone since Google Ads can filter data only by [date](https://developers.google.com/google-ads/api/fields/v11/ad_group_ad#segments.date) without time. Also, some reports cannot load data real-time due to Google Ads [limitations](https://support.google.com/google-ads/answer/2544985?hl=en).

## Custom Query: Understanding Google Ads Query Language

Expand All @@ -124,6 +124,7 @@ Due to a limitation in the Google Ads API which does not allow getting performan

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------|
| `0.2.3` | 2022-10-17 | [18069](https://github.com/airbytehq/airbyte/pull/18069) | Add `segments.hour`, `metrics.ctr`, `metrics.conversions` and `metrics.conversions_values` fields to `campaigns` report stream |
| `0.2.2` | 2022-10-21 | [17412](https://github.com/airbytehq/airbyte/pull/17412) | Release with CDK >= 0.2.2 |
| `0.2.1` | 2022-09-29 | [17412](https://github.com/airbytehq/airbyte/pull/17412) | Always use latest CDK version |
| `0.2.0` | 2022-08-23 | [15858](https://github.com/airbytehq/airbyte/pull/15858) | Mark the `query` and `table_name` fields in `custom_queries` as required |
Expand Down