Re: PHP example for using HourOfDay

2014-04-25 Thread Nypo77
Hi Danial,

it is working now! 
Honestly, I don't really know what I was doing wrong, maybe by mistake I 
did call the wrong report?? I remember checking that tooanyway, It is 
working nicely, I see the data / hour coming.

Appreciate your assistance and input!

Thank you
*,--Steve*


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.


Re: PHP example for using HourOfDay

2014-04-24 Thread Danial Klimkin
Hello Steve,


I just tested the campaign performance report with this field and it worked 
fine. Can you please confirm you run report of this type?

Not every report supports per-hour statistics.


-Danial, AdWords API Team.


On Wednesday, April 23, 2014 4:32:45 PM UTC+4, Nypo77 wrote:
>
> Hi Danial!
>
> Thank you for your answer!
>
> I tried the suggestion and this is what I get:
>
>Report download failed. Underlying errors are Type = 
> 'ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORT', Trigger = 
> 'HourOfDay', FieldPath = ''. "
>
>
> Thank you!
> *--Steve*
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.


Re: PHP example for using HourOfDay

2014-04-23 Thread Nypo77
Hi Danial!

Thank you for your answer!

I tried the suggestion and this is what I get:

   Report download failed. Underlying errors are Type = 
'ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORT', Trigger = 
'HourOfDay', FieldPath = ''. "


Thank you!
*--Steve*

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.


Re: PHP example for using HourOfDay

2014-04-23 Thread Danial Klimkin
Hello Steve,


Should be as easy as changing this line to:

  $selector->fields = array('Date', 'Id', 'TotalCost', 'HourOfDay');

Note you'll need to update the response XML parser to account for extra 
rows.


-Danial, AdWords API Team.


On Tuesday, April 22, 2014 7:27:41 PM UTC+4, Nypo77 wrote:
>
> Dear Community,
>
> I am downloading a CAMPAIGN PERFORMANCE REPORT for a period of 1 day, and 
> this works just fine. 
>
> Here is the code how I do the setup for the it:
>
> // Create selector.
> $selector = new \Selector();
> $selector->fields = array('Date', 'Id', 'TotalCost');
>
> // Filter
> $selector->predicates[] = new \Predicate('Id', 'IN', 
> ['campaignid1', 'campaignid2', ...]);
> $selector->predicates[] = new \Predicate('Clicks', 'GREATER_THAN', 
> 0);
>
> // create daterange
> $dateRange = new \DateRange();
> $dateRange->min = $date->format('Ymd');
> $dateRange->max = $date->format('Ymd');
> $selector->dateRange = $dateRange;
>
> // Create report definition.
> $reportDefinition = new \ReportDefinition();
> $reportDefinition->selector = $selector;
> $reportDefinition->reportName = 'Campaign Performance Report #' . 
> uniqid();
> $reportDefinition->dateRangeType = 'CUSTOM_DATE';
> $reportDefinition->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
> $reportDefinition->downloadFormat = 'XML';
> $reportDefinition->includeZeroImpressions = FALSE;
>
> // options for report call
> $options = array('version' => 'v201309', 'returnMoneyInMicros' => 
> FALSE);
>
> and then I do the request and it works fine.
>
> Nevertheless with new features requested for my application I need to 
> segment this data on a hourly basis. 
> I found on several forum entries that it is possible (here for example: 
> *https://groups.google.com/forum/#!newtopic/adwords-api/adwords-api/gnmRZZZcPsg
>  
> *).
>  
> I checked the specified documentation 
> (*https://developers.google.com/adwords/api/docs/appendix/reports#campaign 
> *), 
> found the *HourOfDay* field, about which was stated that it should 
> segment the report per hours.
>
> My issue is that I simply could not find how does it look like in PHP to 
> use this HourOfDay. Probably missing something obvoius. I tried several 
> ways, I thought would work but with no success.
>
> So can anybody help me out, how to change my above PHP example to be able 
> to use this HourOfDay segment?
>
>
> Thanks a lot!
> *--Steve*
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.


PHP example for using HourOfDay

2014-04-22 Thread Nypo77
Dear Community,

I am downloading a CAMPAIGN PERFORMANCE REPORT for a period of 1 day, and 
this works just fine. 

Here is the code how I do the setup for the it:

// Create selector.
$selector = new \Selector();
$selector->fields = array('Date', 'Id', 'TotalCost');

// Filter
$selector->predicates[] = new \Predicate('Id', 'IN', 
['campaignid1', 'campaignid2', ...]);
$selector->predicates[] = new \Predicate('Clicks', 'GREATER_THAN', 
0);

// create daterange
$dateRange = new \DateRange();
$dateRange->min = $date->format('Ymd');
$dateRange->max = $date->format('Ymd');
$selector->dateRange = $dateRange;

// Create report definition.
$reportDefinition = new \ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = 'Campaign Performance Report #' . 
uniqid();
$reportDefinition->dateRangeType = 'CUSTOM_DATE';
$reportDefinition->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'XML';
$reportDefinition->includeZeroImpressions = FALSE;

// options for report call
$options = array('version' => 'v201309', 'returnMoneyInMicros' => 
FALSE);

and then I do the request and it works fine.

Nevertheless with new features requested for my application I need to 
segment this data on a hourly basis. 
I found on several forum entries that it is possible (here for example: 
*https://groups.google.com/forum/#!newtopic/adwords-api/adwords-api/gnmRZZZcPsg*).
 
I checked the specified documentation (
*https://developers.google.com/adwords/api/docs/appendix/reports#campaign*), 
found the *HourOfDay* field, about which was stated that it should segment 
the report per hours.

My issue is that I simply could not find how does it look like in PHP to 
use this HourOfDay. Probably missing something obvoius. I tried several 
ways, I thought would work but with no success.

So can anybody help me out, how to change my above PHP example to be able 
to use this HourOfDay segment?


Thanks a lot!
*--Steve*

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
For more options, visit https://groups.google.com/d/optout.