campaign {
resource_name: "customers/321/campaigns/123"
id {
value: 123
}
name {
value: "Campaign Name A"
}
}
metrics {
clicks {
value: 711
}
impressions {
value: 2662
}
}
segments {
device: DESKTOP
ad_network_type: SEARCH
date {
value: "2019-03-01"
}
}
Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
from google.protobuf import json_format
### code to get the object ###
rec_obj = row.recommendation.text_ad_recommendation.ad
json_str = json_format.MessageToJson(rec_obj)
print(json_str)
Adam
from zeep import helpers
def toJSON(x):
input_dict = helpers.serialize_object(x)
return json.dumps(input_dict)
Hello,
Thank you for reaching out. If you are using the our client libraries, it is not possible to retrieve the data in JSON format. However, as an alternative you can use the cURL operation to get the output in JSON format. You can refer to this guide for more details on how to interact with Google Ads API using cURL. Please give this a try and let me know if you have any further questions.
Regards,
Nikisha Patel, Google Ads API Team