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:
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.
Check Pay on a Per-impression (CPM)basis.
Select Custom Model from the drop-down.
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 Strategyas follows:
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.
Check Pay on a Per-impression (CPM) basis.
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.
Click Optimization Levers.
In the Optimization Levers dialog:
Select Bid Modifier Model.
Choose the custom model that will modify the campaign's optimization-based CPM bids.