Hi Pete, The CriterionError.INVALID_PRODUCT_DIMENSION_TYPE <https://developers.google.com/adwords/api/docs/reference/v201806/TargetingIdeaService.CriterionError.Reason#INVALID_PRODUCT_DIMENSION_TYPE> error occurred because you were trying to set a ProductCanonicalCondition <https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupCriterionService.ProductCanonicalCondition> to your Search campaign (1459829022). Please note that ProductCanonicalCondition is only supported by campaigns of Shopping type.
Best regards, Peter AdWords API Team On Wednesday, December 12, 2018 at 5:25:34 AM UTC+8, Pete Lavetsky (AdWords API Guru) wrote: > > Hi All, > > I am getting a CriterionError.INVALID_PRODUCT_DIMENSION_TYPE when > attempting to add any product dimension other than ProductBrand to a > ProductScope. After running into the error with my own code I tried with > the github samples provided for Shopping Campaigns as located here: > > > https://github.com/googleads/googleads-java-lib/blob/bbee9d8414c4f93605abd8434519555c89531513/examples/adwords_axis/src/main/java/adwords/axis/v201809/shoppingcampaigns/AddProductScope.java > > Aside from credentials, my code is identical to line 144 -> 192 of the > above sample file. > > I've attached the entirety of the SOAP request / response aside from > credentials here: > > <soapenv:Body> > > <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201809"> > > <operations> > > <operator>ADD</operator> > > <operand> > > <campaignId>1459829022</campaignId> > > <criterion xmlns:ns2=" > https://adwords.google.com/api/adwords/cm/v201809" > xsi:type="ns2:ProductScope"> > > <ns2:dimensions xsi:type="ns2:ProductBrand"> > > <ns2:value>Nexus</ns2:value> > > </ns2:dimensions> > > <ns2:dimensions > xsi:type="ns2:ProductCanonicalCondition"> > > <ns2:condition>NEW</ns2:condition> > > </ns2:dimensions> > > <ns2:dimensions > xsi:type="ns2:ProductCustomAttribute"> > > <ns2:type>CUSTOM_ATTRIBUTE_0</ns2:type> > > <ns2:value>my attribute value</ns2:value> > > </ns2:dimensions> > > <ns2:dimensions xsi:type="ns2:ProductOfferId"> > > <ns2:value>book1</ns2:value> > > </ns2:dimensions> > > <ns2:dimensions xsi:type="ns2:ProductType"> > > <ns2:type>PRODUCT_TYPE_L1</ns2:type> > > <ns2:value>Media</ns2:value> > > </ns2:dimensions> > > <ns2:dimensions xsi:type="ns2:ProductType"> > > <ns2:type>PRODUCT_TYPE_L2</ns2:type> > > <ns2:value>Books</ns2:value> > > </ns2:dimensions> > > <ns2:dimensions > xsi:type="ns2:ProductBiddingCategory"> > > <ns2:type>BIDDING_CATEGORY_L1</ns2:type> > > <ns2:value>-5914235892932915235</ns2:value> > > </ns2:dimensions> > > </criterion> > > </operand> > > </operations> > > </mutate> > > </soapenv:Body> > > > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> > > <soap:Header> > > <ResponseHeader xmlns=" > https://adwords.google.com/api/adwords/cm/v201809"> > > <requestId>00057cc58fa6a9380a3712291e047c08</requestId> > > <serviceName>CampaignCriterionService</serviceName> > > <methodName>mutate</methodName> > > <operations>1</operations> > > <responseTime>151</responseTime> > > </ResponseHeader> > > </soap:Header> > > <soap:Body> > > <soap:Fault> > > <faultcode>soap:Client</faultcode> > > <faultstring>[CriterionError.INVALID_PRODUCT_DIMENSION_TYPE @ > operations[0].operand.criterion.dimensions; > trigger:'CANONICAL_CONDITION']</faultstring> > > <detail> > > <ApiExceptionFault xmlns=" > https://adwords.google.com/api/adwords/cm/v201809"> > > <message>[CriterionError.INVALID_PRODUCT_DIMENSION_TYPE > @ operations[0].operand.criterion.dimensions; > trigger:'CANONICAL_CONDITION']</message> > > > <ApplicationException.Type>ApiException</ApplicationException.Type> > > <errors xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" xsi:type="CriterionError"> > > > <fieldPath>operations[0].operand.criterion.dimensions</fieldPath> > > <fieldPathElements> > > <field>operations</field> > > <index>0</index> > > </fieldPathElements> > > <fieldPathElements> > > <field>operand</field> > > </fieldPathElements> > > <fieldPathElements> > > <field>criterion</field> > > </fieldPathElements> > > <fieldPathElements> > > <field>dimensions</field> > > </fieldPathElements> > > <trigger>CANONICAL_CONDITION</trigger> > > > <errorString>CriterionError.INVALID_PRODUCT_DIMENSION_TYPE</errorString> > > <ApiError.Type>CriterionError</ApiError.Type> > > <reason>INVALID_PRODUCT_DIMENSION_TYPE</reason> > > </errors> > > </ApiExceptionFault> > > </detail> > > </soap:Fault> > > </soap:Body> > > </soap:Envelope> > > > Any help would be appreciated > > > Thanks > > Pete > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/ce6ae83d-b51e-41e1-b8f0-9527890fe4b1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.