Thursday, June 27, 2019

How to download campaign performance report with filter by list of id in campaign_name

Hi,

I have for example a bunch of campaigns with name's pattern like this : 'this is a gdn campaign - 233432'  , 
Now I am using Python SDK to download report for each gdn campaign name, but filter by this number 233432 as an id.
so my report query looks like this:
I can request each report by contains('id_1') but it's not efficient and that's why I want to request each time 20 ids into the ContainsAny operation. Does current adwords API support this?
Thanks

report_query = (adwords.ReportQueryBuilder()
.Select('CampaignId', 'Date',
'Impressions', 'Clicks',
'Cost', 'CampaignName')
.From('CAMPAIGN_PERFORMANCE_REPORT')
#.Where('CampaignStatus').In('ENABLED', 'PAUSED')
.Where('CampaignName').ContainsAny(['id_1', 'id_2'])
.During(date_range=date_preset, start_date=start_date, end_date=end_date)
.Build())

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb28f73c-a337-4f58-9e9f-2d23c9cf49ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment