Create your script
- If you have partner-level access: You can create the script at either the partner or advertiser level, allowing the algorithm to be shared with multiple advertisers.
- If you only have advertiser access: You can only create scripts at the advertiser level. The corresponding algorithm will only be associated with the advertiser it's created in.
- Navigate to your Partner or Advertiser.
- Expand Resources Custom Bidding in the left menu.
- Choose New Algorithm.
- Enter a name for your custom bid.
- Select your objective. The objective you choose determines which rules can be selected. Choose Custom then select Use script to define which impressions are most valuable for your campaign.
Write your script
To learn more about custom bidding script syntax and for samples, go to Custom bidding script reference.
You can search for linked attributes when writing a custom bidding script:
- In the New script window, expand Script tools.
Note: If you're creating your script at the partner level, next Choose an advertiser.
- Choose one of the following categories:
- Attribution models
- Floodlight activities
- U-Variables
- (Optional) Use the search bar to search for a specific attribute.
- Select the copy and paste icon next to the attribute.
- Paste the metadata to your script.
- (Optional) Select Check syntax to review syntax issues with your script.
Test your script
Before you create your custom bidding script, you can test your algorithm to generate a chart that shows the distribution of scores for your chosen impressions. You can use this data to test your script's performance and check if it performs as expected.
Sample scenario
For example:
You can test a weighted conversion script to check the potential outcome of using different weight values and revise the script to optimize your results.
To test your script:
- From the drop-down menu, choose an advertiser.
- You must link an advertiser to the algorithm to see them in the list.
- The advertiser must meet custom bidding data requirements.
- Under Sample type, choose how impressions are sampled:
- All impressions: Recommended to understand overall expected distribution of impression values.
- Only impressions with clicks: Useful if clicks are central to the script.
- Only impressions with conversions: Useful if conversions central to the script. This sample includes all conversion events in your advertiser and will be based off the default attribution model
You can test your algorithm using a random sample of 10 000 impressions from eligible impressions. You can review the following results:
- The number of impressions in the sample: The number of sampled impressions included in the results.
- Impression value/cost: The impression value/cost for the sampled impressions.
Note: Included in the results only when using all impressions as the sample type.
- Percentage of execution errors: The percentage of sampled impressions that returned an error after testing the script.
- Percentage impressions scored: The percentage of sampled impressions successfully scored.
- Percentage of positive impressions scored: The percentage of sampled impressions successfully scored with a score over 0.
You can download a .csv file to view the details of individual values in the results.
When you're done, choose Create.
After you create your script, it requires time to process. It may take 20 mins before it's available. When it's available, you can view your script from the script list.
Get started with a campaign
- (Recommended) Set up an A/B experiment. Your custom bidding algorithm can be the experiment that you test against a control. If your custom bidding model isn't ready yet, you can use a placeholder bid strategy and come back later to update.
- In the Insertion Order Details tab for each of your custom bidding test insertion orders, you can select: Optimization Automate bid & budget at insertion order level Custom bidding [your custom bidding algorithm]
- The system will automatically adjust the insertion order's bids for the highest impression value (determined by your algorithm). Spending your full budget will be prioritized.
- Alternatively, In the Line Item Details tab for each of your custom bidding test line items, you can select: Bid strategy Automated Bidding Custom bidding [your custom bidding algorithm]
- The system can automatically adjust your line item's bids for:
- The highest impression value (determined by your algorithm). Spending your full budget will be prioritized.
- A target value or cost that you set.
- The system can automatically adjust your line item's bids for: