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

Google ads added fields and reports #9310

Merged
merged 10 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
merge master
  • Loading branch information
schlattk committed Feb 4, 2022
commit fe5e4bae9cd3c817467ddbc980dd5565ee4caee9
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"shopping_performance_report": "shopping_performance_view",
"user_location_report": "user_location_view",
"click_view": "click_view",
"keyword_view": "keyword_view"
"geographic_report": "geographic_view",
"keyword_report": "keyword_view",
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,24 @@
"segments.date": {
"type": ["null", "string"],
"format": "date"
},
"campaign.bidding_strategy_type": {
"type": ["null", "string"]
},
"metrics.clicks": {
"type": ["null", "integer"]
},
"metrics.cost_micros": {
"type": ["null", "integer"]
},
"metrics.impressions": {
"type": ["null", "integer"]
},
"ad_group_criterion.criterion_id": {
"type": ["null", "integer"]
},
"segments.ad_network_type": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schlattk Error happens because this field was added.

message: "Cannot select the following segments because at least one unsupported metric is found in SELECT or WHERE clause: \'segments.ad_network_type\'(unsupported metrics: \'historical_quality_score\')."\n}\nrequest_id: "hBx3G90_bSZ-rVpnBMQlxQ"\n, 'hBx3G90_bSZ-rVpnBMQlxQ')"}}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works when read command is run without this field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@augan-rymkhan ok but it is a supported field according to documentation and also it has been running live for a long time without any errors. What do you suggest is the solution?

Copy link
Contributor

@augan-rymkhan augan-rymkhan Feb 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schlattk It seems we can not query metrics.historical_quality_score and segments.ad_network_type together in keyword_report stream.

In docs:
A segment in the SELECT clause is incompatible with a metric in the SELECT or WHERE clause.
For more you can read PROHIBITED_SEGMENT_WITH_METRIC_IN_SELECT_OR_WHERE_CLAUSE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes @augan-rymkhan that appears to be the problem. Ok, I removed the field I think we can most probably do without it in this report.

"type": ["null", "integer"]
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
ClickView,
DisplayKeywordPerformanceReport,
DisplayTopicsPerformanceReport,
<<<<<<< HEAD
KeywordView,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schlattk stream KeywordView is not defined anywhere. You should remove all the references to KeywordView (resolving merge conflicts also), because this stream is implemented as KeywordReport.

=======
GeographicReport,
KeywordReport,
>>>>>>> master
ShoppingPerformanceReport,
UserLocationReport,
)
Expand Down Expand Up @@ -107,5 +112,31 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
Accounts(api=google_api),
Campaigns(**incremental_stream_config),
augan-rymkhan marked this conversation as resolved.
Show resolved Hide resolved
ClickView(**incremental_stream_config),
<<<<<<< HEAD
KeywordView(**incremental_stream_config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need in KeywordView.

] + custom_query_streams
=======
]

custom_query_streams = [
CustomQuery(custom_query_config=single_query_config, **incremental_stream_config)
for single_query_config in config.get("custom_queries", [])
]
streams.extend(custom_query_streams)

# Metrics streams cannot be requested for a manager account.
if not self.is_manager_account(account_info):
streams.extend(
[
UserLocationReport(**incremental_stream_config),
AccountPerformanceReport(**incremental_stream_config),
DisplayTopicsPerformanceReport(**incremental_stream_config),
DisplayKeywordPerformanceReport(**incremental_stream_config),
ShoppingPerformanceReport(**incremental_stream_config),
AdGroupAdReport(**incremental_stream_config),
GeographicReport(**incremental_stream_config),
KeywordReport(**incremental_stream_config),
]
)
return streams
>>>>>>> master
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,4 @@ class ClickView(IncrementalGoogleAdsStream):
"""

days_of_data_storage = 90

class KeywordView(IncrementalGoogleAdsStream):
"""
KeywordView stream: https://developers.google.com/google-ads/api/fields/v8/keyword_view
"""
range_days = 1
You are viewing a condensed version of this merge commit. You can view the full changes here.