Issue with AdServingOptimizationStatus migration in v201710

121 views
Skip to first unread message

Declan Keane

unread,
Feb 6, 2018, 3:54:25 PM2/6/18
to AdWords API Forum
Hi, 
just a few comments on the migration to v201710.

I upgraded recently. I see there "AdServingOptimizationStatus" should cause a CANNOT_SET_AD_ROTATION_MODE error if you are still setting it on Campaign level based on the migration guide: https://developers.google.com/adwords/api/docs/guides/migration/v201710

However, if you create a campaign without setting the AdServingOptimizationStatus, the campaign object returned by Adwords API contains this AdServingOptimizationStatus parameter, and its value is "null".

When I then tried to update this created campaign, the CANNOT_SET_AD_ROTATION_MODE error appears due to the campaign object now having an AdServingOptimizationStatus parameter. There is no way to remove this parameter from the object then, as adServingOptimizationStatus is a private variable in Google\AdsApi\AdWords\v201710\cm\Campaign. This inevitably causes an error, as Adwords API returned object contains a parameter that the documentation explicitly says causes an error.

For some reason I cannot understand, setting this parameter to null gets rid of this error by using the getAdServingOptimizationStatus() method. This is very strange that this would stop the error, as the adServingOptimizationStatus parameter is already null in the object.

I am using the code below suggested in the documentation ("$campaign" is a campaign object returned after creation through API.):

$campaign->setStatus(CampaignStatus::REMOVED);

$operation = new CampaignOperation();
$operation->setOperand($campaign);
$operation->setOperator(Operator::SET);
$operations[] = $operation;

$result = $campaignService->mutate($operations);

The only thing that fixes the error from the above code is adding this line at the top of the code:
$campaign->setAdServingOptimizationStatus(null);

I have tried this with multiple campaigns. It appears to be a bug.

On a related note, creating the campaign with the AdServingOptimizationStatus parameter does not seem to cause an error as the documentation suggests.

Can you confirm this is the case, or suggest what is incorrect with description above?

Regards, 
Declan

Vincent Racaza (AdWords API Team)

unread,
Feb 7, 2018, 12:43:17 AM2/7/18
to AdWords API Forum
Hi Declan,

For the adServingOptimizationStatus field, this will default to OPTIMIZE and not null based on that link under CONVERSION_OPTIMIZE. It says on the guide that "If the campaign is not in the conversion optimizer bidding strategy, it will default to OPTIMIZED.". You are correct that manually setting this will generate the CANNOT_SET_AD_ROTATION_MODE error in v201710, however, without setting this, the default value will be OPTIMIZE. This is the result on my testing.

SOAP request snippet:
<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201710">
        <operations>
            <operator>ADD</operator>
            <operand>
                <name>Sample Campaign #12345</name>
                <status>PAUSED</status>
                <startDate>20180208</startDate>
                <endDate>20180309</endDate>
                <budget>
                    <budgetId>XXXXXX</budgetId>
                </budget>
                <frequencyCap>
                    <impressions>5</impressions>
                    <timeUnit>DAY</timeUnit>
                    <level>ADGROUP</level>
                </frequencyCap>
                <settings xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201710" xsi:type="ns2:GeoTargetTypeSetting">
                    <ns2:positiveGeoTargetType>DONT_CARE</ns2:positiveGeoTargetType>
                </settings>
                <advertisingChannelType>SEARCH</advertisingChannelType>
                <networkSetting>
                    <targetGoogleSearch>true</targetGoogleSearch>
                    <targetSearchNetwork>true</targetSearchNetwork>
                    <targetContentNetwork>false</targetContentNetwork>
                    <targetPartnerSearchNetwork>false</targetPartnerSearchNetwork>
                </networkSetting>
                <biddingStrategyConfiguration>
                    <biddingStrategyType>MANUAL_CPC</biddingStrategyType>
                    <biddingScheme xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201710" xsi:type="ns3:ManualCpcBiddingScheme">
                        <ns3:enhancedCpcEnabled>false</ns3:enhancedCpcEnabled>
                    </biddingScheme>
                </biddingStrategyConfiguration>
            </operand>
        </operations>
    </mutate>

SOAP response snippet:
<mutateResponse xmlns="https://adwords.google.com/api/adwords/cm/v201710">
    <rval>
        <ListReturnValue.Type>CampaignReturnValue</ListReturnValue.Type>
        <value>
            <id>XXXXXXXXXXX</id>
            <name>Sample Campaign #12345</name>
            <status>PAUSED</status>
            <servingStatus>PENDING</servingStatus>
            <startDate>20180208</startDate>
            <endDate>20180309</endDate>
            <budget>
                <budgetId>XXXXXxx</budgetId>
                <name>Budget sample</name>
                <amount>
                    <ComparableValue.Type>Money</ComparableValue.Type>
                    <microAmount>50000000</microAmount>
                </amount>
                <deliveryMethod>STANDARD</deliveryMethod>
                <isExplicitlyShared>true</isExplicitlyShared>
                <status>ENABLED</status>
            </budget>
            <conversionOptimizerEligibility>
                <eligible>false</eligible>
                <rejectionReasons>NOT_ENOUGH_CONVERSIONS</rejectionReasons>
            </conversionOptimizerEligibility>
            <adServingOptimizationStatus>OPTIMIZE</adServingOptimizationStatus>
            <frequencyCap>
                <impressions>5</impressions>
                <timeUnit>DAY</timeUnit>
                <level>ADGROUP</level>
            </frequencyCap>
            <settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="GeoTargetTypeSetting">
                <Setting.Type>GeoTargetTypeSetting</Setting.Type>
                <positiveGeoTargetType>DONT_CARE</positiveGeoTargetType>
            </settings>
            <advertisingChannelType>SEARCH</advertisingChannelType>
            <networkSetting>
                <targetGoogleSearch>true</targetGoogleSearch>
                <targetSearchNetwork>true</targetSearchNetwork>
                <targetContentNetwork>false</targetContentNetwork>
                <targetPartnerSearchNetwork>false</targetPartnerSearchNetwork>
            </networkSetting>
            <biddingStrategyConfiguration>
                <biddingStrategyType>MANUAL_CPC</biddingStrategyType>
                <biddingScheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ManualCpcBiddingScheme">
                    <BiddingScheme.Type>ManualCpcBiddingScheme</BiddingScheme.Type>
                    <enhancedCpcEnabled>false</enhancedCpcEnabled>
                </biddingScheme>
            </biddingStrategyConfiguration>
            <campaignTrialType>BASE</campaignTrialType>
            <baseCampaignId>XXXXXXXXX</baseCampaignId>
        </value>
    </rval>
</mutateResponse>

So when I update this campaign, it does not need to manually set the adServingOptimizationStatus field to null in order for the request to be successful. I just set the status directly to REMOVE and there were no errors in my request.

However, since your scenario is different than mine, can you provide to me the SOAP request and response logs for both of your create and update campaign requests? Kindly use the Reply privately to author option when replying.

Thanks,
Vincent
AdWords API Team
Reply all
Reply to author
Forward
0 new messages