I am not a PHP expert but let's see what I can do to help. Seeing your code snippet, it looks like the
campaignId and the
matchingFunction are not included in the selector. Please include them and after that, for each campaignCriterion iteration, you need to cast them to a
LocationGroups object. Once you have the LocationGroups object, you can now have the array of
FunctionArgumentOperand which can be of type
IncomeOperand (i.e. locationGroups => matchingFunction => lhsOperand
and locationGroups => matchingFunction => rhsOperand). This way, you can get the income tier. The SOAP request and response should be something like this:
<soapenv:Header>
<ns1:clientCustomerId>YOUR_CLIENT_CUSTOMER_ID</ns1:clientCustomerId>
<ns1:developerToken>YOUR_DEVELOPER_TOKEN</ns1:developerToken>
<ns1:userAgent>YOUR_USER_AGENT</ns1:userAgent>
<ns1:validateOnly>false</ns1:validateOnly>
<ns1:partialFailure>false</ns1:partialFailure>
</ns1:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<serviceSelector>
<fields>CampaignId</fields>
<fields>Id</fields>
<fields>CriteriaType</fields>
<fields>MatchingFunction</fields>
<predicates>
<field>CriteriaType</field>
<operator>IN</operator>
<values>LOCATION_GROUPS</values>
</predicates>
<predicates>
<field>CampaignId</field>
<operator>EQUALS</operator>
<values>YOUR_CAMPAIGN_ID</values>
</predicates>
<paging>
<startIndex>0</startIndex>
<numberResults>100</numberResults>
</paging>
</serviceSelector>
</get>
</soapenv:Body>
</soapenv:Envelope>
[main] INFO com.google.api.ads.adwords.lib.client.AdWordsServiceClient.soapXmlLogger - SOAP Response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Header>
<requestId>xxxxxxxxxxxxxxxxxx</requestId>
<serviceName>CampaignCriterionService</serviceName>
<methodName>get</methodName>
<operations>1</operations>
<responseTime>223</responseTime>
</ResponseHeader>
</soap:Header>
<soap:Body>
<rval>
<totalNumEntries>1</totalNumEntries>
<Page.Type>CampaignCriterionPage</Page.Type>
<entries>
<campaignId>CAMPAIGN_ID</campaignId>
<isNegative>false</isNegative>
<id>CRITERIA_ID</id>
<type>LOCATION_GROUPS</type>
<Criterion.Type>LocationGroups</Criterion.Type>
<matchingFunction>
<operator>AND</operator>
<lhsOperand xsi:type="IncomeOperand">
<FunctionArgumentOperand.Type>IncomeOperand</FunctionArgumentOperand.Type>
<tier>TIER_6_TO_10</tier>
</lhsOperand>
<rhsOperand xsi:type="GeoTargetOperand">
<FunctionArgumentOperand.Type>GeoTargetOperand</FunctionArgumentOperand.Type>
<locations>TARGET_LOCATION_ID</locations>
</rhsOperand>
<functionString>AND()</functionString>
</matchingFunction>
</criterion>
<CampaignCriterion.Type>CampaignCriterion</CampaignCriterion.Type>
</entries>
</rval>
</getResponse>
</soap:Body>
</soap:Envelope>
Hope this helps.