I download data from CAMPAIGN_LOCATION_TARGET_REPORT via API v201809.
At the same time I download data from CAMPAIGN_PERFORMANCE_REPORT.
I use fileds: Cost, Impressions, Clicks.
The SUM in total of this fields (Cost, Impressions, Clicks) has some differens beetween two repots: CAMPAIGN_LOCATION_TARGET_REPORT, CAMPAIGN_PERFORMANCE_REPORT
Numbers from CAMPAIGN_PERFORMANCE_REPORT are the same like in Web-inferface - everything is OK.
But number from CAMPAIGN_LOCATION_TARGET_REPORT is little bit bigger. I don't understand why?
Can you download this two reports for account
478-325-6348 and dates 2018-12-01 - 2018-12-31 all campaigns (no restrictions) and see the difference.
My excpectations: SUMs should be the same. But I didnt get.
The code is below:
1)
fields = ['CampaignId', 'CampaignName', 'CampaignStatus', 'Id', 'Date', 'Interactions', 'InteractionTypes', 'Clicks', 'Impressions', 'Cost','Engagements', 'VideoViews', 'ViewThroughConversions', 'AveragePosition', 'CampaignStatus']
include_zero_impressions = True
report_query = (adwords.ReportQueryBuilder()
.Select(*fields)
.From('CAMPAIGN_LOCATION_TARGET_REPORT')
.Where('CampaignStatus').In('ENABLED', 'PAUSED')
.During(start_date.strftime('%Y%m%d') + ',' + end_date.strftime('%Y%m%d'))
.Build())
res = report_downloader.DownloadReportAsStringWithAwql(
report_query, 'CSV', skip_report_header=True,
skip_column_header=False, skip_report_summary=True,
include_zero_impressions=include_zero_impressions)
import pandas as pd
from io import StringIO
adwords_df = pd.read_csv(StringIO(res))
2)
report = 'CAMPAIGN_PERFORMANCE_REPORT'
fields_query = ['Date', 'AccountDescriptiveName', 'AdvertisingChannelType', 'AdvertisingChannelSubType', 'AdNetworkType1', 'CampaignId', 'CampaignName', 'Impressions', 'Clicks', 'Cost', 'AccountCurrencyCode']
report_query = (adwords.ReportQueryBuilder()
.Select(*fields_query)
.From(report)
.Where('CampaignStatus').In('ENABLED', 'PAUSED')
.During(start_date.strftime('%Y%m%d') + ', ' + end_date.strftime('%Y%m%d'))
.Build())
res = report_downloader.DownloadReportAsStringWithAwql(
report_query, 'CSV', skip_report_header=True,
skip_column_header=False, skip_report_summary=True,
include_zero_impressions=False,
)
adwords_df = pd.read_csv(StringIO(res))