Re: How to add/set Income Tier of a particular Location

2016-12-19 Thread 'Anthony Madrigal' via AdWords API Forum
Hello Sachin,

Could you please send me your SOAP request and response that resulted in 
this error through *reply privately to author*? 

Thanks,
Anthony
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/d4affb6c-d0e8-4851-8552-d2205f963745%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to add/set Income Tier of a particular Location

2016-12-19 Thread Sachin Kumar
Hello Team,

I want to add/set particular "location's Income Tier". To achieve this I am 
using this code:

// Get the service, which loads the required classes.

$clientId = (float) $clientid; //correct Client Id
$campaignId = (float) $campaignId; // correct campaignId
$location = (float) $location; // Correct locationId
$tier = 'TIER_1';
   


$user->SetClientCustomerId($clientId);
$campaignCriterionService = 
$user->GetService('CampaignCriterionService', ADWORDS_VERSION);

$campaignCriteria = array();


// Location Groups criteria. These represent targeting by household 
income
// or places of interest. The IDs can be found in the documentation 
or
// retrieved with the LocationCriterionService.

// Tiers are numbered 1-10, and represent 10% segments of earners.
// For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc.
// Tiers 6 through 10 are grouped into TIER_6_TO_10.
// Other valid options: AIRPORT, UNIVERSITY.
$tier = new IncomeOperand($tier);
$Loc = new GeoTargetOperand(array($location)); // Miami, FL
$firstGroup = new LocationGroups();
$firstGroup->matchingFunction = new FeedFunction('AND', $tier, 
$Loc);
$campaignCriteria[] = new CampaignCriterion($campaignId, null, 
$firstGroup);
/*
if ($locationFeedId !== null) {
// Distance targeting. Area of 10 miles around targets above.
$radius = new ConstantOperand();
$radius->type = 'DOUBLE';
$radius->unit = 'MILES';
$radius->doubleValue = 10.0;
$distance = new LocationExtensionOperand($radius);
$secondGroup = new LocationGroups();
$secondGroup->feedId = intval($locationFeedId);
$secondGroup->matchingFunction = new FeedFunction('IDENTITY', 
$distance);
$campaignCriteria[] =
new CampaignCriterion($campaignId, null, $secondGroup);
}
*/
// Create operations.
$operations = array();
foreach ($campaignCriteria as $campaignCriterion) {
/* echo '';
print_r($campaignCriterion);die(); */

$operations[] = new 
CampaignCriterionOperation($campaignCriterion, 'ADD');
}

/* // Add a negative campaign criterion.
$negativeKeyword = new Keyword();
$negativeKeyword->text = 'jupiter cruise';
$negativeKeyword->matchType = 'BROAD';
$negativeCriterion = new NegativeCampaignCriterion();
$negativeCriterion->campaignId = $campaignId;
$negativeCriterion->criterion = $negativeKeyword; 

$operations[] = new CampaignCriterionOperation($negativeCriterion, 
'ADD');
*/


// Make the mutate request.
return $result = $campaignCriterionService->mutate($operations);


But this code giving me following error: 


Fatal error:  Uncaught SoapFault exception: [soap:Server] 
[CriterionError.CANNOT_TARGET_CRITERION
 @ operations[0].operand.criterion.matchingFunction] in 
/home/bergstromdev/public_html/Google/Api/Ads
/Common/Lib/AdsSoapClient.php:216

I am not getting what it means and how to resolve this?

Please reply & guide me asap to resolve this error.


Thanks & Regards
Sachin Kumar

 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/fb0e01cb-e4e1-4986-8b77-53d1e5c4dbab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.