Adding example for searchAppearance (#414)
diff --git a/samples/searchconsole/search_analytics_api_sample.py b/samples/searchconsole/search_analytics_api_sample.py
index 017d47f..167ec26 100644
--- a/samples/searchconsole/search_analytics_api_sample.py
+++ b/samples/searchconsole/search_analytics_api_sample.py
@@ -140,6 +140,17 @@
response = execute_request(service, flags.property_uri, request)
print_table(response, 'Group by country and device')
+ # Group by total number of Search Appearance count.
+ # Note: It is not possible to use searchAppearance with other
+ # dimensions.
+ request = {
+ 'startDate': flags.start_date,
+ 'endDate': flags.end_date,
+ 'dimensions': ['searchAppearance'],
+ 'rowLimit': 10
+ }
+ response = execute_request(service, flags.property_uri, request)
+ print_table(response, 'Search Appearance Features')
def execute_request(service, property_uri, request):
"""Executes a searchAnalytics.query request.
@@ -165,7 +176,7 @@
response: The server response to be printed as a table.
title: The title of the table.
"""
- print title + ':'
+ print '\n --' + title + ':'
if 'rows' not in response:
print 'Empty response'