Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Toggle Cloak
Example: Bonsai tree for bid pricing

Cloak

Lines beginning with # are comments to help you understand the logic of this tree.

pytrue

Step 3. Encode Your Decision Tree

...

Toggle Cloak
Example: Base64-encoded

Cloak
text

Step 4. Check Your Decision Tree for Errors

...

Toggle Cloak
 Example: JSON file containing your base64-encoded tree

Cloak
js

Toggle Cloak
 Example: POST to the custom-model-parser service

Cloak
js

Step 5. Add Your Decision Tree as a Custom Model

...

Toggle Cloak
Example: JSON file defining your custom model

Cloak
js

Toggle Cloak
Example: POST to custom-model service

Cloak
js

Step 6. Assign Your Custom Model to a Campaign

...

Cloak


Use the  to assign your custom model to a campaign. Be sure to:

  • Set cpm_bid_type to "custom_model".
  • Provide the id of your custom model in the bid_model object. 
  • Set inventory_type to "real_time"
     
jsJSON file defining your campaignjsPOST to campaign service

Toggle Cloak
 Using the UI

Cloak


When you set up your campaign in Console, set your Buying Strategy as follows:

  1. Check Buy Third-Party Inventory.

    Make sure that Buy Direct Inventory is NOT checked; custom models are supported for third-party buying only, not for direct buying.

  2. Check Pay on a Per-impression (CPM) basis.
  3. Select Custom Model from the drop-down.
  4. Choose the relevant model.

...

Cloak


Use the  to assign your custom model to a campaign. Be sure to:

  • Set cpm_bid_type to an optimization-based buying strategy ("predicted" or "margin") and any corresponding required fields. 
    • In the JSON below, for example, we set cpm_bid_type to "predicted" and cpc_click_goal to 1.00 to optimize CPM bids to a predicted $1.00 CPC goal.
  • In the bid_modifier_model object, provide the id of the custom model that will modify the campaign's CPM bids. 
  • Set inventory_type to "real_time"
     
jsJSON file defining your campaignjsPOST to campaign service

Toggle Cloak
 Using the UI

Cloak


When you set up your campaign in Console, set your Buying Strategy as follows:

  1. Check Buy Third-Party Inventory.

    Make sure that Buy Direct Inventory is NOT checked; custom models are supported for third-party buying only, not for direct buying.

  2. Check Pay on a Per-impression (CPM) basis.
  3. Select an AppNexus optimization-based buying strategy such as "Optimize to a predicted CPA Goal" or "Optimize to a predicted CPC Goal" and enter the corresponding required fields. 
    • In the example below, we've selected Optimize to a predicted CPC goal and set $1.00 as the goal to optimize to.
  4. Click Optimization Levers.
  5. In the Optimization Levers dialog:
    1. Select Bid Modifier Model.
    2. Choose the custom model that will modify the campaign's optimization-based CPM bids.
    3. Click Add.

...