Unfortunately doesn't work in Ads API v4 (beta): TypeError: Object of type GoogleAdsRow is not JSON serializable
Am Dienstag, 3. Dezember 2019 16:14:26 UTC+1 schrieb Mark Edmondson: > > I couldn't get the protobuf to work but using the SOAP seralizer zeep this > seems to work: > https://python-zeep.readthedocs.io/en/latest/helpers.html > > from zeep import helpers > > def toJSON(x): > input_dict = helpers.serialize_object(x) > return json.dumps(input_dict) > > > > > On Monday, April 1, 2019 at 9:12:38 PM UTC+2, Alexander Belozerov wrote: >> >> Hello there, >> Im querying google ads api and need to save results as json. What is the >> best way to convert GoogleAdsRow type into json? >> >> >> The result of the google ads api call is GoogleAdsRow that looks like >> this: >> >> 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" >> } >> } >> >> Instead of campaign, it can be adgroup, keywords, etc. >> What is the best way to convert this kind of data to json? >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/a47fe08e-ac6c-4a8c-932b-7429507bca6co%40googlegroups.com.
