Hello Sir,

But in our cases criteria are set for age range , income range etc .. still
then we are not getting info using criteraType as 'AGE_RANGE',
'INCOME_RANGE' in campaigncriterionservice ..

On Thu, 13 Dec 2018 at 4:57 AM 'Anash P. Oommen (AdWords API Team)' via
AdWords API and Google Ads API Forum <[email protected]> wrote:

> Hi Harisankar,
>
> Demographic criteria like INCOME_RANGE, AGE_RANGE, GENDER are criteria
> that are enabled by default for all audience, so we don't explicitly add
> these criteria in a campaign. These criteria appear in a campaign only when
> you explicitly do something with those critieria (e.g. add a negative age
> range criteria, or apply a bid adjustment to a specific gender).
>
> E.g. if you can't retrieve Gender criteria for a campaign, you should
> interpret it as "there's no special gender criteria for this campaign, so
> it is serving to GENDER_MALE, GENDER_FEMALE and GENDER_UNDETERMINED).
>
> Hope this helps? Let me know if you have more questions.
>
> Cheers
> Anash P. Oommen,
> AdWords API Advisor.
>
> On Saturday, December 8, 2018 at 4:07:12 PM UTC-5, Harisankar Mohanty
> wrote:
>>
>> Hello API Team,
>>
>> I am using Google Adwords API version : v201806 (PHP) to develop a web
>> app.
>>
>> I am struck somewhere to retrieve Household Income Tier for a particular
>> Campaign. Though I am getting info for criteria type 'LOCATION' but other
>> criteria type does not work for me like 'INCOME_RANGE' or 'AGE_RANGE' etc.
>> I have posted my code below. Can you please check and let me know why I am
>> not getting data for Household Income Tier when I use criteria type
>> 'INCOME_RANGE' ?
>>
>> public static function runExample (
>>         AdWordsServices $adWordsServices,
>>         //AdWordsSession $session
>>         AdWordsSessionBuilder $sessionBuilder,
>>         $customerId, $campaignId = null, $locationIds = null,
>> $criteriaType = null
>>     ) {
>>
>>         $session =
>> $sessionBuilder->withClientCustomerId($customerId)->build();
>>         $campaignCriterionService = $adWordsServices->get($session,
>> CampaignCriterionService::class);
>>
>>         $selector = new Selector();
>>
>> $selector->setFields(array('Id','CampaignId','MatchingFunction','LocationName','Address'));
>>         $predicates[] = new Predicate('CampaignId',
>> PredicateOperator::IN, array($campaignId));
>>         //$predicates[] = new Predicate('CriteriaType',
>> PredicateOperator::IN,  array('AD_GROUPS'));
>> $predicates[] = new Predicate('CriteriaType', PredicateOperator::IN,
>> array($criteriaType));
>>
>>         $selector->setPredicates($predicates);
>>
>>         $startIndex = 0;
>>
>>         $selector->setPaging(new Paging($startIndex, 10));
>> echo "<pre>";
>> print_r($selector);
>>
>>         do {
>>             // Make the get request.
>>             $page = $campaignCriterionService->get($selector);
>>
>>     echo "<pre>";
>>     print_r($page);
>>     die();
>>
>>             // Display results.
>>             if (!empty($page->getEntries())) {
>>                     //return $page->entries;
>>                 $return['data'] = $page->getEntries();
>>
>>
>>
>>               foreach ($page->getEntries() as $campaignCriterion) {
>>
>>
>> if(in_array($campaignCriterion->getCriterion()->matchingFunction->rhsOperand[0]->locations[0],
>> $locationIds)) {
>>
>> $locations[$campaignCriterion->criterion->id]['location'] =
>> $campaignCriterion->criterion->matchingFunction->rhsOperand[0]->locations[0];
>>
>> $locations[$campaignCriterion->criterion->id]['tier'] =
>> $campaignCriterion->criterion->matchingFunction->lhsOperand[0]->tier;
>>                     }
>>               }
>>
>>             } else {
>>               //print "No campaign targeting criteria were found.\n";
>>               $locations = false;
>>             }
>>             //$return['locations'] = array_unique($locations);
>>             //return $locations;
>>
>>             // Advance the paging index.
>>             $startIndex += 10;
>>             $selector->getPaging()->setStartIndex($startIndex);
>> } while ($page->totalNumEntries >
>> $selector->getPaging()->getStartIndex());
>>
>>        return $locations;
>>
>>
>>     }
>>
> --
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog:
> https://googleadsdeveloper.blogspot.com/
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>
> You received this message because you are subscribed to the Google
> Groups "AdWords API and Google Ads 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 a topic in the
> Google Groups "AdWords API and Google Ads API Forum" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/adwords-api/0Owk0Zp02Ps/unsubscribe.
> To unsubscribe from this group and all its topics, 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/0ae9894b-fc57-4df3-a6ca-888a289ac01d%40googlegroups.com
> <https://groups.google.com/d/msgid/adwords-api/0ae9894b-fc57-4df3-a6ca-888a289ac01d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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 and Google Ads 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/CAEtqvQJzXdPLjqt-Qm9t90fyOsDSecPRv7mS6cME%3DisH6mmVpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Harisankar Mohanty
    • ... 'Dannison Yao (AdWords API Team)' via AdWords API and Google Ads API Forum
    • ... 'Anash P. Oommen (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... Harisankar Mohanty
        • ... 'Anash P. Oommen (AdWords API Team)' via AdWords API and Google Ads API Forum
          • ... Harisankar Mohanty
            • ... Harisankar Mohanty

Reply via email to