AdWords API Re: Criterion Stats in PHP

2010-03-23 Thread prasad darla
Hi,

I was trying to write a very similar code to get Criterion stats. I
think I have it wrong. The below code is different from what I have
written. But I cannot get this to work because I am not sure what is
the object type of $selector variable. Can someone throw light on what
object type $selector is?

TIA
Prasad

On Mar 12, 3:07 am, Mike-Indiana michaelyanda+...@gmail.com wrote:
 Many thanks Dan and Eric, I got it now.

 Solution (Displays first page min CPC, stats such as clicks,
 impressions, etc and quality score):

         // Create id filter.
         $idFilter = new AdGroupCriterionIdFilter();
         $idFilter-adGroupId = $adGroupId;
         $idFilter-criterionId = $criterionId;
         $idFilter-qualityInfo = $criterionId;
         $idFilter-firstPageCpc = $criterionId;

         // Create selectors
         $selector-idFilters = array($idFilter);
         $selector-QualityInfo = $criterionId;
         $selector-statsSelector-dateRange = new
 DateRange('20100310','20100310');

         // Update ad group criteria.
         $page = $adGroupCriteriaService-get($selector);
                 if (isset($page-entries)) {
                         foreach ($page-entries as $adGroupCriterion) {
 . etc.

 On Mar 10, 9:39 am, AdWords API Advisor adwordsapiadvi...@google.com
 wrote:

  Hi Mike,

  The hierarchy of objects should be:

  AdGroupCriterionSelector
  |_ StatsSelector
     |_ DateRange

  Here is an example:

  $selector = new CampaignSelector();
  $selector-statsSelector = new StatsSelector();
  $selector-statsSelector-dateRange = new DateRange('20090101',
  '20090131');

  Best,
  - Eric Koleda, AdWords API Team

  On Mar 9, 5:06 pm, Mike-Indiana michaelyanda+...@gmail.com wrote:

   Hi Eric, could you help me out with the dateRange for stats? This is
   still pulling all stats, and not the daterange. The log does not even
   show the daterange, so I know I'm getting this wrong.

   Thanks:

           $selector-statsSelector = $criterionId;
           $selector-statsSelector = new DateRange();
           $selector-dateRange-min = '20100308';
           $selector-dateRange-max = '20100309';
           $selector-stats = $criterionId;

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


AdWords API Re: Criterion Stats in PHP

2010-03-10 Thread daniel.pl...@gmail.com
The examples show the dateRange being used in this way.

// For today's date.
$selector-dateRange = new DateRange(date('Ymd'), date('Ymd'));


Dan

On Mar 9, 10:06 pm, Mike-Indiana michaelyanda+...@gmail.com wrote:
 Hi Eric, could you help me out with the dateRange for stats? This is
 still pulling all stats, and not the daterange. The log does not even
 show the daterange, so I know I'm getting this wrong.

 Thanks:

         $selector-statsSelector = $criterionId;
         $selector-statsSelector = new DateRange();
         $selector-dateRange-min = '20100308';
         $selector-dateRange-max = '20100309';
         $selector-stats = $criterionId;

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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


AdWords API Re: Criterion Stats in PHP

2010-03-10 Thread AdWords API Advisor
Hi Mike,

The hierarchy of objects should be:

AdGroupCriterionSelector
|_ StatsSelector
   |_ DateRange


Here is an example:

$selector = new CampaignSelector();
$selector-statsSelector = new StatsSelector();
$selector-statsSelector-dateRange = new DateRange('20090101',
'20090131');

Best,
- Eric Koleda, AdWords API Team


On Mar 9, 5:06 pm, Mike-Indiana michaelyanda+...@gmail.com wrote:
 Hi Eric, could you help me out with the dateRange for stats? This is
 still pulling all stats, and not the daterange. The log does not even
 show the daterange, so I know I'm getting this wrong.

 Thanks:

         $selector-statsSelector = $criterionId;
         $selector-statsSelector = new DateRange();
         $selector-dateRange-min = '20100308';
         $selector-dateRange-max = '20100309';
         $selector-stats = $criterionId;

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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