PageOnePromotedBiddingScheme

23 views
Skip to first unread message

Mélanie Macias

unread,
Sep 17, 2019, 7:06:47 PM9/17/19
to AdWords API and Google Ads API Forum
Hi,
I'm getting the ERROR --> [RequestError.UNSUPPORTED_TYPE_IS_USED @ operations[0].operand.type; trigger:'PAGE_ONE_PROMOTED']
This is my PHP code for creating a campaing with PageOnePromotedBidding

private static function createBiddingStrategy(
        AdWordsServices $adWordsServices,
        AdWordsSession $session
        ) {
            $biddingStrategyService = $adWordsServices->get($session, BiddingStrategyService::class);
            
            // Create a portfolio bidding strategy.
            $biddingStrategy = new SharedBiddingStrategy();
            $biddingStrategy->setName("Maximize Clicks " . uniqid());
            $biddingStrategy->setType(PAGE_ONE_PROMOTED);
            

            $biddingScheme = new PageOnePromotedBiddingScheme();
            // Optionally set additional bidding scheme parameters.
            $bidCeiling = new Money();
            $bidCeiling->setMicroAmount(2000000);
            $biddingScheme->setBidCeiling($bidCeiling);
            
            $biddingScheme->setStrategyGoal(PageOnePromotedBiddingSchemeStrategyGoal::PAGE_ONE_PROMOTED);
            $biddingScheme->setBidModifier(1);
            
            $biddingStrategy->setBiddingScheme($biddingScheme);
            
            // Create the bidding strategy operation.
            $operation = new BiddingStrategyOperation();
            $operation->setOperator(Operator::ADD);
            $operation->setOperand($biddingStrategy);
            
            $result = $biddingStrategyService->mutate([$operation]);
            $newBiddingStrategy = $result->getValue()[0];
            printf(
                "Portfolio bidding strategy with name '%s' and ID %d of type %s was created.\n",
                $newBiddingStrategy->getName(),
                $newBiddingStrategy->getId(),
                $newBiddingStrategy->getType()
                );
            
            return $newBiddingStrategy;
    }

Can somebody help me???

Google Ads API Forum Advisor Prod

unread,
Sep 17, 2019, 11:35:33 PM9/17/19
to adwor...@googlegroups.com
Hi Mélanie,

Thank you for reaching out to our team.

Could you try something similar to the one below, as seen in the (highlighted) PHP version of the Add Campaigns example :

// Set bidding strategy (required).
$biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$biddingStrategyConfiguration->setBiddingStrategyType( BiddingStrategyType::MANUAL_CPC );


and change yours to : $biddingStrategy->setType( BiddingStrategyType::PAGE_ONE_PROMOTED )

Should the issue persist, and since this appears to be more of a PHP client library implementation concern, you may reach out to the PHP client library owners via this link as they are better equipped to assist you regarding this matter.

I hope this helps.

Best regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UHH8Fz:ref
Reply all
Reply to author
Forward
0 new messages