Mile Prebid Adapter
The Mile Prebid Adapter is a module that connects the Prebid framework to Mile. This documentation provides integration guidelines for implementing the adapter in your header-bidding setup.
Prerequisites
General
Before integrating the Mile Prebid Adapter, ensure the following:
- Client-side only: The Mile Prebid Adapter is designed for client-side header bidding only. It is not supported for server-side bidding (Prebid Server) implementations.
- Banner only: Banner is the only supported ad media type. Video, native, and other media types are not supported for now.
Prebid.js Version
- Minimum: Prebid.js
10.25.0or later. The Mile adapter is bundled in the official Prebid.js distribution from this version onward. - Recommended: Use the latest available Prebid.js release. Newer versions include functional improvements and maintenance updates.
Mile Edge Script Tag
Place the following script inside the <head> section of your HTML:
<script type="text/javascript" src="https://edge.atmtd.com/pub/{pubID}/afihbs.js" async></script>
Replace {pubID} with your Publisher ID. Contact your Account Manager to obtain your pubID.
Adding the Mile Prebid Adapter to Your Prebid.js Library
The Mile Prebid Adapter (mileBidAdapter) is included in the official Prebid.js distribution starting from version 10.25.0. You can add it to your Prebid.js library using one of the following methods:
The Mile Prebid Adapter requires the Mile analytics adapter (automatadAnalyticsAdapter) to function correctly. Make sure to include both modules in your Prebid.js build.
Option 1: Prebid.js Download Page
- Go to the Prebid.js Download Page.
- Select Mile under the list of available bid adapters.
- Select Automatad Analytics Adapter under the list of available analytics adapters.
- Download your customized Prebid.js build.
Option 2: Build from Source
If you build Prebid.js from source, include the mileBidAdapter module in your build command:
gulp bundle --modules=...,mileBidAdapter,automatadAnalyticsAdapter
Configuring the Mile Prebid Adapter
To use the Mile Prebid Adapter, add "mile" as a bidder in your ad unit configuration. The following example demonstrates a typical setup:
var adUnits = [
{
code: 'div-banner-atf',
mediaTypes: {
banner: {
sizes: [[300, 250], [300, 600]]
}
},
bids: [
{
bidder: 'mile',
params: {
placementId: '12345',
siteId: 'site123',
publisherId: 'pub456'
}
}
// Other bidder adapters can be added here
]
}
];
Bid Params
| Name | Scope | Description | Example | Type |
|---|---|---|---|---|
placementId | required | The placement ID for the ad unit | '12345' | string |
siteId | required | The site ID for the publisher | 'site123' | string |
publisherId | required | The publisher ID | 'pub456' | string |
Contact your Account Manager to obtain your placementId, siteId, and publisherId.
Enable User Syncing
To enable user syncing for the Mile Prebid Adapter, add the following configuration:
pbjs.setConfig({
userSync: {
iframeEnabled: true, // Enable iframe syncs
filterSettings: {
iframe: {
bidders: ['mile'],
filter: 'include'
}
}
}
});
Update Your ads.txt
Ensure your site's ads.txt file includes the required Mile entries. This is necessary for Mile demand to serve on your inventory.
You can obtain the Mile ads.txt lines from the Mile Platform or by contacting your Account Manager.
Ads may not serve until the correct ads.txt entries are in place. Please verify your ads.txt is updated before going live.
Google Ad Manager Setup
Ensure your Google Ad Manager (GAM) account is configured with the appropriate line items and key-value targeting to accept bids from the Mile bidder. Refer to the Prebid Ad Ops Guide for detailed instructions.