Create a Bid Model
Create a Bid Model with this in-depth tutorial using IQM's API.
The following endpoints are used to check a campaign's eligibility and create a Bid Model:
POSTGET
GET
PUT
About IQM Bid Model
The Bid Model API allows you to optimize advertising campaigns for better performance. You can fine-tune metrics such as where ads appear (Include/Exclude), manage campaign priority, and dimensions by which a campaign is subdivided.
The Bid Model comprises the following tools:
- Spend Ratio: determines how the campaign budget is distributed across various dimensions, expressed as a percentage in two types.
- Strict: budget is allocated up to its specified percentage as able, but underspends if unable to meet that ratio.
- Flexible: budget reallocates if unable to fulfill its specified percentage.
- Dimension priority: dictates the sequence of bidding for specified targeting dimensions, expressed as a range of 1-10.
- Bid Modifier: adjusts the base bid of a campaign for the specified dimension that is modified, expressed as a multiplier in a range of 0.1-100.
More resources
- Advanced modeling Help Center article
- Bid Model API guidelines
Before you begin
To create a Bid Model the following are required:
- An account on the IQM platform
- See Before you begin to create an account and request a Client ID and Client Secret
- See Sign up and authenticate to learn how to log in and receive an authentication token
- A campaign that meets the following criteria:
- Duration of at least 3 days
- For a budget-based campaign, a daily budget of at least $100
- For an impression-based campaign, at least 1,000 daily impressions
- These are the default thresholds. Your workspace may be configured with different ones; the error message names the threshold the campaign misses.
Create a Bid Model using the IQM API
This tutorial covers how to create a Bid Model.
The minimum requirements to perform this task are: logging in with authentication credentials, checking a campaign's eligibility, and creating a Bid Model. Once these steps are accomplished, more can be learned about IQM's API through the guidelines pages.
- Check campaign for eligibility
- Select a dimension
- Create a Bid Model
Authentication
Use the following header parameters for all requests after logging in:
| Headers | |
|---|---|
Authorization string required | Bearer followed by the access_token from the login response. See Sign up and authenticate. |
X-IAA-OW-ID integer required | Organization Workspace ID header. |
Bid Model criteria
IQM's Bid Model currently supports applying Bid Modifiers to the following dimensions:
- Creative: Creative ID
- Location: State, City, ZIP code
- Inventory: Open Exchange, Publisher Category*, Deal ID**
- Device: Traffic Type, Device Type
- Exchange: Exchange ID
- Audience: Audience ID***
*Spend Ratios are not supported for the Publisher Category dimension subcategory. Refer to Spend Ratio overview Help Center article for more information.
**Bid Modifiers are not supported for the Deal ID dimension subcategory. Refer to the Bid Modifier overview Help Center article for more information.
***Spend Ratios and Allowlist/Blocklist targeting are not supported for the audience dimension.
Step 1: Check campaign for eligibility
GETBefore creating a Bid Model, check that you have an eligible campaign by using the campaignId and the Get campaign details endpoint.
The endpoint returns a JSON schema of campaign details (the relevant parameters are highlighted in the sample Response 200 code block):
- startTime and endTime indicate the campaign's duration.
- budgetTypeId shows whether the campaign is budget-based (1) or impression-based (2).
- The daily budget is shown by the budgetDay parameter.
| Path parameters | |
|---|---|
| campaignId integer | Campaign's unique ID |
- JSON
{
"statusCode": 200,
"responseObject": {
"owId": 204851,
"parentOrganizationName": "Example Workspace",
"id": 625979,
"uowId": 291477,
"campaignName": "Bid model campaign",
"advertiserDomain": "https://iqm.com",
"creativeType": 11,
"campaignType": 1,
"totalBudgetPacing": false,
"isTvAd": false,
"budgetDay": 100.0,
"budgetTotal": 1500.0,
"maxBid": 10.0,
"minBid": 0.0,
"allowedMinBid": 0.0,
"timezone": 29,
"startTime": 1793160000,
"endTime": 1796011200,
"status": "pending",
"dspMargin": 0,
"platformMargin": 0,
"userDealMargin": 0,
"spentScale": false,
"creativeIds": "803406",
"conversionType": "None",
"bidOptimization": false,
"bidPacing": false,
"isBidShading": true,
"impressionCapping": 0,
"frequencyCapEnabled": false,
"exchanges": "",
"isLocationWithOrFilter": true,
"countryId": "30100001",
"locationDetails": {},
"isCampaignFromNewPlatform": true,
"organizationName": "Example Organization",
"userEmail": "user@example.com",
"userName": "Jane Smith",
"isUnapprovedAudienceTargeted": false,
"isAllAudienceUnapproved": false,
"createDate": 1793036616,
"ioId": 29311,
"ioName": "IO Name 1",
"prebidAudienceSegmentIdList": [],
"campaignTypeId": 1,
"budgetTypeId": 1,
"isEstimatorAvailable": true,
"isAdvanceAudioVideoTargeted": false,
"isEditAccess": true,
"isParentInvoiceTemplateSet": true,
"isMarginSet": true,
"isApprovalAccess": false
}
}
Step 2: Select dimension
GETThis API provides values of Bid Model dimensions and sub-dimensions. Select the desired dimension id to apply the Bid Model to.
| Dimensions | |
|---|---|
1 | Creative |
2 | Inventory |
3 | Deal ID |
4 | Open Exchange |
5 | Publisher Category |
6 | Device |
7 | Traffic Type |
8 | Device Type |
9 | Location |
10 | State |
11 | City |
12 | Zip Codes |
13 | Exchange |
14 | Audience |
- JSON
{
"success": true,
"data": {
"totalRecords": 6,
"filteredRecords": 6,
"dimensions": [
{
"name": "creative",
"id": 1,
"label": "Creative",
"order": 1,
"modellingEnabled": true
},
{
"name": "inventory",
"id": 2,
"label": "Inventory",
"order": 2,
"modellingEnabled": false,
"subdimensions": [
{
"name": "deal_id",
"id": 3,
"label": "Deal ID",
"order": 1,
"modellingEnabled": false
},
{
"name": "open_exchange",
"id": 4,
"label": "Open Exchange",
"order": 2,
"modellingEnabled": false
},
{
"name": "publisher_category",
"id": 5,
"label": "Publisher Category",
"order": 3,
"modellingEnabled": false
}
]
},
{
"name": "device",
"id": 6,
"label": "Device",
"order": 3,
"modellingEnabled": false,
"subdimensions": [
{
"name": "traffic_type",
"id": 7,
"label": "Traffic Type",
"order": 1,
"modellingEnabled": false
},
{
"name": "device_type",
"id": 8,
"label": "Device Type",
"order": 2,
"modellingEnabled": false
}
]
},
{
"name": "location",
"id": 9,
"label": "Location",
"order": 4,
"modellingEnabled": false,
"subdimensions": [
{
"name": "state",
"id": 10,
"label": "State",
"order": 1,
"modellingEnabled": true
},
{
"name": "city",
"id": 11,
"label": "City",
"order": 2,
"modellingEnabled": true
},
{
"name": "zip",
"id": 12,
"label": "Zip Codes",
"order": 3,
"modellingEnabled": true
}
]
},
{
"name": "exchange",
"id": 13,
"label": "Exchange",
"order": 5,
"modellingEnabled": false
},
{
"name": "audience",
"id": 14,
"label": "Audience",
"order": 6,
"modellingEnabled": true
}
]
}
}
Step 3: Create a Bid Model
PUTOnce you have determined your campaign is eligible, you can pass the campaignId and your selected dimensionId to create a Bid Model. Review the Bid Model tools descriptions in the About section, the Bid Model criteria, and the Request schema table below to create a Bid Model.
See the Manage Bid Model settings endpoint for full documentation.
Spend Ratio:
- Strict Spend Ratios must equal 100% across all allocated dimensions.
- Flexible Spend Ratios require a dimension priority.
Group multiple dimension entities into a bundle to apply the same Bid Modifier and Spend Ratio to all entities in the bundle.
See the Create Bid Model bundle endpoint for more information on how to create a bundle, then use the bundleName and entityIds in your requests.
| Path parameters | |
|---|---|
campaignId integer | Campaign ID. |
dimensionId integer | Dimension ID. |
| Request schema | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
actionWiseBidModelEntities object | Object containing Bid Model entity details mapped to operations ADD, UPDATE, DELETE. | ||||||||||||||||||||||
| |||||||||||||||||||||||
bidModelEntityDetails object | Object containing Bid Model entity details for ADD operation. | |||||||||||||||||
| ||||||||||||||||||
entityIdinteger required | Bid Model entity ID, such as the ID of your creative for the Creative dimension. Use -1 for the Other entity. |
entityTypeIdinteger required | Bid Model entity type ID
1: Individual entity 2: Bundle entity 3: Other entity When you add modelled entities, include exactly one Other entity (entityId -1). |
priority integer | Assigned priority: [ 1 .. 10 ]. Required when spendRatioTypeId is 1 (Flexible). Omit it when spendRatioTypeId is 2 (Strict). |
bidMultiplier number required | Bid Modifier: [ 0.1 .. 100 ]. |
spendRatio integer | Spend Ratio: [ 0 .. 100 ]. Required for every dimension except Publisher Category and Audience, which don't support spend ratios. Omit it for those. |
spendRatioTypeId integer | Spend Ratio type ID. Flexible: 1. Strict: 2. Required for every dimension except Publisher Category and Audience, which don't support spend ratios. Omit it for those. |
bundleNamestring required | Bundle name, required when entityTypeId is set to bundle entity. Each bundle needs its own name. |
entityIdsarray of integers required | Entity IDs, required when entityTypeId is set to bundle entity. |
Response properties
success boolean | Indicates the Bid Model was updated: true. |
data string | Success message. |
- JSON
{
"actionWiseBidModelEntities": {
"ADD": {
"bidModelEntityDetails": [
{
"entityId": 803406,
"entityTypeId": 1,
"priority": 1,
"bidMultiplier": 2,
"spendRatio": 50,
"spendRatioTypeId": 1
},
{
"entityId": -1,
"entityTypeId": 3,
"priority": 2,
"bidMultiplier": 1,
"spendRatio": 50,
"spendRatioTypeId": 1
}
]
}
}
}
{
"success": true,
"data": "Bid modeling updated successfully"
}
More responses
{
"success": false,
"errorObjects": [
{
"error": "At least one 'Other' entity is required if there are modelled entities"
}
]
}