Performance Reports: How to get objects that only existed before today?

29 views
Skip to first unread message

Jim Malone

unread,
Apr 12, 2017, 3:05:26 PM4/12/17
to AdWords API Forum
Hi, I am trying to use the reporting API to get data that will help us compare points in time for our adwords account.  However, the DURING parameter in my AWQL is not doing what I'd expect it to.  If I use the below AWQL, I would expect that only campaigns that existed Yesterday will be returned.  However, it's returning campaigns that we created today, just with zero stats.  How do I update this query to not include any objects that were created today?


gs.report_downloader.DownloadReportAsStringWithAwql("
SELECT CampaignId, CampaignName, CampaignStatus, Amount, BudgetId, Impressions, Clicks, Conversions, Cost, AveragePosition, ValuePerAllConversion
FROM CAMPAIGN_PERFORMANCE_REPORT
WHERE CampaignStatus IN ['ENABLED', 'PAUSED']
DURING YESTERDAY"

, 'TSV', skip_report_header=True, skip_column_header=True, skip_report_summary=True, include_zero_impressions=True)


Thanks,
Jim

Shwetha Vastrad (AdWords API Team)

unread,
Apr 12, 2017, 5:16:42 PM4/12/17
to AdWords API Forum
Hi Jim, 

The Campaign Performance Report will include all the campaigns that match the filter specified in the report definition and provide performance statistics for the DateRange specified. To get the campaigns which only existed before today, please follow these steps:
  1. Perform a CustomerSyncService.get() request to get the campaigns changed in the last 24 hours. If the CampaignChangeStatus is NEW then this campaign was created during the dateRange specified. Store these campaignIds.
  2. Add a predicate to your report definition to exclude these campaigns from the report. The filter should look like this:
    WHERE CampaignId NOT_IN [list of campaign IDs from step 1]
This way you'll only get the campaigns which were created before the last 24 hours. The GetAccountChanges Java example shows how to get the changes in the account during the last 24 hours using CustomerSyncService. Example code in other languages is provided here.

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages