How to set "Pay for Conversions" through the API?

27 views
Skip to first unread message

Dennis Koschig

unread,
Aug 28, 2019, 6:04:49 AM8/28/19
to AdWords API and Google Ads API Forum
Hello, how can i manipulate the following setting "Bezahlen für" / "Pay for"  through the API?

pay for conversions.png














Currently, Campaigns are created with "Pay for Clicks" but i want to change this to "Pay for Conversion" through GoogleAds API Code (php).

The Code currently looks like this:

    switch ($opt_target) {
      case FeedObj::OPT_TARGET_CLICKS:
        $bidding_strategy_configuration = new BiddingStrategyConfiguration();
        $bidding_strategy_configuration->setBiddingStrategyType(
          BiddingStrategyType::MANUAL_CPC
        );
        $bidding_scheme = new ManualCpcBiddingScheme();
        $bidding_strategy_configuration->setBiddingScheme($bidding_scheme);
        $campaign->setBiddingStrategyConfiguration($bidding_strategy_configuration);
        break;
      case FeedObj::OPT_TARGET_CONVERSIONS:
        //@todo: can we do something to select "pay for conversions" ?
        // Set bidding strategy: Target CPA
        $bidding_scheme = new TargetCpaBiddingScheme();
        $money = new Money();
        $money->setMicroAmount($mysterious_micro_amount);
        $bidding_scheme->setTargetCpa($money);
        $bidding_strategy_configuration = new BiddingStrategyConfiguration();
        $bidding_strategy_configuration->setBiddingScheme($bidding_scheme);
        $campaign->setBiddingStrategyConfiguration($bidding_strategy_configuration);
        break;
    }

How can i accomplish this? Which Objects/Attributes/Constants are needed to create Campaigns with "Pay for Conversions" instead of "Pay for Clicks"?

Reply all
Reply to author
Forward
0 new messages