So I found that when I download the adgroup performance report in the API,
it includes fewer ad groups than when I download from the interface. Did I
do something wrong?
The code is as follow; I downloaded the report and put it into a pandas
dataframe:
def downloadAdGroupReport(start_date, end_date):
output = io.StringIO()
# Initialize appropriate service.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
report_downloader = adwords_client.GetReportDownloader(version='v201705')
# Create report query.
report_query = ('SELECT AdGroupId, AdGroupName, CampaignName, CpcBid, Week,
Device, Clicks, AllConversions '
'FROM ADGROUP_PERFORMANCE_REPORT '
#'WHERE AdGroupStatus IN [ENABLED] '
'DURING '+start_date+','+end_date)
# Write query result to output file
report_downloader.DownloadReportWithAwql(
report_query,
'CSV',
output,
client_customer_id='XXX-XXX-XXXX', # denotes which adw account to pull
from
skip_report_header=True,
skip_column_header=False,
skip_report_summary=True,
include_zero_impressions=False)
output.seek(0)
df = pd.read_csv(output)
return df
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/7e6b32cc-6c52-4f10-862e-fc362a0f02f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.