INVALID_PRODUCT_DIMENSION_TYPE When Adding CampaignCriterion To A Shopping Campaign

21 views
Skip to first unread message

Pete Lavetsky (AdWords API Guru)

unread,
Dec 11, 2018, 4:25:34 PM12/11/18
to AdWords API and Google Ads API Forum
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: 


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

Peter Oliquino (AdWords API Team)

unread,
Dec 11, 2018, 5:39:26 PM12/11/18
to AdWords API and Google Ads API Forum
Hi Pete,

The CriterionError.INVALID_PRODUCT_DIMENSION_TYPE error occurred because you were trying to set a ProductCanonicalCondition to your Search campaign (1459829022). Please note that ProductCanonicalCondition is only supported by campaigns of Shopping type.

Best regards,
Peter
AdWords API Team

Pete Lavetsky (AdWords API Guru)

unread,
Dec 11, 2018, 6:09:59 PM12/11/18
to AdWords API and Google Ads API Forum
Peter,

D'oh! 

I was testing the ProductScope stuff on a Campaign I had previously added under a different context.

Thanks for clearing that up for me, and for the prompt response.

Pete
Reply all
Reply to author
Forward
0 new messages