Re: Retrieving all data for last year from CAMPAIGN_PERFORMANCE_REPORT

2016-07-08 Thread testezond2
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.


Re: Retrieving all data for last year from CAMPAIGN_PERFORMANCE_REPORT

2016-07-07 Thread 'Peter Oliquino' via AdWords API Forum
Hi,

Thanks for the additional information. To further investigate the issue 
regarding the no data, could you kindly provide the customer Id of the test 
account? Also, please do so using *Reply privately to author*.

Regards,
Peter
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/de469739-39f2-4acd-b846-42889c0e2ca1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retrieving all data for last year from CAMPAIGN_PERFORMANCE_REPORT

2016-07-07 Thread testezond2

I am not trying to save a file just save it into a database.

I am doing this dynamically, as my service allows users to signup and show 
their data via a dashboard of our own.

The desired response I wanted from the report would be

CAMPAIGN_PERFORMANCE_REPORT (Jan 1, 2016-Jul 7, 2016)
Day,Campaign ID,Campaign,Impressions,Clicks,Cost,Conversions,Cost / conv.

20160707, ,0,0,0,0.0,0

20160706, ,2,0,0,0.0,0

20160705, ,0,5,0,0.0,0

20160704, ,1,0,1,0.0,0

20160703, ,0,0,0,1.0,1

20160702, ,0,0,0,0.0,0

20160701, ,0,0,0,0.0,0

Total, --, --,0,0,0,0.0,0


as you can see in the above example it loads data from days with all 0's.

On Thursday, July 7, 2016 at 5:34:28 PM UTC+10, Peter Oliquino wrote:
>
> Hi,
>
> I tested your AWQL query using my own test account and found that your 
> query should work fine in getting the (test account) results. In addition, 
> you will need to specify a file path in the $reportUtils in order for you 
> to be able to download the file into a CSV (or other format 
> )
>  
> output file. 
>
> Please also note that report generation is supported only at the account 
> level, meaning, the clientCustomerId specified in your auth.ini 
> 
>  file 
> should be that of a client account instead of a manager account. You could 
> check our reporting guide 
>  for 
> more information and also check here 
> 
>  for 
> a more concrete example of generating a report (including the option on how 
> to suppress the headers) using PHP.
>
> I hope this helps.
>
> Thanks,
> Peter
> AdWords API Team
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/e1222acc-5154-4acc-85de-31316a73e509%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retrieving all data for last year from CAMPAIGN_PERFORMANCE_REPORT

2016-07-07 Thread 'Peter Oliquino' via AdWords API Forum
Hi,

I tested your AWQL query using my own test account and found that your 
query should work fine in getting the (test account) results. In addition, 
you will need to specify a file path in the $reportUtils in order for you 
to be able to download the file into a CSV (or other format 
)
 
output file. 

Please also note that report generation is supported only at the account 
level, meaning, the clientCustomerId specified in your auth.ini 

 file 
should be that of a client account instead of a manager account. You could 
check our reporting guide 
 for more 
information and also check here 

 for 
a more concrete example of generating a report (including the option on how 
to suppress the headers) using PHP.

I hope this helps.

Thanks,
Peter
AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/9c2568e7-66cc-4567-813c-532953206a48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Retrieving all data for last year from CAMPAIGN_PERFORMANCE_REPORT

2016-07-07 Thread testezond2
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/18cebef9-0efa-4845-a4f7-aa6268379acc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.