I have created google adCampaigns, adGroups, Keywords, Ads, Locations using Google Adwords API but I am not able to set "Set a maximum cost per click bid limit" using api

I have used this code to set but it's not getting set

       $operations = [];         // Create ad group with the specified ID.         $groupId = $adGroup->getId();         $adGroupNew = new AdGroup();         $adGroupNew->setId($groupId);         $cpcBidMicroAmount = intval($_GET['cpc']) * 1000000;         // Update the CPC bid if specified.         if (!is_null($cpcBidMicroAmount)) {             $bid = new CpcBid();             $money = new Money();             $money->setMicroAmount($cpcBidMicroAmount);             $bid->setBid($money);             $biddingStrategyConfiguration = new BiddingStrategyConfiguration();             $biddingStrategyConfiguration->setBids([$bid]);             $adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration);         }         // Create ad group operation and add it to the list.         $operation = new AdGroupOperation();         $operation->setOperand($adGroupNew);         $operation->setOperator(Operator::SET);         $operations[] = $operation;         // Update the ad group on the server.         $adGroupService->mutate($operations); 

Tag:google-ads-api

Only one comment.

  1. Asif Saeed
    $biddingScheme = new TargetSpendBiddingScheme(); $bidCeiling = new Money(); $bidCeiling->setMicroAmount($_GET['cpc'] * 1000000); $biddingScheme->setBidCeiling($bidCeiling); $spendTarget = new Money(); $spendTarget->setMicroAmount($_GET['cpc'] * 1000000); $biddingScheme->setSpendTarget($spendTarget);

    Do this at Campaign Level to set Bid Max Limit

Add a new comment.