The issue was the way I set the headers for 0 result entries. to fix this, you must do the following to set the header for reports.
To set the values for the request headers for a report request, you need to set the options like this: $options = array('version' => ADWORDS_VERSION); $options['includeZeroImpressions'] = true; //includes zero impression rows in the report output. ReportUtils::DownloadReportWithAwql($reportQuery, $filePath, $user, $reportFormat, $options); Thank you to the api team for helping me out with that. On Thursday, July 7, 2016 at 4:32:35 PM UTC+10, teste...@gmail.com wrote: > > Hello, > > I am trying to store 1 years worth of data into my database. Now I have a > test account and no actual data, so I can't really test this well. > > I want to retrieve the last years data even if there is no actual changes > in data. > > $reportQuery = 'SELECT Date, CampaignId, CampaignName, Impressions, > Clicks, Cost, Conversions, CostPerConversion FROM > CAMPAIGN_PERFORMANCE_REPORT DURING 20160101, 20160707'; > > > $reportUtils = new ReportUtils(); > $data = $reportUtils->DownloadReportWithAwql($reportQuery, null, $user > , "CSV"); > > I get the following as a result > > CAMPAIGN_PERFORMANCE_REPORT (Jan 1, 2016-Jul 7, 2016) > Day,Campaign ID,Campaign,Impressions,Clicks,Cost,Conversions,Cost / conv. > Total, --, --,0,0,0,0.0,0 > > > As you can see no data, I wanted this to be filled with --, --,0,0,0,0.0,0 > for each day. > > > > Any idea on how to achieve this? > > > Also setting these header values don't seem to work as I am getting it in the > response anyway. > > > $user = new AdWordsUser(); > $user->SetClientCustomerId("token"); > $user->SetDeveloperToken($devToken); > $user->setUserAgent($userAgent); > $user->SetHeaderValue("includeZeroImpressions", true); > $user->SetHeaderValue("skipColumnHeader", true); > $user->SetHeaderValue("skipReportHeader", true); > $user->SetHeaderValue("skipReportSummary", true); > > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. 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/d2f74aa6-e847-44a5-b5b1-5e435dab959c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.