I checked creation of intent, and got successful response: Array
( [0] => Array ( [Id] => 2610756 [Status] => ENABLED [Name] => Test Custom Audience 3 [Type] => CUSTOM_INTENT [Description] => Test Custom Audience 3 created at 08:57:48 26:06:2018 [Tokens] => Array ( [0] => Array ( [CustomAffinityId] => 2610756 [CustomAffinityTokenId] => 22592718 [TokenType] => URL [Parameter] => rere.com ) ) ) ) I tried use CustomAffinityService with next values: [['AdGroupId' => ***, 'CustomIntentId' => 2610756]]; Where CustomIntentId is id from first query response. $operations looks like this after I set all values im method which I attached in prev post: Array ( [0] => Google\AdsApi\AdWords\v201806\cm\AdGroupCriterionOperation Object ( [operand:protected] => Google\AdsApi\AdWords\v201806\cm\AdGroupCriterion Object ( [adGroupId:protected] => *** [criterionUse:protected] => [criterion:protected] => Google\AdsApi\AdWords\v201806\cm\CriterionCustomIntent Object ( [customIntentId:protected] => 2610756 [id:protected] => [type:protected] => [CriterionType:protected] => CUSTOM_INTENT [parameterMap:Google\AdsApi\AdWords\v201806\cm\Criterion:private] => Array ( [Criterion.Type] => CriterionType ) ) [labels:protected] => [forwardCompatibilityMap:protected] => [baseCampaignId:protected] => [baseAdGroupId:protected] => [AdGroupCriterionType:protected] => [parameterMap:Google\AdsApi\AdWords\v201806\cm\AdGroupCriterion:private] => Array ( [AdGroupCriterion.Type] => AdGroupCriterionType ) ) [exemptionRequests:protected] => [operator:protected] => ADD [OperationType:protected] => [parameterMap:Google\AdsApi\AdWords\v201806\cm\Operation:private] => Array ( [Operation.Type] => OperationType ) ) ) Thanks, Danny. On Tuesday, June 26, 2018 at 6:42:56 PM UTC+3, Nadine Sundquist (AdWords API Team) wrote: > > Hello Danny, > > That first error that you have with the REQUIRED is actually coming from > CustomAffinityService. This is when you are creating your audience. It's > saying that a name > <https://developers.google.com/adwords/api/docs/reference/v201806/CustomAffinityService.CustomAffinity#name> > is > required. So, it looks like that call to create your custom affinity > audience failed due to that. Please make sure to specify a name. > > The reason the second may be empty is because it looks like your first > call to make the audience failed. Could you double-check to make sure that > your first call really is successful and then try the second one again? > > Thanks, > Nadine, AdWords API Team > > On Tuesday, June 26, 2018 at 9:23:51 AM UTC-4, danny+...@pdffiller.com > <javascript:> wrote: >> >> Hi Nadine! >> >> Thank you, I successfully created Custom Intent due to your manual, but >> now have trouble how to link Intent to AdGroup if I have IntentID and >> AdGroup ID? >> >> My way with error: >> >> $operations = []; >> >> foreach ($data as $item) { >> if (!isset($item['AdGroupId'])) { >> throw new AdWordsClientException('AdGroupId is not set'); >> } >> if (!isset($item['CustomIntentId'])) { >> throw new AdWordsClientException('CustomIntentId is not set'); >> } >> >> $userListCriterion = new CriterionCustomIntent(); >> $userListCriterion->setCustomIntentId($item['CustomIntentId']); >> >> $adGroupCriterion = new BiddableAdGroupCriterion(); >> $adGroupCriterion->setAdGroupId($item['AdGroupId']); >> $adGroupCriterion->setCriterion($userListCriterion); >> >> $operations[] = new CustomAffinityOperation(Operator::ADD, null, >> $adGroupCriterion); >> } >> >> return $this->mutateOperations($operations); >> >> >> Produces error: >> >> <soap:Envelope >> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ns2:ResponseHeader >> >> xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201806" xmlns=" >> https://adwords.google.com/api/adwords/cm/v201806"><requestId>00056f8b200ebf800a81ed01ae020b82</requestId><serviceName>CustomAffinityService</serviceName><methodName>mutate</methodName><operations>1</operations><responseTime>586</responseTime></ns2:ResponseHeader></soap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>[RequiredError.REQUIRED >> >> @ operations[0].operand.name]</faultstring><detail><ns2:ApiExceptionFault >> xmlns="https://adwords.google.com/api/adwords/cm/v201806" xmlns:ns2=" >> https://adwords.google.com/api/adwords/rm/v201806"><message>[RequiredError.REQUIRED >> >> @ >> operations[0].operand.name]</message><ApplicationException.Type>ApiException</ApplicationException.Type><errors >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:type="RequiredError"><fieldPath>operations[0].operand.name >> </fieldPath><fieldPathElements><field>operations</field><index>0</index></fieldPathElements><fieldPathElements><field>operand</field></fieldPathElements><fieldPathElements><field>name</field></fieldPathElements><trigger></trigger><errorString>RequiredError.REQUIRED</errorString><ApiError.Type>RequiredError</ApiError.Type><reason>REQUIRED</reason></errors></ns2:ApiExceptionFault></detail></soap:Fault></soap:Body></soap:Envelope> >> >> But sent SOAP looks little bit strange with no data except operation type: >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <SOAP-ENV:Envelope xmlns:SOAP-ENV=" >> http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1=" >> https://adwords.google.com/api/adwords/cm/v201806" xmlns:ns2=" >> https://adwords.google.com/api/adwords/rm/v201806"><SOAP-ENV:Header><ns2:RequestHeader><ns1:clientCustomerId>***</ns1:clientCustomerId><ns1:developerToken>REDACTED</ns1:developerToken><ns1:userAgent>unknown >> >> (AwApi-PHP, googleads-php-lib/35.2.0, PHP/5.6.31-1~ubuntu14.04.1+ >> deb.sury.org >> +1)</ns1:userAgent><ns1:validateOnly>false</ns1:validateOnly><ns1:partialFailure>false</ns1:partialFailure></ns2:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns2:mutate><ns2:operations><ns1:operator>ADD</ns1:operator><ns2:operand/></ns2:operations></ns2:mutate></SOAP-ENV:Body></SOAP-ENV:Envelope> >> >> On Tuesday, June 26, 2018 at 12:43:23 AM UTC+3, Nadine Sundquist (AdWords >> API Team) wrote: >>> >>> Hello Danny, >>> >>> There was a new service introduced in v201806 called >>> CustomAffinityService >>> <https://developers.google.com/adwords/api/docs/reference/v201806/CustomAffinityService>. >>> >>> If you already have custom audiences in your account, then you'll see them >>> there. You can use the ID from those. You can also create audiences using >>> the CustomAffinityService. In that service, you'll get back two types >>> of audiences >>> <https://developers.google.com/adwords/api/docs/reference/v201806/CustomAffinityService.CustomAffinity#type>, >>> >>> *CUSTOM_INTENT* and *CUSTOM_AFFINITY*. You'll want to use the >>> *CUSTOM_INTENT* one for a CriterionCustomIntent. >>> >>> Cheers, >>> Nadine, AdWords API Team >>> >>> On Monday, June 25, 2018 at 3:41:13 AM UTC-4, danny+...@pdffiller.com >>> wrote: >>>> >>>> Yes. Error with ExpressionRuleUserList was that in including files >>>> part I had different library versions for classes. It produced incorrect >>>> SOAP request. But after execution code I understood that it was not what I >>>> needed. I need a CriterionCustomIntent >>>> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.CriterionCustomIntent> >>>> to >>>> create audience for users, who visited domains, which I need add to intent >>>> list as keywords. >>>> Type of that audience in UI is 'Custom intent audience'. >>>> >>>> Unfortunately I found no examples how to use CriterionCustomIntent >>>> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.CriterionCustomIntent> >>>> . >>>> >>>> On Monday, June 25, 2018 at 8:24:53 AM UTC+3, Peter Oliquino (AdWords >>>> API Team) wrote: >>>>> >>>>> Hi Danny, >>>>> >>>>> Could you first confirm if you no longer have any issues with the >>>>> ExpressionRuleUserList ADD request, and that what originally intended was >>>>> to create a CriterionCustomIntent >>>>> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.CriterionCustomIntent> >>>>> as >>>>> a BiddableAdGroupCriterion >>>>> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.BiddableAdGroupCriterion> >>>>> ? >>>>> >>>>> Thanks and regards, >>>>> Peter >>>>> AdWords API Team >>>>> >>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 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 and Google Ads 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/cbd8f003-bf51-46b7-89d6-52037c7e8910%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.