# BidMachine Developer Docs > Guides and references for BidMachine SDK, Reporting API, and more This file contains all documentation content in a single document following the llmstxt.org standard. ## BidMachine Placement Management API import ApiLogo from "@theme/ApiLogo"; import Heading from "@theme/Heading"; import SchemaTabs from "@theme/SchemaTabs"; import TabItem from "@theme/TabItem"; import Export from "@theme/ApiExplorer/Export"; This API lets publishers create, list, update, and delete placements on their ad sources programmatically — without using the BidMachine dashboard. Requirements: - Bearer token authentication. Obtain a token via the __Get Access Token__ endpoint using your dashboard __login and password__. - All operations are scoped to sources owned by the authenticated publisher. Requests for foreign sources return **403 Forbidden**. Note: Tokens are short-lived. When a request returns **401 Unauthorized**, re-authenticate and retry with a fresh token. Security Scheme Type: http HTTP Authorization Scheme: basic Security Scheme Type: http HTTP Authorization Scheme: bearer --- ## BidMachine Reporting API import ApiLogo from "@theme/ApiLogo"; import Heading from "@theme/Heading"; import SchemaTabs from "@theme/SchemaTabs"; import TabItem from "@theme/TabItem"; import Export from "@theme/ApiExplorer/Export"; This API provides reporting data. Requirements: - Basic Authentication (__login and password__). - The maximum allowed time period for a query is **45 days** (the P2P Revenue report allows up to **2 years**). - Rate limit: **6 requests per minute**. Note: Report generation can take between **10** to **60 seconds** depending on server load, and the request timeout can be up to **300 seconds**. Security Scheme Type: http HTTP Authorization Scheme: basic --- ## Create Placement import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Creates a new placement on the given source. The placement `id` is generated server-side from the `name` and `bundle` fields — store it, you will need it for update and delete calls. --- ## Delete Placement import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Deletes the placement with the given `id` from the source. --- ## Get Access Token import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Returns a short-lived bearer token. Authenticate with HTTP Basic credentials — the same username and password used to log in to the dashboard. Use the returned token in all subsequent requests as `Authorization: Bearer `. --- ## List Placements import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Returns all placements for the given source. --- ## Retrieve Bidder Report Data import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Returns bidder reporting data in __NDJSON__ or __CSV__ format based on the query parameters. The endpoint accepts an interval, an optional output format, and an optional list of fields (dimensions) to be returned. --- ## Retrieve P2P Revenue Report Data import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Returns P2P revenue reporting data in __NDJSON__ or __CSV__ format based on the query parameters. The endpoint accepts a date range, an optional output format, header preferences for CSV, and an optional list of fields (dimensions) to be returned. The maximum allowed time period for this report is **2 years**. --- ## Retrieve SSP Report Data import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Returns reporting data in __NDJSON__ or __CSV__ format based on the query parameters. The endpoint accepts a date range, an optional output format, header preferences for CSV, and an optional list of fields (dimensions) to be returned. --- ## Update Placement import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; import ParamsDetails from "@theme/ParamsDetails"; import RequestSchema from "@theme/RequestSchema"; import StatusCodes from "@theme/StatusCodes"; import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; Updates an existing placement. Send the full placement object including its `id` — all fields are replaced. --- ## Advanced Reporting The BidMachine data reports provide insights into your ad performance, including metrics such as ad requests, impressions, CPM, and revenue, categorized by application and ad type levels. You can access these reports in the **Reports** section of the BidMachine Publisher platform. There are two report types: **Ad Request Report** and **Impressions Report**. ## Ad Request Report **Dimensions** - `Time` - `Ad Placement Type` - `Device OS` - `Region` - `Source ID` - `Source` - `Datacenter` - `Mediation Stack ID` - `Test Mode` **Metrics** - `Ad Requests` - `Unique Devices` ## Impressions Report **Dimensions** - `Time` - `Ad Size` - `Ad Type` - `Adomain` - `DSP Name` - `App Bundle` - `App Name` - `App Version` - `Bid Floor Level` - `Bid Price Level` - `Campaign ID` - `Country` **Metrics** - `Impressions` - `Publisher Revenue` - `Publisher eCPM` - `Unique Devices` --- ## Blocking Rules import Image from '@theme/IdealImage' Blocking Rules let you prevent unwanted ads from appearing in your app. You can block: - Ad categories - Advertising domains - Bid bundles - Creative IDs **How to apply Blocking Rules?** 1. In the BidMachine dashboard, go to **Source & Blocking Rules**. 2. Click **Add** under the Blocking Rules section. 3. Enter bundle names in the **Apps** field to target specific applications. 4. Leave the **Apps** field empty to apply the rule to all apps. --- ## Creatives Preview import Image from '@theme/IdealImage' Creatives enable you to assess the ads displayed on your app, allowing you to review whether these creatives should remain active or be blocked. You can access the Creative Review within the Creatives section of the BidMachine publisher platform. To review a specific creative, please apply filters using both the CID and CRID. To block the creative, navigate to the 'Blocking Rules' section at the Source level. --- ## Payments import Image from '@theme/IdealImage' ## Payments Overview To ensure timely payment, complete your payment details in the BidMachine dashboard. 1. Log in and navigate to the **Payments** page. 2. Click **Payment Details**. 3. Fill out your payment information and click **Save**. ## Payments History On the **Payments History** tab, you can review past payments. Each payment displays one of three statuses: - **Pending**: Created and being processed by our Financial team (up to 5 days). - **Completed**: Successfully sent to your bank account. - **Rejected**: Failed due to incorrect details or a bank issue. We will contact you to update your information or resolve the issue. :::tip Minimum Payable Amount The minimum payable amount is **$1,000**. If your monthly earnings are below this threshold, the balance rolls over to the next month. If you decide to close your account before reaching $1,000, email [support@bidmachine.io](mailto:support@bidmachine.io) to request payment of your remaining balance. ::: --- ## Placements import Image from '@theme/IdealImage' A **Placement** is a specific location within your app where ads are displayed. It is defined by the ad format, size, and position on the screen. You can create multiple placements for different ad formats, such as banners, interstitials, and rewarded videos. You can find your **Placement ID** on the **Source & Blocking Rules** page of the BidMachine dashboard. Copy this ID and include it in your SDK integration. :::tip Placement Management API You can also create, update, and delete placements programmatically via the [Placement Management API](/api/bidmachine-placement-management-api) — useful when provisioning placements at scale. ::: 1. Go to the **Source & Blocking Rules** page in the BidMachine dashboard. 2. Select correct **Source** from the list and choose edit. 3. Select the **Placements** tab. 4. Fill out the form to create a new placement: - **Name**: A descriptive name for the placement. - **Platform**: The platform for which the placement is created (e.g., Android, iOS). - **Bundle**: The app bundle identifier where the placement will be used. - **Ad Type**: The type of ad (e.g., Banner, Interstitial, Rewarded Video). - **Placement Type**: The method of ad serving (e.g., Bidding – real-time auction; Waterfall – sequential requests by priority). - **HVA Setup**: A parallel setup with a higher price floor to capture high-value impressions (e.g., parallel config with higher price floor; low fill, higher revenue). - **Price Floor**: Minimum CPM required to serve an ad (e.g., requests below this value are skipped in the waterfall). :::important Bundle Format Android bundle name should be in the format `com.example.appname`, while iOS bundle should be numeric store ID (e.g., `123456789`). ::: 5. Click **Create** to save the placement. 6. The newly created placement will appear in the list of placements for the selected source. 7. Copy the **Placement ID** from the list and include it in your SDK integration by clicking on the **Copy** button next to the ID. :::important Placement ID Usage The Placement ID is used to identify the specific placement in your app. It should be included in the ad request to ensure that the correct ads are served. ::: --- ## Source import Image from '@theme/IdealImage' A **Source** is a container you integrate into your app to display ads to users. The BidMachine platform automatically recognizes the ad type when the ad request is generated. You can find your **Source ID** on the **Source & Blocking Rules** page of the BidMachine dashboard. Copy this ID and include it in your SDK integration. --- ## Enumerated Lists Specification ## Ad Position | Value | Description | | ----- | --------------------------------------------------------------------------------------- | | `0` | Unknown | | `1` | Above the Fold | | `2` | *Deprecated* May or may not be initially visible depending on screen size/resolution. | | `3` | Below the Fold | | `4` | Header | | `5` | Footer | | `6` | Sidebar | | `7` | Full Screen | ## API Frameworks | Value | Description | | ----- | ------------ | | `1` | VPAID 1.0 | | `2` | VPAID 2.0 | | `3` | MRAID-1 | | `4` | ORMMA | | `5` | MRAID-2 | ## Banner Ad Types | Value | Description | | ----- | -------------------------------------------------- | | `1` | XHTML Text Ad (usually mobile) | | `2` | XHTML Banner Ad (usually mobile) | | `3` | JavaScript Ad; must be valid XHTML (script tags) | | `4` | `iframe` | ## Connection Type | Value | Description | | ----- | ------------------------------------- | | `0` | Unknown | | `1` | Ethernet | | `2` | Wi‑Fi | | `3` | Cellular Network – Unknown Generation | | `4` | Cellular Network – 2G | | `5` | Cellular Network – 3G | | `6` | Cellular Network – 4G | ## Content Categories :::warning List is truncated; see full IAB taxonomy as needed. ::: | Value | Description | | -------- | ---------------------------- | | `IAB1` | Arts & Entertainment | | `IAB1-1` | Books & Literature | | `IAB1-2` | Celebrity Fan/Gossip | | `IAB1-3` | Fine Art | | `IAB1-4` | Humor | | `IAB1-5` | Movies | | `IAB1-6` | Music | | `IAB1-7` | Television | | `IAB2` | Automotive | | `IAB2-1` | Auto Parts | | `IAB2-2` | Auto Repair | | `IAB2-3` | Buying/Selling Cars | | `IAB2-4` | Car Culture | | ... | ... | ## Content Delivery Methods | Value | Description | | ----- | ------------- | | `1` | Streaming | | `2` | Progressive | ## Creative Attributes | Value | Description | | ----- | ---------------------------------------------------------- | | `1` | Audio Ad (Auto-Play) | | `2` | Audio Ad (User Initiated) | | `3` | Expandable (Automatic) | | `4` | Expandable (User Initiated—Click) | | `5` | Expandable (User Initiated—Rollover) | | `6` | In-Banner Video Ad (Auto-Play) | | `7` | In-Banner Video Ad (User Initiated) | | `8` | Pop (Over, Under, or Upon Exit) | | `9` | Provocative or Suggestive Imagery | | `10` | Shaky/Flashing/Flickering/Extreme Animation/Smileys | | `11` | Surveys | | `12` | Text Only | | `13` | User Interactive (e.g., Embedded Games) | | `14` | Windows Dialog or Alert Style | | `15` | Has Audio On/Off Button | | `16` | Ad Can Be Skipped (e.g., Skip Button on Pre-Roll Video) | ## Device Type | Value | Description | | ----- | ------------------- | | `1` | Mobile/Tablet | | `2` | Personal Computer | | `3` | Connected TV | | `4` | Phone | | `5` | Tablet | | `6` | Connected Device | | `7` | Set Top Box | ## Expandable Direction | Value | Description | | ----- | ------------- | | `1` | Left | | `2` | Right | | `3` | Up | | `4` | Down | | `5` | Full Screen | ## Location Type | Value | Description | | ----- | ------------------------------------ | | `1` | GPS/Location Services | | `2` | IP Address | | `3` | User Provided (e.g., registration) | ## No-Bid Reason Codes | Value | Description | | ----- | ------------------------------ | | `0` | Unknown Error | | `1` | Technical Error | | `2` | Invalid Request | | `3` | Known Web Spider | | `4` | Suspected Non-Human Traffic | | `5` | Cloud/Data Center/Proxy IP | | `6` | Unsupported Device | | `7` | Blocked Publisher or Site | | `8` | Unmatched User | ## Loss Reason Codes | Value | Description | | ----- | ------------------------------------------------------------------------------------------ | | `0` | Bid Won | | `1` | Internal Error | | `2` | Impression Opportunity Expired | | `3` | Invalid Bid Response | | `4` | Invalid Deal ID | | `5` | Invalid Auction ID | | `6` | Invalid (malformed) Advertiser Domain | | `7` | Missing Markup | | `8` | Missing Creative ID | | `9` | Missing Bid Price | | `10` | Missing Minimum Creative Approval Data | | `100` | Bid was Below Auction Floor | | `101` | Bid was Below Deal Floor | | `102` | Lost to Higher Bid | | `103` | Lost to a Bid for a PMP Deal | | `104` | Buyer Seat Blocked | | `200` | Creative Filtered—General; reason unknown. | | `201` | Creative Filtered—Pending processing by Exchange (e.g., approval, transcoding) | | `202` | Creative Filtered—Disapproved by Exchange | | `203` | Creative Filtered—Size Not Allowed | | `204` | Creative Filtered—Incorrect Creative Format | | `205` | Creative Filtered—Advertiser Exclusions | | `206` | Creative Filtered—App Bundle Exclusions | | `207` | Creative Filtered—Not Secure | | `208` | Creative Filtered—Language Exclusions | | `209` | Creative Filtered—Category Exclusions | | `210` | Creative Filtered—Creative Attribute Exclusions | | `211` | Creative Filtered—Ad Type Exclusions | | `212` | Creative Filtered—Animation Too Long | | `213` | Creative Filtered—Not Allowed in PMP Deal | | `503` | Bid Expiration Below Minimum—bid.exp below 600s | ## VAST Companion Types | Value | Description | | ----- | -------------------| | `1` | Static Resource | | `2` | HTML Resource | | `3` | `iframe` Resource | ## Video Bid Response Protocols | Value | Description | | ------ | --------------------- | | `1` | VAST 1.0 | | `2` | VAST 2.0 | | `3` | VAST 3.0 | | `4` | VAST 1.0 Wrapper | | `5` | VAST 2.0 Wrapper | | `6` | VAST 3.0 Wrapper | ## Video Linearity | Value | Description | | ----- | ------------------ | | `1` | Linear / In-Stream | | `2` | Non-Linear / Overlay| ## Video Playback Methods | Value | Description | | ----- | --------------------- | | `1` | Auto-Play Sound On | | `2` | Auto-Play Sound Off | | `3` | Click-to-Play | | `4` | Mouse-Over | ## Video Quality | Value | Description | | ----- | ----------------------------- | | `0` | Unknown | | `1` | Professionally Produced | | `2` | Prosumer | | `3` | User Generated (UGC) | ## Video Start Delay | Value | Description | | ------- | ----------------------------------------------- | | `>0` | Mid-Roll (value indicates start delay in seconds)| | `0` | Pre-Roll | | `-1` | Generic Mid-Roll | | `-2` | Generic Post-Roll | --- ## Bid Request Examples :::note BidMachine exchange currently works with Open RTB **2.3** and **2.5**. Provided examples are only valid for Open RTB **2.5.** ::: ## Banner Bid Request
Banner Bid Request Example ```json title="Banner Bid Request" { "allimps": 0, "app": { "bundle": "ru.kuchaknig.android.freebooks.scifi", "cat": [ "IAB1-1" ], "ext": { "badv": [], "bcat": [], "packagename": "ru.kuchaknig.android.freebooks.scifi" }, "id": "16848", "name": "Фантастика", "paid": 0, "publisher": { "id": "618", "name": "Роман" }, "storeurl": "https://play.google.com/store/apps/details?id=ru.kuchaknig.android.freebooks.scifi&hl=en", "ver": "2.9.37" }, "at": 2, "badv": [], "bcat": [], "cur": [ "USD" ], "device": { "carrier": "250-01", "connectiontype": 3, "devicetype": 4, "geo": { "country": "RUS", "lat": 56.8519, "lon": 60.6122, "type": 2, "utcoffset": 300, "zip": "620002" }, "h": 1280, "hwv": "DOOGEE HT16", "ifa": "6d670e54-ffe3-4318-9100-dd600ee040c4", "ip": "213.87.249.67", "js": 1, "language": "ru", "lmt": 0, "make": "DOOGEE", "model": "DOOGEE HT16", "os": "android", "osv": "6.0", "ua": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19(KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19", "w": 720 }, "id": "d5260eec-75d9-4f7d-86bc-22b01b4c779e", "imp": [ { "banner": { "api": [ 5, 3 ], "battr": [ 5, 8, 9, 10, 14 ], "h": 50, "mimes": [ "image/jpg", "image/gif", "image/png" ], "w": 320 }, "bidfloor": 0.945, "bidfloorcur": "USD", "displaymanager": "appodeal", "displaymanagerver": "1.15.8", "id": "e58013b7-3e6e-4bcf-9121-1bcedeeb319c", "instl": 0, "tagid": "1" } ], "source": { "ext": { "schain": { "complete": 1, "nodes": [ { "asi": "seller.com", "hp": 1, "rid": "7578222740099842730", "sid": "210676" }, { "asi": "bidmachine.io", "hp": 1, "rid": "ce4d7ece-aa68-4e9b-91f5-fc581ed0bde4", "sid": "124" } ], "ver": "1.0" } }, "fd": 1, "tid": "7578222740099842730" }, "tmax": 500, "user": { "gender": "F", "geo": { "country": "RUS", "lat": 56.8519, "lon": 60.6122, "type": 2, "utcoffset": 300, "zip": "620002" } } } ```
## Interstitial Bid Request :::info If Exchange is requesting a **rewarded (non-skippable)** interstitial, then we **ALWAYS** send `"battr": [16]` in Banner object. We also send `imp.banner.ext.bannertype: "rewarded"` inside bid request. If Exchange is requesting a **skippable interstitial**, then we **DO NOT** send `"battr": [16]` in Banner object. :::
Interstitial Bid Request Example ```json title="Interstitial Bid Request" { "app": { "bundle": "1214661054", "cat": [ "IAB1-6", "IAB14" ], "ext": { "badv": {}, "bcat": {}, "packagename": "com.boom.topaudio" }, "id": "68629", "name": "Top Audio", "publisher": { "id": "1582", "name": "Роман" }, "storeurl": "https://itunes.apple.com/de/app/top-audio-excellent-player/id1214661054?mt=8&uo=4", "ver": "1.1" }, "at": 2, "cur": [ "USD" ], "device": { "carrier": "250-02", "connectiontype": 2, "devicetype": 4, "geo": { "city": "Troitsa", "country": "RUS", "ext": { "old_geo": { "country": "RUS", "lat": 55.4792, "lon": 37.3086, "type": 2, "utcoffset": 180, "zip": "142190" } }, "ipservice": 3, "lat": 55.4792, "lon": 37.3086, "type": 2, "utcoffset": 180, "zip": "142190" }, "h": 568, "hwv": "iPhone6,2", "ifa": "10133A31-C4BF-489E-A310-B9241861E439", "ip": "212.41.49.81", "js": 1, "language": "ru", "make": "Apple", "model": "iPhone6,2", "os": "ios", "osv": "10.1.1", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B100", "w": 320 }, "id": "12f71145-a0f0-4b8b-a513-c051d0bb4159", "imp": [ { "banner": { "api": [ 5, 3 ], "battr": [ 14, 5, 8, 9, 10 ], "h": 480, "mimes": [ "image/jpg", "image/gif", "image/png" ], "w": 320 }, "bidfloor": 13.568, "bidfloorcur": "USD", "displaymanager": "appodeal", "displaymanagerver": "1.3.9", "id": "e9761ecc-f2fb-47b0-99d4-bc1a67cab07d", "instl": 1, "tagid": "3" } ], "source": { "ext": { "schain": { "complete": 1, "nodes": [ { "asi": "fyber.com", "hp": 1, "rid": "7578222740099842730", "sid": "210676" }, { "asi": "bidmachine.io", "hp": 1, "rid": "ce4d7ece-aa68-4e9b-91f5-fc581ed0bde4", "sid": "124" } ], "ver": "1.0" } }, "fd": 1, "tid": "7578222740099842730" }, "tmax": 500, "user": { "gender": "O", "geo": { "country": "RUS", "lat": 55.4792, "lon": 37.3086, "type": 2, "utcoffset": 180, "zip": "142190" } } } ```
## Rewarded Interstitial Bid Request :::info For nonskippalbe (rewarded interstitials) we add `"imp.banner.ext.bannertype: "rewarded"` to bid request :::
Rewarded Bid Request Example ```json title="Rewarded Bid Request" { "app": { "bundle": "1214661054", "cat": [ "IAB1-6", "IAB14" ], "ext": { "badv": {}, "bcat": {}, "packagename": "com.boom.topaudio" }, "id": "68629", "name": "Top Audio", "publisher": { "id": "1582", "name": "Роман" }, "storeurl": "https://itunes.apple.com/de/app/top-audio-excellent-player/id1214661054?mt=8&uo=4", "ver": "1.1" }, "at": 2, "cur": [ "USD" ], "device": { "carrier": "250-02", "connectiontype": 2, "devicetype": 4, "geo": { "city": "Troitsa", "country": "RUS", "ext": { "old_geo": { "country": "RUS", "lat": 55.4792, "lon": 37.3086, "type": 2, "utcoffset": 180, "zip": "142190" } }, "ipservice": 3, "lat": 55.4792, "lon": 37.3086, "type": 2, "utcoffset": 180, "zip": "142190" }, "h": 568, "hwv": "iPhone6,2", "ifa": "10133A31-C4BF-489E-A310-B9241861E439", "ip": "212.41.49.81", "js": 1, "language": "ru", "make": "Apple", "model": "iPhone6,2", "os": "ios", "osv": "10.1.1", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B100", "w": 320 }, "id": "12f71145-a0f0-4b8b-a513-c051d0bb4159", "imp": [ { "banner": { "api": [ 5, 3 ], "battr": [ 14, 5, 8, 9, 10 ], "ext": { "bannertype": "rewarded" }, "h": 480, "mimes": [ "image/jpg", "image/gif", "image/png" ], "w": 320 }, "bidfloor": 13.568, "bidfloorcur": "USD", "displaymanager": "appodeal", "displaymanagerver": "1.3.9", "id": "e9761ecc-f2fb-47b0-99d4-bc1a67cab07d", "instl": 1, "tagid": "3" } ], "source": { "ext": { "schain": { "complete": 1, "nodes": [ { "asi": "fyber.com", "hp": 1, "rid": "7578222740099842730", "sid": "210676" }, { "asi": "bidmachine.io", "hp": 1, "rid": "ce4d7ece-aa68-4e9b-91f5-fc581ed0bde4", "sid": "124" } ], "ver": "1.0" } }, "fd": 1, "tid": "7578222740099842730" }, "tmax": 500, "user": { "gender": "O", "geo": { "country": "RUS", "lat": 55.4792, "lon": 37.3086, "type": 2, "utcoffset": 180, "zip": "142190" } } } ```
## Video Bid Request
Video Bid Request Example ```json title="Video Bid Request" { "allimps": 0, "app": { "cat": [ "IAB24" ], "ext": { "app_uptime": 1317, "badv": {}, "bcat": [ "IAB-30" ], "click": {}, "click_count": 0, "finish": {}, "finish_count": 4, "imp": {}, "imp_count": 4, "packagename": "com.appodeal.sandbox", "sdk": "2.1.10", "session_id": 13, "session_uptime": 15, "tclick": {}, "tfinish": { "interstitial": 4 }, "timp": { "interstitial": 4 } }, "id": "7635", "name": "Appodeal Sandbox", "privacypolicy": 0, "publisher": { "id": "1819", "name": "pub name" }, "storeurl": "This app is not in store yet", "ver": "4.0" }, "at": 2, "badv": [], "bcat": [ "IAB-30" ], "cur": [ "USD" ], "device": { "connectiontype": 2, "devicetype": 4, "ext": { "battery": -100, "rooted": "false" }, "geo": { "city": "Kirov", "country": "RUS", "lat": 58.5969, "lon": 49.6583, "type": 2, "utcoffset": 180, "zip": "610000" }, "h": 320, "hwv": "x86_64", "ifa": "CCBD556A-14A7-4E26-A52C-652355D4BA5A", "ip": "77.72.140.9", "js": 1, "lmt": 0, "make": "Apple", "model": "x86_64", "os": "iOS", "osv": "11.2", "ppi": 326, "pxratio": 2, "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C107", "w": 568 }, "id": "ca0463e4-0c19-42c4-99e9-534713c6ee84", "imp": [ { "bidfloor": 10.01, "bidfloorcur": "USD", "displaymanager": "appodeal", "displaymanagerver": "2.1.10", "id": "c1816ba0-d005-4d19-a11e-49147712e5b1", "instl": 1, "tagid": "82", "video": { "api": [], "battr": [ 16 ], "delivery": [ 1, 2 ], "ext": { "videotype": "rewarded" }, "h": 320, "linearity": 1, "maxduration": 30, "mimes": [ "video/mp4" ], "minduration": 5, "playbackmethod": [ 1 ], "protocols": [ 1, 2, 3, 4, 5, 6 ], "w": 480 } } ], "regs": { "coppa": 0 }, "tmax": 300, "user": { "gender": "O", "geo": { "city": "Kirov", "country": "RUS", "lat": 58.5969, "lon": 49.6583, "type": 2, "utcoffset": 180, "zip": "610000" } } } ```
## Native Ad Bid Request
Native Ad Bid Request Example ```json title="Native Ad Bid Request" { "allimps": 0, "app": { "bundle": "1134511982", "cat": [ "IAB9-30", "IAB9-30" ], "ext": { "badv": [], "bcat": [], "packagename": "com.tigrido.color6" }, "id": "41944", "name": "Color 6 (iOS)", "paid": 0, "privacypolicy": 0, "publisher": { "id": "2089", "name": "Aleksandr Filatov" }, "storeurl": "https://itunes.apple.com/us/app/color-6/id1134511982?mt=8&uo=4", "ver": "1.0" }, "at": 2, "badv": [], "bcat": [], "cur": [ "USD" ], "device": { "connectiontype": 2, "devicetype": 4, "geo": { "city": "Kirov", "country": "RUS", "lat": 58.5966, "lon": 49.6601, "type": 2, "utcoffset": 180, "zip": "249440" }, "h": 568, "hwv": "x86_64", "ifa": "9611032A-935B-472A-878E-D4CBD9D4B192", "ip": "77.72.140.9", "js": 1, "language": "en", "lmt": 0, "make": "Apple", "model": "x86_64", "os": "iOS", "osv": "10.3.1", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301", "w": 320 }, "id": "d97cef2b-36be-44fe-90ed-15f90666bbe7", "imp": [ { "bidfloor": 0.0858, "bidfloorcur": "USD", "displaymanager": "appodeal", "displaymanagerver": "1.3.9", "id": "ae7c1c88-de6a-4893-8474-fe491024d159", "instl": 0, "native": { "api": [ 1, 2, 3, 4, 5 ], "request": "{\"assets\":[{\"id\":123,\"required\":1,\"title\":{\"len\":40}},{\"id\":124,\"required\":1,\"img\":{\"type\":1,\"wmin\":50,\"hmin\":50,\"mimes\": [\"image/jpg\",\"image/gif\",\"image/png\",\"image/jpeg\"]}},{\"id\":128,\"required\":1,\"img\":{\"type\":3,\"wmin\":1200,\"hmin\":627,\"mimes\":[\"image/jpg\",\"image/gif\",\"image/png\",\"image/jpeg\"]}},{\"id\":4,\"required\":0,\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":1,\"maxduration\":90,\"protocols\":[2,5]}},{\"id\":127,\"required\":1,\"data\":{\"type\":2}},{\"id\":7,\"required\":0,\"data\":{\"type\":3}},{\"id\":8,\"required\":0,\"data\":{\"type\":12}}],\"ver\":\"1.0\",\"plcmtcnt\":1,\"seq\":0}", "ver": "1.1" }, "tagid": "34" } ], "regs": { "coppa": 0 }, "tmax": 250, "user": { "gender": "O", "geo": { "city": "Kirov", "country": "RUS", "lat": 58.5966, "lon": 49.6601, "type": 2, "utcoffset": 180, "zip": "249440" } } } ```
--- ## MRAID Ads Requirements ## Impression Tracking with MRAID Creative To track impressions inside the creative, include a script that triggers impression trackers on the `viewableChange` event: ```js ``` :::warning If you are using impression pixels in the creative, move them to `seatbid.bid.ext.imptrackers` (the Bid object) or trigger them within the `viewableChange` event. ::: --- ## Bid Request Specification :::note BidMachine Ad Exchange currently works with Open RTB **2.3** and **2.5**. This documentation is only valid for Open RTB **2.5.** Outgoing bid requests are sent with the `x-openrtb-version: 2.5` HTTP header. ::: ## Bid Request Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string | Unique ID of the bid request, provided by the exchange. | `d5260eec-75d9-4f7d-86bc-22b01b4c779e` | | `imp` | object array | Array of Imp objects representing the impressions offered. At least 1 Imp object is required. | *(empty)* | | `app` | object | Details about the publisher’s app (i.e., non-browser applications). Only applicable and recommended for apps. | *(empty)* | | `device` | object | Details about the user’s device to which the impression will be delivered. | *(empty)* | | `user` | object | Details about the human user of the device; the advertising audience. | *(empty)* | | `test` | integer; default 0 | Indicator of test mode in which auctions are not billable, where 0 = live mode, 1 = test mode | `0` | | `at` | integer; default 1 | Auction type, where 1 = First Price, 2 = Second Price Plus. BidMachine currently supports only type 1 | `1` | | `tmax` | integer | Maximum time in milliseconds to submit a bid to avoid timeout. This value is commonly communicated offline. | `250` | | `cur` | string array | Array of allowed currencies for bids on this bid request using ISO-4217 alpha codes. Recommended only if the exchange accepts multiple currencies. | `["USD"]` | | `bcat` | string array | Blocked advertiser categories using the IAB content categories. | `["IAB2-1"]` | | `badv` | string array | Block list of advertisers by their domains. | `["blocked.domain.com"]` | | `reg` | object | A Regs object that specifies any industry, legal, or governmental regulations in force for this request. | *(empty)* | | `source` | object | This object describes the nature and behavior of the entity that is the source of the bid request upstream from the exchange. | *(empty)* | | `ext` | object | Placeholder for exchange-specific extensions to OpenRTB | *(empty)* | ## Imp | Attribute | Type | Description | Example | |---|---|---|---| | `id` | **required**,string | A unique identifier for this impression within the context of the bid request (typically, starts with 1 and increments OR UUID). | `6ba06f9a-44c8-497d-8bc3-78804bebc2c8` | | `banner` | object | A Banner object; required if this impression is offered as a banner ad opportunity. | *(empty)* | | `video` | object | A Video object; required if this impression is offered as a video ad opportunity. | *(empty)* | | `native` | object | A Native object; required if this impression is offered as a native ad opportunity. | *(empty)* | | `displaymanager` | required,string | Name of ad mediation partner, SDK technology, or player responsible for rendering ad (typically video or mobile). Used by some ad servers to customise ad code by a partner. Recommended for video and/or apps. | `you_ssp_name` | | `displaymanagerver` | required,string | Version of ad mediation partner, SDK technology, or player responsible for rendering ad (typically video or mobile). Used by some ad servers to customise ad code by a partner. Recommended for video and/or apps. | `2.0.0` | | `instl` | optional,integer; default 0 | `1` = interstitial/fullscreen, `0` = not interstitial. | `0` | | `tagid` | optional,string | Identifier for specific ad placement or ad tag that was used to initiate the auction. Useful for debugging or optimization. | `my__debug__tag` | | `bidfloor` | **required**,float; default 0 | Minimum bid for this impression expressed in CPM. | `0.15` | | `bidfloorcur` | optional,string; default `"USD"` | Currency (ISO-4217 alpha code). May differ from bid response currency if allowed by exchange. | `USD` | | `secure` | integer | Flag to indicate if the impression requires secure HTTPS URL creative assets and markup, where 0 = non-secure, 1 = secure. If omitted, the secure state is unknown, but non-secure HTTP support can be assumed. | 0 | | `ext` | object | Placeholder for exchange-specific extensions to OpenRTB | *(empty)* | ## Banner Object | Attribute | Type | Description | Example | |---|---|---|---| | `w` | integer | Width of the impression in pixels. If neither `wmin` nor `wmax` are specified, this value is an exact width requirement. Otherwise it is a preferred width. | `320` | | `h` | integer | Height of the impression in pixels. If neither `hmin` nor `hmax` are specified, this value is an exact height requirement. Otherwise it is a preferred height. | `50` | | `wmax` | integer | Maximum width of the impression in pixels. If included along with a `w` value then `w` should be interpreted as a recommended or preferred width. | `320` | | `hmax` | integer | Maximum height of the impression in pixels. If included along with an `h` value then `h` should be interpreted as a recommended or preferred height. | `50` | | `wmin` | integer | Minimum width of the impression in pixels. If included along with a `w` value then `w` should be interpreted as a recommended or preferred width. | `320` | | `hmin` | integer | Minimum height of the impression in pixels. If included along with an `h` value then `h` should be interpreted as a recommended or preferred height. | `50` | | `id` | string | Unique identifier for this banner object. Recommended when Banner objects are used with a Video object to represent an array of companion ads. Values usually start at 1 and increase with each object; should be unique within an impression. | `ap1gm-0jioruind-1ffopjgo1p` | | `btype` | integer array | Blocked banner ad types. | `[2]` | | `battr` | integer array | Blocked creative attributes. BidMachine currently blocks: "Expandable (User Initiated - Rollover)", "Pop (e.g., Over, Under, or Upon Exit)", "Provocative or Suggestive Imagery", "Shaky, Flashing, Flickering, Extreme Animation, Smileys", "Windows Dialog or Alert Style" | `[5,8,9,10,14]` | | `pos` | integer | Ad position on screen. | `5` | | `mimes` | string array | Content MIME types supported. BidMachine supports: `"image/png"`, `"text/javascript"`, `"text/html"`, `"image/jpg"`, `"image/gif"`. | `["image/jpg","image/gif","image/png"]` | | `topframe` | integer | Indicates if the banner is in the top frame as opposed to an iframe, where `0` = no, `1` = yes. | `1` | | `api` | integer array | List of supported API frameworks for this impression. If not explicitly listed, it is assumed not to be supported. | `[5,3]` | | `ext` | object | Placeholder for exchange-specific extensions to OpenRTB. | `{"bannertype":"rewarded"}` | ## Native | Attribute | Type | Description | Example | |---|---|---|---| | `request` | string | Request payload complying with the Native Ad Specification. | `"89oghjnr"` | | `ver` | string | Version of the Native Ad Specification to which request complies; highly recommended for efficient parsing. | `"1.0"` | | `api` | integer array | List of supported API frameworks for this impression. If not explicitly listed, assumed unsupported. | `[1]` | | `battr` | integer array | Blocked creative attributes. | `[5,3]` | ## Video | Attribute | Type | Description | Example | |---|---|---|---| | `mimes` | string array | Content MIME types supported. | `["video/mp4"]` | | `minduration` | integer | Minimum video ad duration in seconds. | `5` | | `maxduration` | integer | Maximum video ad duration in seconds. | `30` | | `protocol` | integer | Supported video bid response protocol. Use of `protocols` is recommended. At least one must be specified in either. | `[1]` | | `protocols` | integer array | Array of supported video bid response protocols. | `[1,2,6]` | | `w` | integer | Width of the video player in pixels. | `320` | | `h` | integer | Height of the video player in pixels. | `480` | | `startdelay` | integer | Indicates the start delay in seconds for pre-roll, mid-roll, or post-roll ad placements. | `1` | | `linearity` | integer | Indicates if the impression must be linear, nonlinear, etc. If none specified, assume all are allowed. | `1` | | `battr` | integer array | Blocked creative attributes. **IMPORTANT:** if you need rewarded video — send `[16]` here. | `[1,3]` | | `minbitrate` | integer | Minimum bit rate in Kbps. Exchange may set this dynamically or universally across publishers. | `128` | | `maxbitrate` | integer | Maximum bit rate in Kbps. Exchange may set this dynamically or universally across publishers. | `512` | | `playbackmethod` | integer array | Allowed playback methods. If none specified, assume all are allowed. | `[1,2,3,4]` | | `delivery` | integer array | Supported delivery methods (e.g., streaming, progressive). If none specified, assume all are supported. | `[1,2]` | | `pos` | integer | Ad position on screen. | `[3]` | | `companiodad` | object array | Array of banner objects if companion ads are available. | *(empty)* | | `api` | integer array | Supported API frameworks. If not listed, assumed unsupported. | `[1,2,3,4,5]` | | `companiontype` | integer array | Supported VAST companion ad types. Recommended if companion Banner objects are included. | `[1]` | | `ext` | object | Placeholder for exchange-specific extensions to OpenRTB. | `{"videotype": "rewarded"}` | | `ext.orientation` | optional | Forwarded verbatim from `imp.video.ext` of the upstream supply source. Not always present. BidMachine does not generate, validate, or interpret this value; DSPs must not rely on it being present or on any particular value set. | — | ## App Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string | Exchange-specific app ID. | `"102938"` | | `name` | string | App name (may be aliased at the publisher’s request). | `"TestApp"` | | `bundle` | string | Application bundle or package name (e.g., com.app.game); intended to be a unique ID across exchanges. iOS will pass the app store ID, android – the package bundle. | android: `"com.app.test"`iOS: `"78945611"` | | `domain` | string | Domain of the app. | `"game.app.com"` | | `storeurl` | string | App store URL for an installed app; for QAG 1.5 compliance. | `https://itunes.apple.com/us/app/somerandomapp/id1191231238?mt=8` | | `cat` | string array | Array of IAB content categories of the app. | `["IAB2-1", "IAB2-4"]` | | `sectioncat` | string array | Array of IAB content categories that describe the current section of the app. | `["IAB2"]` | | `pagecat` | string array | Array of IAB content categories that describe the current page or view of the app. | `["IAB2-1"]` | | `ver` | string | Application version. | `"1.0.3"` | | `privacypolicy` | integer | Indicates if the app has a privacy policy, where 0 = no, 1 = yes. | `1` | | `paid` | integer | 0 = app is free, 1 = the app is a paid version. | `1` | | `publisher` | object | Details about the Publisher of the app. | *(empty)* | | `keywords` | string | Comma separated list of keywords about the app. | `"automotive"` | | `ext` | object | Placeholder for exchange-specific extensions to OpenRTB. BidMachine sends sdk version, time of the session, session id, app uptime, number of impressions and clicks. | `{ "sdk": "2.0.0", "session_uptime": 36, "session_id": 56, "app_uptime": 31995, "impressions_count": 142, "clicks_count": 27 }` | ## Device Object | Attribute | Type | Description | Example | |---------------|---------------|----------------------------------------------------------------------------------------------------------|---------| | `ua` | string | Browser user agent string. | `"Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C89"` | | `geo` | object | Location of the device assumed to be the user’s current location defined by a Geo object. | *(empty)* | | `dnt` | integer | "Do Not Track" flag: 0 = unrestricted, 1 = do not track. | `0` | | `lmt` | integer | "Limit Ad Tracking" flag: 0 = unrestricted, 1 = limited per commercial guidelines. | `1` | | `ip` | string | IPv4 address closest to device. | `"23.227.207.23"` | | `ipv6` | string | IPv6 address closest to device. | *(empty)* | | `devicetype` | integer | The general type of device. | `4` | | `make` | string | Device make. | `"Apple"` | | `model` | string | Device model. | `"iPhone"` | | `os` | string | Device operating system. | `"iOS"` | | `osv` | string | Device operating system version. | `"10.1.3"` | | `hmw` | string | Hardware version of the device. | `"5S"` | | `h` | integer | Physical height of the screen in pixels. | `568` | | `w` | integer | Physical width of the screen in pixels. | `320` | | `ppi` | integer | Screen size in pixels per linear inch. | `326` | | `pxratio` | float | Ratio of physical pixels to device-independent pixels. | `2` | | `js` | integer | Support for JavaScript: 0 = no, 1 = yes. | `1` | | `language` | string | Browser language using ISO-639-1-alpha-2. | `"en"` | | `carrier` | string | Carrier or ISP (e.g., "VERIZON"). "WIFI" is used to indicate high bandwidth. | *(empty)* | | `connectiontype` | integer | Network connection type. | `2` | | `ifa` | string | ID sanctioned for advertiser use in the clear (i.e., not hashed). | `382A78A3-7EA0-4D3B-9724-0231C07D0C5A` | | `didsha1` | string | Hardware device ID (e.g., IMEI), hashed via SHA1. | `9db9123123b7fe382df2efeeb0176d2216cff7e` | | `didmd5` | string | Hardware device ID (e.g., IMEI), hashed via MD5. | `12f2f79bb5b7fe382df2efeeb0176da2216cff7e` | | `dpidsha1` | string | Platform device ID (e.g., Android ID), hashed via SHA1. | `a12f1479bb5b7fe382df2efeeb0176d16cff7e` | | `dpidmd5` | string | Platform device ID (e.g., Android ID), hashed via MD5. | `12sff9bb5b7fe382df2efeeb0176d2216cff7e` | | `macsha1` | string | MAC address of the device, hashed via SHA1. | `12sff9bb5b7fe382df2efeeb0176d2216cff7e` | | `macmd5` | string | MAC address of the device, hashed via MD5. | `12sff9bb5b7fe382df2efeeb0176d2216cff7e` | | `ext` | object | Placeholder for exchange-specific extensions. BidMachine sends info about battery state and rooted flag. | `{"battery": -100, "rooted": "false"}` | ## User Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string | Exchange-specific ID for the user. At least one of `id` or `buyerid` is recommended. | `"1"` | | `buyerid` | string | Buyer-specific ID for the user as mapped by the exchange for the buyer. At least one of `buyerid` or `id` is recommended. | `"1"` | | `yob` | integer | Year of birth as a 4-digit integer. | `1984` | | `gender` | string | Gender, where `"M"` = male, `"F"` = female, `"O"` = other. *(Omitted means unknown)* | `"O"` | | `keywords` | string | Comma-separated list of keywords, interests, or intent. | `"game"` | | `geo` | object | Location of the user’s home base defined by a Geo object. This is not necessarily their current location. | *(empty)* | | `data` | object array | Additional user data. Each Data object represents a different data source. | *(empty)* | | `ext` | object array | Placeholder for exchange-specific extensions to OpenRTB. | `{"consent" : "1"}` | ## Data Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string | Exchange-specific ID for the data provider. | `"2"` | | `name` | string | Exchange-specific name for the data provider. | `"test"` | | `segment` | object array | Array of Segment objects that contain the actual data values. | *(empty)* | ## Segment Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string | ID of the data segment specific to the data provider. | `"12"` | | `name` | string | Name of the data segment specific to the data provider. | `"address"` | | `value` | string | String representation of the data segment value. | `"Delaware, Wilmington, 19809, United States"` | ## Geo Object | Attribute | Type | Description | Example | |-------------|---------|-------------|---------| | `lat` | float | Latitude from -90.0 to +90.0, where negative is south. | `15` | | `lon` | float | Longitude from -180.0 to +180.0, where negative is west. | `30` | | `type` | integer | Source of location data; recommended when passing lat/lon. | `2` | | `country` | string | Country code using ISO-3166-1-alpha-3 | `"USA"` | | `region` | string | Region code using ISO-3166-2; 2-letter state code if USA. | `"US"` | | `city` | string | City using United Nations Code for Trade & Transport Locations. See Appendix A for a link to the codes. | `"New York"` | | `zip` | string | Zip or postal code. | `"19809"` | | `utcoffset` | integer | Local time as the number +/- of minutes from UTC. | `180` | ## Publisher Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string | Exchange-specific publisher ID. | `"12"` | | `name` | string | Publisher name (may be aliased at the publisher’s request). | `"test_name"` | | `cat` | string array | Array of IAB content categories that describe the publisher. | `["IAB2-1"]` | | `domain` | string | Highest level domain of the publisher. | `"publisher.com"` | ## GDPR | Parameter | Type | Values | Example Values | |---|---|---|---| | `regs.ext.gdpr` | integer | `0`: GDPR does not apply to this traffic `1`: GDPR applies to this traffic | `0` | | `user.ext.consent` | string | Consent string per [IAB TCF spec](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/a32574941ce201708e30e78702278efe1ce6cd59/Consent%20string%20and%20vendor%20list%20formats%20v1.1%20Final.md). Also supports:`"0"`: consent NOT given`"1"`: consent given | `"BOJObISOJObISAABAAENAA4AAAAAoAAA"` | ## Regs | Attribute | Type | Description | Example | |---|---|---|---| | `coppa` | integer | Flag indicating if this request is subject to COPPA regulations (USA FTC), where `0` = no, `1` = yes. | `1` | | `ext` | object | Extension for GDPR information. | `{ "gdpr": 0 }` | ## Source Object | Attribute | Type | Description | Example | |---|---|---|---| | `fd` | int | Entity responsible for the final impression sale decision, where `0` = exchange, `1` = upstream source. | `1` | | `tid` | string | Transaction ID that must be common across all participants in this bid request (e.g., potentially multiple exchanges). | `6ba06f9a-44c8-497d` | | `pchain` | optional,string | Payment ID chain string containing embedded syntax described in the TAG Payment ID Protocol v1.0. Pass-through field: sent only when the upstream supply source provides it, so DSPs must not rely on it being present. | `7tury102i-7uf7` | | `ext` | object | Placeholder for exchange-specific extensions to OpenRTB. | *(empty)* | ## Source Ext Object :::info `ext` object is used to provide schain info. It goes under source.ext.schain path ::: | Attribute | Type | Description | Example | |---|---|---|---| | `ext.schain` | object | This object represents both the links in the supply chain as well as an indicator whether or not the supply chain is complete. | *(empty)* | ## Schain Object Properties :::info For more information please refer to official [IAB documentation](https://github.com/InteractiveAdvertisingBureau/openrtb/blob/master/supplychainobject.md) ::: | Attribute | Type | Description | Example | |---|---|---|---| | `complete` | integer | Flag indicating whether the chain contains all nodes involved in the transaction leading back to the owner of the site, app or other medium of the inventory, where `0` = no, `1` = yes. | `1` | | `nodes` | object array | Array of SupplyChainNode objects in the order of the chain. In a complete supply chain, the first node represents the initial advertising system and seller ID involved in the transaction. In an incomplete supply chain, it represents the first known node. The last node represents the entity sending this bid request. | *(empty)* | | `ver` | string | Version of the supply chain specification in use, in the format of `"major.minor"` (e.g., `"1.0"`). | `"1.0"` | | `ext` | object | Placeholder for advertising-system specific extensions to this object. | *(empty)* | ## Nodes Object Properties | Attribute | Type | Description | |---|---|---| | `asi` | string | The canonical domain name of the SSP, Exchange, Header Wrapper, etc., that bidders connect to. This may differ from the parent corporate domain to support WHOIS and reverse IP lookups. Should match the value used in `ads.txt` if available. | | `sid` | string | Identifier for the seller/reseller account within the advertising system. Typically maps to `publisher.id` in OpenRTB or the publisher’s org ID in OpenDirect. Max length: 64 characters. | | `rid` | string | The `request.id` as issued by this seller. | | `name` | string | Legal company name paid for inventory. Should be omitted if listed in `sellers.json`. *(optional)* | | `domain` | string | Business domain of the represented entity. Should be omitted if listed in `sellers.json`. *(optional)* | | `hp` | integer | Indicates if this node is involved in payment flow. `1` = involved, `0` = not involved. Required in version 1.0; future versions may support non-payment nodes. | | `ext` | object | Placeholder for system-specific extensions. | ## User Contextual Data :::note User Level Contextual Data is defined by the SDK but can be overwritten by an App/Mediation via the SDK API ::: | Name | Type | Description | Example | |------|------|-------------|---------| | `request.context.user.ext.impdepth` | uint32 | The count of impressions for a specific placement type in a given app session. **Deprecated in 3.0.0** | `5` | | `request.context.user.ext.sessionduration` | uint64 | The total duration of time a user has spent so far in a specific app session expressed in seconds. | `55` | | `request.context.user.ext.lastbundle` | string | The last app bundle the user saw on the previous impression in a given session per placement type. **Deprecated in 3.0.0** | `"bundle"` | | `request.context.user.ext.lastadomain` | string | The last advertiser domain the user saw on the previous impression in a given session per placement type. **Deprecated in 3.0.0** | `"domain"` | | `request.context.user.ext.clickrate` | float | The percentage of clicks/impressions per user per placement type over a given number of impressions, where 5 represents a 5% CTR. Applies only to Rewarded and Video. **Deprecated in 3.0.0** | `5` | | `request.context.user.ext.lastclick` | bool | Indicates if the user clicked on the last impression, where `1` = clicked, `0` = didn’t click. **Deprecated in 3.0.0** | `1` | | `request.context.user.ext.completionrate` | float | Percentage of completions/impressions per user for a given number of impressions, where 70 represents 70% completion. **Deprecated in 3.0.0** | `70` | ## Device Contextual Data | Name | Type | Description | Example | |------|------|-------------|---------| | `request.context.device.ext.inputlanguage` | list[string] | List of user languages. | `["DE", "US"]` | | `request.context.device.ext.diskspace` | double | Value of available free disk space. | `61347.0` | | `request.context.device.ext.totaldisk` | double | Value of total disk space. | `112221.0` | | `request.context.device.ext.ringmute` | bool | Device sound setting at ad request time. | `1 - yes`, `0 - no` | | `request.context.device.ext.charging` | bool | Is the device charging. | `1 - yes`, `0 - no` | | `request.context.device.ext.batterylevel` | float | Battery level. `1` - full charge, `0.1` - 10%, `0` - empty. | — | | `request.context.device.ext.batterysaver` | bool | Battery saver enabled. | `1 - yes`, `0 - no` | | `request.context.device.ext.darkmode` | bool | Dark mode enabled. | `1 - yes`, `0 - no` | | `request.context.device.ext.airplane` | bool | (Android only) Airplane mode enabled. | `1 - yes`, `0 - no` | | `request.context.device.ext.dnd` | bool | (Android only) "Do Not Disturb" setting enabled. | `1 - yes`, `0 - no` | | `request.context.device.ext.devicename` | string | User-defined name of the device. | `iPhone 14 Pro` | | `request.context.device.ext.time` | uint64 | POSIX timestamp, depends on device settings. | `1680197719.5890589` | | `request.context.device.ext.headset` | bool | Is a wired headset connected. | `1 - yes`, `0 - no` | | `request.context.device.ext.headsetname` | string | Identifier of connected wireless headset. | `"Headset"` | | `request.context.device.ext.screenbright` | double | Brightness level of screen from 0.0 to 1.0. | `0...1` | | `request.context.device.ext.jailbreak` | bool | Is the device jailbroken. | `1 - yes`, `0 - no` | | `request.context.device.ext.lastbootup` | uint64 | Android: ms since boot incl. sleep. iOS: POSIX timestamp of last boot. | `1676623341.589673` | | `request.context.device.ext.totalmem` | uint64 | Total RAM in bytes. | `34359738368 B` | | `request.context.device.ext.atts` | int | App tracking authorization status: `0` - Not Determined, `1` - Restricted, `2` - Denied, `3` - Authorized. Sent on any OS when supplied by the SDK or supply source. | — | ## App Contextual Data | Name | Type | Description | Example | |------|------|-------------|---------| | `request.context.app.ext.install_time` | uint64 | Unix timestamp in milliseconds of the application install (might be zero). **Available since SDK 3.0.1** | `0.0` | | `request.context.app.ext.first_launch_time` | uint64 | Unix timestamp in milliseconds of the first BidMachine SDK launch. **Available since SDK 3.0.1 and data can be incorrect for devices updated from older app/sdk version** | `1.725296223359E12` | | `request.context.app.ext.min_api_level` | uint32 | (Android only) Minimal supported Android SDK version. | `21` | | `request.context.app.ext.kotlin_version` | string | Kotlin runtime version. | `1.8.20` | --- ## Bid Response Examples ## Banner Bid Response
Banner Bid Response Example ```json title="Banner Bid Response" { "cur": "USD", "id": "eb85349d-03c3-44f4-a77b-824f7221d116", "seatbid": [ { "bid": [ { "adid": "1378ygfvn928ouyghf19oiuhg03r", "adm": "", "adomain": [ "adomain.com" ], "cid": "iy4wuygh7i3rukgh91ol", "crid": "iy4wuygh7i3rukgh91ol_123124", "ext": { "imptrackers": [ "https://tracker1.com/ad?price=${AUCTION_PRICE}&cur=${AUCTION_CURRENCY}", "https://tracker1.com/ad?avid=[ADVERTISER_ID]&pricePaid=[PRICE_PAID]&priceBid=[BID_PRICE]" ] }, "id": "1fwdsg1gdsgwfdb", "impid": "23fsdfsdg-12312fds-44f4-12dfsfa-824f7221d116", "nurl": "http://example.com/win/1378ygfvn928ouyghf19oiuhg03r?won=${AUCTION_PRICE}&impid={AUCTION_IMP_ID}&auction=${AUCTION_ID}&bidid=${AUCTON_BID_ID}", "price": 1.1200 } ], "seat": "772" } ] } ```
## Interstitial Bid Response ### HTML Interstitial Example
HTML Interstitial Bid Response Example ```json title="Interstitial Bid Response" { "cur": "USD", "id": "eb85349d-03c3-44f4-a77b-824f7221d116", "seatbid": [ { "bid": [ { "adid": "121rf13gdsf12gdsg", "adm": "", "adomain": [ "adomain.com" ], "cid": "iy4wuygh7i3rukgh91ol", "crid": "iy4wuygh7i3rukgh91ol_123124", "ext": { "imptrackers": [ "https://tracker1.com/ad?price=${AUCTION_PRICE}&cur=${AUCTION_CURRENCY}", "https://tracker1.com/ad?avid=[ADVERTISER_ID]&pricePaid=[PRICE_PAID]&priceBid=[BID_PRICE]" ] }, "id": "1fwdsg1gdsgwfdb", "impid": "23fsdfsdg-12312fds-44f4-12dfsfa-824f7221d116", "nurl": "http://example.com/win/121rf13gdsf12gdsg?won=${AUCTION_PRICE}&impid={AUCTION_IMP_ID}&auction=${AUCTION_ID}&bidid=${AUCTON_BID_ID}", "price": 1.1200 } ], "seat": "772" } ] } ```
### MRAID Interstitial Example
MRAID Interstitial Bid Response Example ```json title="Interstitial Bid Response" { "ext": { "impTrackers": [ "http://imp.url/?type=IMPRESSION&bidRequestId=${AUCTION_ID}&winPrice=${AUCTION_PRICE}" ] }, "id": "324ca3eb-295d-4da4-8956-d7945572f068", "seatbid": [ { "bid": [ { "adm": " ", "adomain": [ "9nl.org" ], "cid": "campaign123-ads216-campaign", "crid": "5081233", "id": "324ca3eb-295d-4da4-8956-d7945572f068:1", "impid": "1", "nurl": "http://bit.ly/2u4sBuo?bidRequestId=${AUCTION_ID}&winPrice=${AUCTION_PRICE}", "price": 1.613 } ], "seat": "0" } ] } ```
### MRAID Playable Interstitial Example
MRAID Playable Interstitial Bid Response Example ```json title="MRAID Playable Bid Response" { "cur": "USD", "id": "5cfeb1d3-0498-4ba0-8806-db66a861dd34", "seatbid": [ { "bid": [ { "adid": "85593_27327", "adm": "Connecting to Game Server...Connecting to Game Server...", "adomain": [ "adomain.com" ], "attr": [ 13 ], "cat": [ "IAB9-30" ], "cid": "cid_123", "crid": "crid_123", "ext": { "crtype": "MRAID playable" }, "id": "beeaf85a-c022-4678-80be-0e500f4643d7_171110-14__206", "impid": "f3832082-ae9b-456a-b5f6-0792db707d50", "iurl": "http://image.url/image.jpg", "nurl": "https://node206.fractionalmedia.com/win2_notice_bin?bid_id=beeaf85a-c022-4678-80be-0e500f4643d7_171110-14__206&cid=85593&settlement=${AUCTION_PRICE}", "price": 30.0 } ] } ] } ```
## Video Bid Response ### Simple VAST Bid Response Example
VAST Bid Response Example ```json title="VAST Bid Response" { "bidid": "6df766aa-367a-4b9b-8054-3cf3ed116868", "cur": "USD", "id": "7d3ad9c0_5289e2a8-45a9-4a3c-b71f-144186d6ce05", "seatbid": [ { "bid": [ { "adid": "24857", "adm": "\n \n \n Exebid.DCA\n \n \n \n \n \n \n 00:00:28\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", "adomain": [ "microsoft.com" ], "attr": [ 16 ], "cat": [ "IAB9-30" ], "cid": "4146", "crid": "24857", "crtype": "VAST 2.0", "h": 360, "id": "BB876A0B-E9AB-4E49-109A-AF38D0909379", "impid": "1", "nurl": "https://example.bid/win?ic_id=6df766aa-367a-4b9b-8054-3cf3ed116868&return=vast&win_price=${AUCTION_PRICE}&exchange_noise=", "price": 1.3895836807293, "w": 640 } ], "seat": "140" } ] } ```
### VAST with MRAID Playable Companion Bid Response Example
VAST with MRAID Playable Companion Bid Response Example ```json title="VAST Bid Response" { "id": "29e8574f-1add-423a-a083-e47c5623841f", "seatbid": [ { "bid": [ { "adid": "255", "adm": "2.000:00:22 ]]> http://google.com ", "adomain": [ "www.adomain.com" ], "attr": [ 6 ], "cat": [ "IAB1-4", "IAB1-5" ], "cid": "campaign178-ads263", "crid": "banner1", "h": 360, "id": "29e8574f-1add-423a-a083-e47c5623841f:1", "impid": "1", "iurl": "https://i.url/image.jpg", "nurl": "http://wintracking.url:8766/?bidRequestId=${AUCTION_ID}&winPrice=${AUCTION_PRICE}", "price": 1.833, "w": 480 } ], "seat": "0" } ] } ```
## Native Ad Bid Response
Native Ad Bid Response Example ```json title="Native Ad Bid Response" { "bidid": "3992480bfea3c39d6395ff8f3e8815418d4caac5c69152f457f4884d", "cur": "USD", "id": "9ebb0958-2262-4089-97e0-0c64ca47c6da1475643469279", "seatbid": [ { "bid": [ { "adm": "{\"native\":{\"assets\":[{\"id\":123,\"title\":{\"text\":\"Appreciate\"}},{\"id\":124,\"img\":{\"h\":80,\"url\":\"http://z.tpbid.com/ssb/1/images/31ff0db2743c3d3150a002173c99d67f.png\",\"w\":80}},{\"id\":128,\"img\":{\"h\":627,\"url\":\"http://z.tpbid.com/ssb/1/images/abf50143ac85610407a17f72be03e388.jpg\",\"w\":1200}},{\"data\":{\"value\":\"Discover great apps!\"},\"id\":127},{\"data\":{\"value\":\"4.5\"},\"id\":7},{\"data\":{\"value\":\"INSTALL\"},\"id\":8}],\"imptrackers\":[\"http://appodeal.herokuapp.com/imp/native/abb0dea1?bid_id=3992480bfea3c39d6395ff8f3e8815418d4caac5c69152f457f4884d&price=${AUCTION_PRICE}&eaid=${AUCTION_ID}&as=1&exp_uuid=8b02940ac60ee55c1936eef123ffbc24\"],\"link\":{\"url\":\"http://test.tpbid.com/click?bid_id=3992480bfea3c39d6395ff8f3e8815418d4caac5c69152f457f4884d&ep0=yB1&ep1=VxdPKlaf&cf=1&redirect_to=https%3a%2f%2fplay.google.com%2fstore%2fapps%2fdetails%3fid%3dcom.triapodi.apprec%26bid_id%3dus-3992480bfea3c39d6395ff8f3e8815418d4caac5c69152f457f4884d\"}}}", "adomain": [ "triapodi.com" ], "bundle": "com.triapodi.apprec", "cid": "1_f7e7c50d874690515cebae47f2d6fb2c", "crid": "1_75deab27575de8b261aedc57fd02caf4", "h": 0, "id": "1", "impid": "1", "iurl": "http://z.tpbid.com/ssb/1/images/abf50143ac85610407a17f72be03e388.jpg", "nurl": "http://appodeal.herokuapp.com/nurl", "price": 10.882, "w": 0 } ] } ] } ```
--- ## Macroses :::note BidMachine Exchange currently works with OpenRTB 2.5. ::: | Macro | Description | | ------------------------------------------- | ------------------------------------------------------------------------------------------------ | | ``${AUCTION_ID}`` | ID of the bid request (from `BidRequest.id`). | | ``${AUCTION_BID_ID}`` | ID of the bid (from `BidResponse.id`). | | ``${AUCTION_IMP_ID}`` | ID of the impression won (from `imp.id`). | | ``${AUCTION_SEAT_ID}`` | ID of the bidder seat. | | ``${AUCTION_AD_ID}`` | ID of the ad markup to serve (from `bid.adid`). | | ``${AUCTION_PRICE}`` | Settlement price (same currency and units as the bid). | | ``${AUCTION_CURRENCY}`` | Currency of the bid; for confirmation purposes. | | ``${AUCTION_MBR}`` | Market Bid Ratio (clearance price ÷ bid price). | | ``${AUCTION_LOSS}`` | Loss reason code (see Loss Reason Codes). | | ``${AUCTION_MINIMUM_BID_TO_WIN}``, ``${AUCTION_MIN_TO_WIN}`` | Minimum bid required to win the auction. | --- ## Bid Response Specification | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string; required | ID of the bid request to which this is a response. | `"eb85349d-03c3-44f4-a77b-824f7221d116"` | | `seatbid` | object array | Array of seatbid objects; 1+ required if a bid is to be made. | *(empty)* | | `bidid` | string | Bidder generated response ID to assist with logging/tracking. | `"1asd24ht3hg0-fk1pmfflkdmsfk-12flkfdfd"` | | `cur` | string; default "USD" | Bid currency using ISO-4217 alpha codes. | `"USD"` | | `nbr` | integer | Reason for not bidding. | `1` | ## Seatbid Object | Attribute | Type | Description | Example | |---|---|---|---| | `bid` | object array; required | Array of 1+ Bid objects each related to an impression. Multiple bids can relate to the same impression. | *(empty)* | | `seat` | string | ID of the bidder seat on whose behalf this bid is made. | `"123"` | | `group` | integer; default 0 | `0` = impressions can be won individually; `1` = impressions must be won or lost as a group. | `0` | ## Bid Object | Attribute | Type | Description | Example | |---|---|---|---| | `id` | string; required | Bidder generated bid ID to assist with logging/tracking. | `"1fwdsg1gdsgwfdb"` | | `impid` | string; required | ID of the Imp object in the related bid request. | `"23fsdfsdg-12312fds-44f4-12dfsfa-824f7221d116"` | | `price` | float; required | Bid price expressed as CPM. Integer math is recommended for currencies. | `1.15` | | `adid` | string | ID of a preloaded ad to be served if the bid wins. | `"1378ygfvn928ouyghf19oiuhg03r"` | | `nurl` | string | Win notice URL called if the bid wins. | `http://example.com/win/...?won=${AUCTION_PRICE}` | | `lurl` | string | Loss notice URL called when a bid is lost. | `http://example.com/loss/...?final_price=${AUCTION_PRICE}` | | `adm` | string | Ad markup in case of win (supersedes nurl if both present). | `"AD"` | | `adomain` | string array; required | Advertiser domains (for blocklist checking). | `["test-domain.com"]` | | `bundle` | string | App bundle being advertised. | `android: "com.test.app", iOS: "8120398"` | | `iurl` | string | Image URL for ad quality/safety checking. | `http://example.com/i/...` | | `cid` | string | Campaign ID. | `"12341"` | | `crid` | string | Creative ID. | `"231"` | | `cat` | string array | IAB content categories of the creative. | `["IAB3-1"]` | | `attr` | integer array | Creative attributes. | `[1,2,13]` | | `h` | integer | Height of the creative in pixels. | `480` | | `w` | integer | Width of the creative in pixels. | `320` | | `ext` | object; optional | Bidder-specific extensions. `ext.imptrackers` is a BidMachine extension carrying impression tracking URLs. | `{"imptrackers": ["https://..."]}` | | `burl` | string; optional | Standard OpenRTB billing notice URL, called by the exchange when the impression occurs. | `http://example.com/bill_imp/...` | :::note `bid.burl` and `bid.ext.imptrackers` are interchangeable: the exchange reads and processes both, neither is required, and a DSP may send either one or both. Using only one of them does not break tracking. See [nURL and Impression Tracking Schemes](/dsp/other/nurl-and-impression-tracking-schemes) for the exact firing order per ad type. ::: :::note BidMachine does not expect and does not accept any rendering-experience confirmation field in the bid response. There is no field for a DSP to report which video experience (`placement`, `plcmt`, or `linearity`) was actually rendered. `crtype` is populated by BidMachine itself on the supply-facing side of the exchange and is derived from the placement type. It is not a DSP-facing bid response field: DSPs do not populate it, and the exchange does not read it from a bid response. ::: --- ## CTR Templates import './ctr-templates.css'; import Image from '@theme/IdealImage'; export const Arrow = () => ( ); export const Stage = ({src, title, sub}) => ( {`${title} {title}{sub} ); Over the past few years, BidMachine has introduced new ad templates and rendering improvements to enhance the user experience and increase engagement. These changes have a direct impact on how users interact with ads and on the resulting CTR levels. We recognize that transparency is essential in the relationship between BidMachine and DSPs. For that reason, we provide partners with a **clear view of how ads are presented** to users, along with a programmatic way to **control the experience**. Ad experiences Every template that can be served, from the most conservative to the highest-engagement flows. Measured CTR ranges Ranges observed across billions of impressions, so you know what to expect for each template. Programmatic controls The bid-response signal that lets you adjust the experience to your campaign objectives. ## Fullscreen video ad format {#fullscreen-video} Five templates form a ladder from the most conservative rendering to the highest-engagement, multi-stage flow. Each is selected with the `campaign_type` signal in the bid response.
01 Low CTR template The most conservative template from a CTR perspective. CTR rangeBelow 5% Bid response signal campaign_type: low_ctr UI details Only video is displayed Close time: 0s Ad is immediately skippable Close button size: big Fullscreen clickability disabled Interacting with the video pauses or resumes it Only the small “learn more” button is clickable
02 Baseline template Keeps the ad experience as close as possible to the original creative. CTR range5–15%depending on creative Bid response signal campaign_type: baseline_ctr UI details Only video is displayed Close time: 5s Close button size: medium Fullscreen clickability disabled Interacting with the video pauses or resumes it Only the small “learn more” button is clickable
03 Mid CTR template Introduces a multi-stage experience by supporting the end card. CTR range15–25%depending on creative Bid response signal campaign_type: mid_ctr UI details Both video and end card (when available) are displayed Close time: 5s Close button size: medium Fullscreen clickability enabled Interacting with the video initiates the click rather than pausing/resuming “Learn more” button not displayed Experience flow
04 High CTR template Enriches the flow with two new touchpoints: a 2nd end card and a custom CTA. CTR range25–35%depending on creative Bid response signal campaign_type: high_ctr Requires bid.bundle presence. UI details Both video and end card are displayed Close time: 10s Close button size: small Fullscreen clickability enabled Interacting with the video initiates the click rather than pausing/resuming “Learn more” button not displayed A 2nd end card is generated and added as a 3rd stage Video + 1st end card + 2nd end card A persistent CTA is generated and displayed above the video Experience flow
05 Highest CTR template Mainly enables the skip-to-store feature — ideal for app-install campaigns. CTR rangeAbove 60% Bid response signal campaign_type: highest_ctr Requires bid.bundle presence. UI details Both video and end card are displayed Close time: 10s Close button size: small Fullscreen clickability enabled Interacting with the video initiates the click rather than pausing/resuming “Learn more” button not displayed A 2nd end card is generated and added as a 3rd stage Video + 1st end card + 2nd end card A persistent CTA is generated and displayed above the creative Skip-to-store feature enabled It uses native components such as SKProductView (SKPV) on iOS, so the user is not redirected outside the host app and can download the advertised bundle without any friction. Experience flow
## Rewarded fullscreen video ad format {#rewarded-video} For the rewarded fullscreen video ad format, we follow the same configuration described above. The only difference is the overall duration of the ad experience: always 30s before becoming closeable. CTR is on average higher than for non-rewarded video, but still falls within the ranges above. ## Fullscreen HTML / MRAID ad types {#mraid} For HTML / MRAID creatives, the templates differ mainly in close timing, close-button size, and the close-to-store behavior.
01 Low CTR templateThe most conservative template from a CTR perspective. CTR rangeBelow 5%depending on creative Bid response signalcampaign_type: low_ctr UI detailsClose time: 0sClose button size: big
02 Mid CTR templateChanges the close time and the close-button size. CTR range5–10%depending on creative Bid response signalcampaign_type: mid_ctr UI detailsClose time: 5sClose button size: medium
03 High CTR templateChanges the close time and the close-button size. CTR range10–20%depending on creative Bid response signalcampaign_type: high_ctr UI detailsClose time: 10sClose button size: small
04 Highest CTR templateAdds the close-to-store feature. CTR rangeAbove 70% Bid response signalcampaign_type: highest_ctr UI detailsClose time: 10sClose button size: smallClose-to-store enabled User is redirected to the landing page when the ad is closed
## Fullscreen rewarded HTML / MRAID ad types {#rewarded-mraid} The rewarded HTML / MRAID variants extend the close time to satisfy the reward requirement while keeping the same close-button progression.
01 Low CTR templateThe most conservative template from a CTR perspective. CTR rangeBelow 7%depending on creative Bid response signalcampaign_type: low_ctr UI detailsClose time: 30sClose button size: big
02 Mid CTR templateChanges the close time and the close-button size. CTR range7–13%depending on creative Bid response signalcampaign_type: mid_ctr UI detailsClose time: 30sClose button size: medium
03 High CTR templateChanges the close time and the close-button size. CTR range14–20%depending on creative Bid response signalcampaign_type: high_ctr UI detailsClose time: 30sClose button size: small
04 Highest CTR templateAdds the close-to-store feature. CTR rangeAbove 70% Bid response signalcampaign_type: highest_ctr UI detailsClose time: 30sClose button size: smallClose-to-store User is redirected to the landing page when the ad is closed
## Bid response sample {#bid-response-sample} The template is selected through the `campaign_type` field inside `seatbid.bid.ext` of the bid response. ```json title="bid-response.json" {10} { "id": "...", "seatbid": [ { ... "bid": [ { ... "ext": { "campaign_type": "highest_ctr" } } ] } ], ... } ``` --- ## Deep Linking Deep linking is a powerful technique that enhances user engagement and improves campaign performance. It allows advertisers to direct users straight to specific pages or content within an app. ## How Deep Linking Works ### Installed App If a user has already installed the advertised app, the deep link URL will seamlessly navigate them to the desired in-app destination — such as: - A product page - A specific level in a game - A relevant content section ### App Not Installed If the user doesn't have the app installed, the deep link will utilize a **fallback mechanism** to guide them to the next best action defined by the advertiser — such as: - Redirecting to the App Store / Google Play Store - Opening an optimized mobile landing page ## Identifying Eligible Supply Impressions that support deep linking are flagged directly on `imp.ext`: ```json "imp": [ { "ext": { "deeplink": 1, "fallback": 1 } } ] ``` | Field | Type | Description | |------------|---------|-------------------------------------------------------------------------------------| | `deeplink` | integer | `1` — the impression supports opening a deep link on click | | `fallback` | integer | `1` — the impression supports a fallback destination when the target app is missing | Both fields are always sent together with the value `1`. They are never sent as `0` — their **absence** means the impression is not deep-link eligible. An impression is flagged when both of the following are true: - it carries a `banner` (including MRAID) or `video` object — native-only impressions are not flagged; - the request comes from BidMachine SDK **3.2.0 or newer**. The flag applies to **all** delivery options described below. :::note These fields sit at the top level of `imp.ext`, alongside `skadn`, `gpid` and other impression extensions — they are not nested inside a `deeplink` object. ::: ## Delivery Options ### 1. Plain deep link URL Pass the deep link directly in the creative's click-through — the VAST `ClickThrough` and `CompanionClickThrough` elements for video, or the standard click URL for display / MRAID creatives. No allowlisting, registration or other additional steps are required. Both of the following are supported: - **Custom URI schemes** — for example `temu://`, `shein://`, `shopee://`, `aliexpress://`, `creditkarma://`, `walmart://`, `tiktok://`, and any other application scheme. - **HTTP(S)-based deep links** — services such as AppsFlyer OneLink, URLGenius and comparable providers. Use one of the options below instead if you need explicit control over the fallback destination or over primary / fallback tracking. ### 2. `deeplinker://` scheme Encode the deep link fields as query parameters of a `deeplinker://navigate` URL, and place that URL in the VAST `ClickThrough` and, if an end card is included, the `CompanionClickThrough` elements. Display / MRAID creatives use the same URL as their click-through. ```text deeplinker://navigate? primaryUrl=customapp%3A%2F%2Flink& primaryTrackingUrl=http%3A%2F%2Fpx.url.com%2FtrackPrimaryClicked& fallbackUrl=http%3A%2F%2Fwww.url.com& fallbackTrackingUrl=http%3A%2F%2Fpx.url.com%2FtrackFallbackClicked ``` :::warning Format The protocol (`deeplinker://`) and host path (`navigate`) are mandatory, and all parameter values must be URL-encoded. ::: ### 3. `bid.ext` fields Pass the deep link as discrete fields on the bid extension, instead of encoding them into a URL: ```json "bid": [ { "ext": { "deeplink": "customapp://link", "primary_tracking": "http://px.url.com/trackPrimaryClicked", "fallback": "http://www.url.com", "fallback_tracking": "http://px.url.com/trackFallbackClicked" } } ] ``` | Field | Required | Description | |---------------------|----------|--------------------------------------------------------------------------------| | `deeplink` | yes | Deep link to another application potentially installed on the user device | | `primary_tracking` | no | Upon successful opening of the deep link, a GET request is sent to this URL | | `fallback` | no | Link to a webpage if the desired app is not installed on the device | | `fallback_tracking` | no | Upon successful opening of the fallback URL, a GET request is sent to this URL | `deeplink` is mandatory — if it is absent, the remaining three fields are ignored and no deep link is applied to the bid. URLs in `bid.ext` are passed as-is and must **not** be URL-encoded. :::warning Same names, different meaning `deeplink` and `fallback` appear on both sides of the transaction with different types: - on `imp.ext` (bid request) they are **integer flags** signalling eligibility; - on `bid.ext` (bid response) they are **URL strings** carrying the destinations. ::: ## `deeplinker://` Query Parameters Used by the `deeplinker://navigate` scheme described above: | Parameter | Description | |---------------------|-----------------------------------------------------------------------------| | `primaryUrl` | Deep link to another application potentially installed on the user device | | `primaryTrackingUrl`| Upon successful opening of the primary URL, a GET request is sent to this URL | | `fallbackUrl` | Link to a webpage if the desired app is not installed on the device | | `fallbackTrackingUrl`| Upon successful opening of the fallback URL, a GET request is sent to this URL | ::: --- ## iOS Specifics import SKAdNetwork from "@site/src/components/mdx/skadnetwork"; import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; ## Introduction Due to the IDFA changes Apple is implementing in iOS 14 and later, BidMachine is adding support for Apple's [SKAdNetwork](https://developer.apple.com/documentation/storekit/skadnetwork) attribution. This integration enables our programmatic demand buyers to track installs and conversions on iOS 14+ when IDFA is unavailable. In addition to SKAdNetwork, BidMachine will provide contextual advertising data to help partners enhance targeting and modeling. Below is an overview of how the integration works at the app/publisher level and the data flow during the auction. ## SKStoreProductViewController SKStoreProductViewController (SKPV) is the preferred method for handling click URLs within the BidMachine SDK. The SDK employs the following prioritized approach to process and present ad clicks: 1. **SKAdNetwork Parameter Handling**: When an ad response contains SKAdNetwork parameters, the SDK prioritizes these parameters to present SKPV, bypassing the click URL entirely. 2. **Click URL Processing**: In the absence of SKAdNetwork parameters, the SDK processes the click URL through the following steps: - **App Store Link Detection**: The SDK analyzes the click URL's scheme (`itms://`) and host to determine if it references the App Store. If validated as an App Store link, the SDK extracts the app bundle identifier and presents it using SKPV. - **HTTP/HTTPS Redirect Resolution**: For HTTP/HTTPS URLs, the SDK performs a silent GET request to resolve all redirects and identify the final destination. - **Final Destination Validation**: The SDK applies the same App Store link detection logic to the resolved destination URL. 3. **Fallback Behavior**: If the final destination is not an App Store link, or if SKPV presentation fails for any reason, the SDK defaults to opening the URL in the device's default browser. ## SKAdNetwork Here is a high-level overview of how SKAdNetwork works in the context of BidMachine: ```mermaid sequenceDiagram participant DSP participant BidMachine participant Publisher as Direct Publisher/SSP %% Integration phase opt Integration DSP ->> BidMachine: SKAdNetworkIdentifier BidMachine ->> Publisher: All SKAdNetworkIdentifiers end %% Auction phase opt Auction Publisher ->> BidMachine: Ad request note left of Publisher: • SKAdNetwork request data• IDs• Contextual data BidMachine ->> DSP: Bid request note left of BidMachine: • SKAdNetwork request data• IDs• Contextual data DSP -->> BidMachine: Bid response note right of DSP: • SKAdNetwork response data• Bid response BidMachine -->> Publisher: Ad response note right of BidMachine: • SKAdNetwork response data• Ad response end ``` ### SKAdNetwork IDs Partners who wish to use BidMachine's SKAdNetwork solution should share their SKAdNetwork ID with their account manager. If you don't have an account manager, register with Apple [here](https://developer.apple.com/documentation/storekit/skadnetwork/registering_an_ad_network). BidMachine will provide publishers with an integration guide listing all SKAdNetwork IDs to add to their `Info.plist`.
SKAdNetwork IDs in Info.plist format
### Bid Request BidMachine adds the following fields to BidRequests on iOS 14+ versions, categorized below: | Object | Attribute | Description | Type | Example | | ---------------------------- | ----------- | ------------------------------------------------------------------------------------------- | --------- | --------------------------------------------------- | | `imp.ext.skadn` | `version` | SKAdNetwork SDK version (`"2.0"` or higher). Deprecated in favor of `versions` since 2.1. | `string` | `"2.0"` | | `imp.ext.skadn` | `versions` | Supported SKAdNetwork versions (array of strings). | `string[]`| `["2.0","2.1","2.2"]` | | `imp.ext.skadn` | `sourceapp` | Publisher app ID in Apple App Store (matches `app.bundle`). | `string` | `"1232526187"` | | `imp.ext.skadn` | `overlay` | Flag indicating SKOverlay support (`0` or `1`). | `integer` | `1` | | `imp.ext.skadn` | `autostore` | Flag indicating AutoStore support (`0` or `1`). | `integer` | `1` | | `imp.ext.skadn` | `skadnetids`| Subset of SKAdNetwork IDs (from `Info.plist`) relevant to the DSP. | `string[]`| `["87yhbnd3gg.skadnetwork", ...]` | ```json { "imp": [ { "ext": { "skadn": { "version": "2.0", "versions": ["2.0","2.1","2.2"], "sourceapp": "880047117", "overlay": 1, "skadnetids": [ "cdkw7geqsh.skadnetwork", "qyjfv329m4.skadnetwork" ] } } } ] } ``` ### Bid Response If the DSP receives `imp.ext.skadn` in the bid request, they must include `seatbid.bid.ext.skadn` in the bid response. This enables BidMachine to submit click data and signatures for attribution. **Properties of `seatbid.bid.ext.skadn`:** | Attribute | Description | Type | Example | | -------------- | ---------------------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------ | | `version` | SKAdNetwork SDK version (`"2.0"` or higher). | `string` | `"2.0"` | | `network` | SKAdNetwork ID matching one in `skadnetids` from the request. | `string` | `"87yhbnd3gg.skadnetwork"` | | `campaign` | Campaign ID (1–100), as a string. | `string` | `"1"` | | `itunesitem` | Advertiser app ID (matches `bid.bundle`). | `string` | `"1232526187"` | | `fidelities` | Array of fidelity objects (introduced in SKAdNetwork v2.2). | `object[]`| See example below | | `nonce` | Unique identifier per ad response. Deprecated in favor of `fidelities[n].nonce` since 2.2. | `string` | `"a9ff03c2-d7ef-11ea-87d0-0242ac130003"` | | `sourceapp` | Publisher app ID (matches request `sourceapp`). | `string` | `"123456789"` | | `overlay` | Flag indicating SKOverlay display. | `integer` | `1` | | `timestamp` | Unix time (ms) at signature time. Deprecated in favor of `fidelities[n].timestamp` since 2.2. | `string` | `"1596723499812"` | | `signature` | SKAdNetwork signature. Deprecated in favor of `fidelities[n].signature` since 2.2. | `string` | `"MZHKJHKhKJH…"` | **`seatbid.bid.ext.skadn.fidelities` object:** | Attribute | Description | Type | Example | | ------------ | ----------------------------------------------------- | --------- | ----------------------------------------------- | | `fidelity` | Fidelity type of the attribution. | `integer` | `0` | | `nonce` | Unique identifier per ad response. | `string` | `"473b1a16-b4ef-43ad-9591-fcf3aefa82a7"` | | `timestamp` | Unix time (ms) at signature time. | `string` | `"1594406341232"` | | `signature` | SKAdNetwork signature. | `string` | `"MEQCIEQlmZRNfYzK…"` | ```json { "seatbid": [ {"bid": [ {"ext": {"skadn": { "version": "2.2", "network": "cdkw7geqsh.skadnetwork", "campaign": "45", "itunesitem": "123456789", "sourceapp": "880047117", "overlay": 1, "fidelities": [ { "fidelity": 0, "signature": "MEQCIEQlmZRNfYzK…", "nonce": "473b1a16-b4ef-43ad-9591-fcf3aefa82a7", "timestamp": "1594406341232" } ] }}} ]} ] } ``` ```json { "seatbid": [ {"bid": [ {"ext": {"skadn": { "version": "2.2", "network": "cdkw7geqsh.skadnetwork", "campaign": "45", "itunesitem": "123456789", "sourceapp": "880047117", "overlay": 1, "fidelities": [ { "fidelity": 0, "signature": "MEQCIEQlmZRNfYzK…", "nonce": "473b1a16-b4ef-43ad-9591-fcf3aefa82a7", "timestamp": "1594406341232" }, { "fidelity": 1, "signature": "GRlMDktMmE5Zi00Z…", "nonce": "e650de09-2a9f-4dc3-a4d1-544c402e9095", "timestamp": "1594406341233" } ] }}} ]} ] } ``` ```json { "seatbid": [ {"bid": [ {"ext": {"skadn": { "version": "2.0", "network": "cdkw7geqsh.skadnetwork", "campaign": "45", "itunesitem": "880047117", "nonce": "473b1a16-b4ef-43ad-9591-fcf3aefa82a7", "sourceapp": "123456789", "overlay": 1, "timestamp": "1594406341232", "signature": "MEQCIEQlmZRNfYzKBSE8QnhLTIHZZZWCFgZpRqRxHss65KoFAiAJgJKjdrWdkLUOCCjuEx2RmFS7daRzSVZRVZ8RyMyUXg==" }}} ]} ] } ``` ### Click Through & Click Tracking When SKAdNetwork is enabled and a valid `skadn` object is in the bid response: - **iOS SDK** opens a `SKStoreProductViewController` with the `skadn` values. - VAST `ClickThrough`, `CompanionClickThrough`, `MRAID.open()`, and standard HTML `` links are processed in the background. HTTP redirects are followed; non-redirect responses are ignored. - VAST `ClickTracking` and `CompanionClickTracking` continue to function as usual. If no `skadn` object is found, the SDK falls back to normal click-through behavior. ## AdAttributionKit BidMachine supports Apple's [AdAttributionKit](https://developer.apple.com/documentation/adattributionkit) framework for iOS 17.4+ and BidMachine SDK 3.1.0 to help DSPs and advertisers track ad performance and conversions. Here is a high-level overview of how Apple adattributionKit works in the context of BidMachine: ```mermaid sequenceDiagram participant DSP participant BidMachine participant Publisher as Direct Publisher/SSP %% Integration phase opt Integration DSP ->> BidMachine: AdNetworkIdentifier BidMachine ->> Publisher: All AdNetworkIdentifiers end %% Auction phase opt Auction Publisher ->> BidMachine: Ad request note left of Publisher: • AdAttributionKit request data• IDs• Contextual data BidMachine ->> DSP: Bid request note left of BidMachine: • AdAttributionKit request data• IDs• Contextual data DSP -->> BidMachine: Bid response note right of DSP: • AdAttributionKit response data• Bid response BidMachine -->> Publisher: Ad response note right of BidMachine: • AdAttributionKit response data• Ad response end ``` --- ## nURL and Impression Tracking Schemes We support two schemes for tracking impressions and triggering `nURL`. Below you can find two block schemes for different ad types: - [Banner & Interstitial Ad Scheme](#banner--interstitial-scheme) - [Video Ad Scheme](#video-ad-scheme) :::danger Important `bURL` is tracked at the time server gets an impression, irrespective of the tracking scheme. ::: ## Banner & Interstitial Scheme ```mermaid sequenceDiagram participant App participant SDK as BidMachine SDK Renderer participant Exchange as BidMachine Exchange Server participant DSP1 as DSP-1 participant DSP2 as DSP-2 participant T1 as https://tracker1.com participant T2 as https://tracker2.com %% 1. Ad Request & Auction App->>Exchange: Ad Request Exchange->>DSP1: Bid Request Exchange->>DSP2: Bid Request note over DSP1,DSP2: Auction alt DSP-1 wins Exchange->>DSP1: Winner notification • adm (markup) • ext.imptrackers = ["https://tracker1.com", "https://tracker2.com"] • nURL (win-notify) • bURL (billing) DSP1-->>Exchange: Bid Response else DSP-2 wins Exchange->>DSP2: Winner notification • adm (markup) • ext.imptrackers = ["https://tracker1.com", "https://tracker2.com"] • nURL (delayed-notify) • bURL (billing) DSP2-->>Exchange: Bid Response end Exchange-->>App: Bid Response %% 2. Notification schemes note right of Exchange: Server-side nURL win notification: • nURL pinged immediately by server • bURL held until impression note right of App: Client-side delayed notification: • ext.imptrackers[] in body • nURL pinged by client on impression %% 3. Rendering & Impression App->>SDK: Render Ad (adm + ext + nURL + bURL) activate SDK SDK->>SDK: DISPLAYING AD SDK-->>Exchange: Impression Detected deactivate SDK %% 4. Parallel tracker calls on impression par Fire ext trackers SDK->>T1: GET ext.imptrackers[0] SDK->>T2: GET ext.imptrackers[1] and Fire billing URL SDK->>Exchange: GET bURL and Fire final nURL SDK->>Exchange: GET nURL end ``` ## Video Ad Scheme ```mermaid sequenceDiagram participant App participant SDK as SDK Renderer participant Exchange as BidMachine Exchange Server participant DSP1 as DSP-1 participant DSP2 as DSP-2 participant Tracker1 as VAST Tracker 1 participant Tracker2 as VAST Tracker 2 %% 1. Ad Request & Auction App->>Exchange: Ad Request Exchange->>DSP1: Bid Request Exchange->>DSP2: Bid Request note over DSP1,DSP2: Auction alt DSP-1 wins Exchange->>DSP1: Winner notification DSP1-->>Exchange: Bid Response • adm contains VAST XML with tags • nURL (win-notify) • bURL (billing) else DSP-2 wins Exchange->>DSP2: Winner notification DSP2-->>Exchange: Bid Response • adm contains VAST XML with tags • nURL (delayed-notify) • bURL (billing) end Exchange-->>App: Bid Response (body) %% 2. Notification schemes note right of Exchange: Server-side win scheme • nURL pinged immediately on win • bURL held until impression note right of App: Client-side delayed scheme • VAST trackers in adm • nURL pinged by client on impression %% 3. Rendering & Impression App->>SDK: Render ad (adm with VAST) activate SDK SDK->>SDK: DISPLAYING AD SDK-->>Exchange: Impression detected deactivate SDK %% 4. Parallel tracker calls par Fire VAST impression trackers SDK->>Tracker1: GET https://tracker1.com SDK->>Tracker2: GET https://tracker2.com and Fire billing URL SDK->>Exchange: GET bURL and Fire final nURL SDK->>Exchange: GET nURL end ``` --- ## Getting Started Connect with high-quality inventory, global audiences, and achieve your campaign goals with precision. :::note Supported Open RTB versions: 2.3 and 2.5 ::: ## Data Centers BidMachine currently has four datacenters: - **ASIA-PACIFIC**: Singapore - **EUROPE**: Falkenstein, Germany - **US-EAST**: New York, Washington - **US-WEST**: Dallas, Texas ## Supported Ad Types ### Video Ads (VAST) Can be rewarded or skippable. Supported dimensions: 1. 320×480 2. 480×320 3. 768×1024 4. 1024×768 Video ads also support the following end cards: - Static Image - HTML - Playable HTML ### Static Ads (HTML, MRAID, MREC) #### Banners - 300×250 (MREC) - 320×50 (phone) - 728×90 (tablet) #### Fullscreen Interstitials Can be rewarded or skippable: - 320×480 (phone) - 480×320 (phone) - 768×1024 (tablet) - 1024×768 (tablet) ### Native Ads Supported natively within the BidMachine SDK. :::warning If you want to identify **rewarded** traffic, refer to the fields `imp.video.ext.videotype` and `imp.banner.ext.bannertype`. Use the value `"rewarded"` for rewarded traffic. ::: ## Bid Request BidMachine use `POST` for all Open RTB requests. The request body must be a valid Open RTB JSON object. Bid Request body specification is described in [the next page](/dsp/bid-request/specification). ## Auction Type BidMachine uses a **first-price** auction model. Bidders are expected to pay the full CPM amount they bid. --- ## Requirements If you would like to be one of BidMachine Demand Partners, please review the details below: - BidMachine support's mobile in-app publisher's inventory only - BidMachine works on **CPM** business model - **COPPA** compliant - BidMachine Ad Exchange supports the Open RTB version `2.3` and `2.5` - BidMachine's Data Centers are located in Germany, the US (Texas), and Singapore - GDPR DPA: [Donwload the file](https://bidmachine-creatives.s3.amazonaws.com/dsp/DPA%2BEUMC+Demand+side_DSP+-+AppodealX+v.1.5.docx) - BidMachine Ad Exchange Demand Policies: [Download the file](https://bidmachine-creatives.s3.amazonaws.com/dsp/BidMachine+Ad+Exchange+Demand+Policies_Final_06.24.2021.pdf) If your DSP meets the requirements above please proceed to the Integration questionnaire. For further information on the integration process, contact BidMachine Demand Team: [hi@bidmachine.io](mailto:hi@bidmachine.io) --- ## Adapter Bidding/Waterfall import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' import JavaLabel from '@site/src/components/code-labels/java' import KotlinLabel from '@site/src/components/code-labels/kotlin' This guide shows you how to integrate the official BidMachine adapter for Google AdMob on Android. :::info Waterfall Integration BETA Waterfall integration is currently in beta. Please contact your BidMachine account manager for setup assistance and access. ::: ## Import the BidMachine SDK and Adapter :::warning Version Compatibility Failure to integrate the compatible BidMachine SDK and Google Mobile Ads SDK versions might lead to build issues. ::: ### Add BidMachine Repository Add the BidMachine repository to your project-level `build.gradle` file: ```groovy title="build.gradle" repositories { maven { url "https://artifactory.bidmachine.io/bidmachine" } } ``` ### Add Dependencies Add the following dependencies to your app-level `build.gradle` file: }> ```kotlin title="build.gradle.kts" dependencies { implementation("com.google.android.gms:play-services-ads:25.3.0") implementation("com.google.ads.mediation:bidmachine:3.7.0.0") } ``` }> ```groovy title="build.gradle" dependencies { implementation 'com.google.android.gms:play-services-ads:25.3.0' implementation 'com.google.ads.mediation:bidmachine:3.7.0.0' } ``` ## Additional Configuration For complete console setup and integration instructions, see the [AdMob Console Setup (Official)](/sdk/admob/admob-bidding-console) page. --- ## Changelog ## Version 3.6.1.50 (April 20, 2026) **Features**: * Updated BidMachine version to 3.6.1 * Updated AdMob version to 25.2.0 ## Version 3.5.0.49 (November 3, 2025) **Features**: * Updated BidMachine version to 3.5.0 * Updated AdMob version to 24.7.0 ## Version 3.4.0.48 (August 13, 2025) **Features**: * Updated BidMachine version to 3.4.0 * Updated AdMob version to 24.5.0 ## Version 3.3.0.47 (August 7, 2025) **Bugfix**: * Fix proguard ## Version 3.3.0.46 (July 15, 2025) **Features**: * Added `PlacementId` * Updated AdMob version to 24.4.0 ## Version 3.3.0.45 (May 29, 2025) **Features**: * Updated BidMachine version to 3.3.0 * Updated AdMob version to 24.3.0 ## Version 3.2.1.44 (May 7, 2025) **Bugfix**: * Updated AdMob adapter to be compatible with both versions prior 24.0.0 and upper ## Version 3.2.1.43 (March 27, 2025) **Features**: * Updated AdMob version to 24.1.0 ## Version 3.2.1.42 (March 24, 2025) **Features**: * Updated BidMachine version to 3.2.1 * Improved AdMob adapter errors ## Version 3.2.0.41 (February 20, 2025) **Features**: * Updated BidMachine version to 3.2.0 ## Version 3.1.1.40 (January 10, 2025) **Features**: * Added Waterfall adapter * Updated Native Ad integration * Updated AdMob version to 23.6.0 ## Version 3.1.1.39 (November 26, 2024) **Features**: * Updated BidMachine version to 3.1.1 * Updated AdMob version to 23.5.0 ## Version 3.0.1.38 (September 19, 2024) **Features**: * Updated BidMachine version to 3.0.1 ## Version 3.0.0.37 (August 22, 2024) **Features**: * Updated BidMachine version to 3.0.0 * Updated AdMob version to 23.3.0 ## Version 2.7.0.36 (May 9, 2024) **Features**: * Updated Min Android SDK version to 21 due to AdMob update to 23.0.0. * Updated BidMachine version to 2.7.0 * Updated AdMob version to 23.0.0 ## Version 2.6.0.35 (April 5, 2024) **Features**: * Updated BidMachine version to 2.6.0 ## Version 2.5.1.34 (March 1, 2024) **Features**: * Updated BidMachine version to 2.5.1 ## Version 2.5.0.33 (February 16, 2024) **Features**: * Updated BidMachine version to 2.5.0 ## Version 2.4.2.32 (February 1, 2024) **Features**: * Updated BidMachine version to 2.4.2 * Updated AdMob version to 22.6.0 ## Version 2.4.0.31 (January 09, 2024) **Features**: * Removed Waterfall ## Version 2.4.0.30 (November 10, 2023) **Features**: * Updated BidMachine version to 2.4.0 * Updated AdMob version to 22.5.0 ## Version 2.3.3.29 (October 30, 2023) **Features**: * Updated AdMob version to 22.4.0 ## Version 2.3.3.28 (September 4, 2023) **Features**: * Updated BidMachine version to 2.3.3 * Updated AdMob version to 22.3.0 ## Version 2.3.2.27 (August 3, 2023) **Features**: * Updated BidMachine version to 2.3.2 * Updated AdMob version to 22.2.0 ## Version 2.2.0.26 (May 22, 2023) **Features**: * Updated BidMachine version to 2.2.0 * Updated AdMob version to 22.1.0 ## Version 2.1.13.25 (May 10, 2023) **Features**: * Updated AdMob version to 22.0.0 ## Version 2.1.13.24 (May 10, 2023) **Features**: * Updated BidMachine version to 2.1.13 * Updated AdMob version to 21.5.0 ## Version 1.9.10.23 (August 22, 2022) **Features**: * Updated BidMachine version to 1.9.10 * Updated AdMob version to 21.1.0 ## Version 1.9.4.22 (June 6, 2022) **Features**: * Deprecated CustomEvent and switched to [Adapter](https://developers.google.com/android/reference/com/google/android/gms/ads/mediation/Adapter) * Updated waterfall sample ## Version 1.9.4.21 (May 30, 2022) **Features**: * Updated BidMachine version to 1.9.4 * Updated AdMob version to 21.0.0 ## Version 1.9.3.20 (March 31, 2022) **Features**: * Updated BidMachine version to 1.9.3 ## Version 1.9.2.19 (March 16, 2022) **Features**: * Updated BidMachine version to 1.9.2 * Updated AdMob version to 20.6.0 ## Version 1.9.1.18 (February 11, 2022) **Features**: * Updated BidMachine version to 1.9.1 ## Version 1.9.0.17 (February 01, 2022) **Features**: * Updated BidMachine version to 1.9.0 ## Version 1.8.3.16 (December 29, 2021) **Features**: * Updated BidMachine version to 1.8.3 ## Version 1.8.2.15 (December 23, 2021) **Features**: * Updated BidMachine version to 1.8.2 ## Version 1.8.1.14 (December 16, 2021) **Features**: * Updated BidMachine version to 1.8.1 * Updated AdMob version to 20.5.0 ## Version 1.7.1.13 (March 30, 2021) **Features**: * Updated BidMachine version to 1.7.1 * Updated AdMob version to 19.8.0 ## Version 1.6.4.12 (March 18, 2021) **Features**: * Updated AdMob version to 19.8.0 ## Version 1.6.4.11 (March 4, 2021) **Features**: * Updated BidMachine version to 1.6.4 ## Version 1.6.3.10 (February 2, 2021) **Features**: * Updated AdMob version to 19.7.0 ## Version 1.6.3.9 (January 18, 2021) **Features**: * Updated BidMachine version to 1.6.3 ## Version 1.6.1.8 (November 3, 2020) **Features**: * Updated BidMachine version to 1.6.1 * Updated AdMob version to 19.5.0 ## Version 1.5.2.7 (August 3, 2020) **Features**: * Updated BidMachine version to 1.5.2 * Updated AdMob version to 19.3.0 ## Version 1.5.1.6 (July 21, 2020) **Features**: * Added HeaderBidding implementation ## Version 1.5.1.5 (July 16, 2020) **Features**: * Updated BidMachine version to 1.5.1 * Updated AdMob version to 19.2.0 ## Version 1.4.4.4 (June 8, 2020) **Features**: * Updated BidMachine version to 1.4.4 * Updated AdMob version to 19.1.0 ## Version 1.4.0.3 (December 2, 2019) **Features**: * Added Native Ad type ## Version 1.3.0.2 (August 14, 2019) **Features**: * Updated BidMachine version to 1.3.0 * Added availability to pass `mediation_config` and `endpoint` parameters into BidMachine SDK via AdMob's `localExtras` or `serverParameters`. --- ## Waterfall Custom Adapter import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' import Admonition from '@theme/Admonition' import JavaLabel from '@site/src/components/code-labels/java' import KotlinLabel from '@site/src/components/code-labels/kotlin' import SwiftLabel from '@site/src/components/code-labels/swift' import ObjCLabel from '@site/src/components/code-labels/objc' :::danger DEPRECATED - Use Official AdMob Adapter This custom adapter is **deprecated**. BidMachine is now an official Google AdMob partner. **Please use the [official AdMob adapter](/sdk/admob/admob-bidding-console) instead** for better performance, official support, and seamless integration with AdMob. ::: The adapter supports custom waterfall integration for the next ad formats: - Banner - Interstitial - Rewarded - Native :::success Full Technical Documentation To get full documentation and samples please refer to the GitHub [Android](https://github.com/bidmachine/BidMachine-Android-admob-adapter-example). ::: ## Integration :::info Min Android SDK version - 23 (6.0, Marshmallow) ::: ```groovy title="build.gradle" repositories { maven { url "https://artifactory.bidmachine.io/bidmachine" } } ``` In your `build.gradle` file add the following dependency which includes the BidMachine adapter for use within AdMob platform: ```groovy title="build.gradle" dependencies { // Add BidMachine SDK dependency implementation "io.bidmachine:ads:3.6.1" // Add BidMachine SDK AdMob Adapter dependency implementation "io.bidmachine:ads.adapters.admob:3.6.1.50" // Add AdMob SDK dependency implementation "com.google.android.gms:play-services-ads:25.2.0" } ``` ## Initialization Waterfall integration does not require `BidMachineSdk` initialization code, as it is triggered automatically as part of the `MobileAds` initialization. }> ```java MobileAds.initialize(context, new OnInitializationCompleteListener() { @Override public void onInitializationComplete (InitializationStatus initializationStatus){ // Request ads } }); ``` }> ```kotlin MobileAds.initialize(context) { // Optionally, enable test mode and logging BidMachine.setTestMode(true) BidMachine.setLoggingEnabled(true) } ``` ## Logging and Test Mode :::warning All parameters for BidMachine SDK must be set before starting AdMob SDK. ::: }> ```java BidMachine.setTestMode(true); BidMachine.setLoggingEnabled(true); ``` }> ```kotlin BidMachine.setTestMode(true) BidMachine.setLoggingEnabled(true) ``` :::warning Don't forget to remove `setTestMode()` before releasing to production! ::: ## Additional Configuration - [Advanced SDK settings](/sdk/general/android/advanced/) - [Data Privacy settings](/sdk/general/android/privacy/) --- ## Console Setup import Image from "@theme/IdealImage"; ## Manual Setup ### Bidding Adapter BidMachine's bidding adapter enables real-time bidding integration with AdMob. This setup allows BidMachine to participate in AdMob's bidding auctions. :::important Requirements - Android API level 23 or higher - BidMachine adapter version 3.4.0.1 or later (Use the latest available BidMachine adapter version for all formats) - Latest Google Mobile Ads SDK ::: #### Step 1: BidMachine Dashboard Configuration 1. Navigate to the **Source** tab in your BidMachine dashboard and select **Edit**. Copy the **Integration ID** for later use in the AdMob console. 2. Click **Add Placement** to create new placements :::tip Placement Management API You can also create and manage placements programmatically using the [Placement Management API](/api/bidmachine-placement-management-api) — useful when provisioning placements at scale. ::: :::note Bundle Identifier Format When setting up your mediation group, use the appropriate bundle identifier format: - **Android apps**: Use alphabetic bundle identifier (e.g., `com.example.app`) - **iOS apps**: Use numeric app ID (e.g., `123456789`) ::: 3. Save your changes and note the **Placement ID** for later use 4. Access the **app-ads.txt** tab in the BidMachine dashboard, copy the content, and append it to your website's app-ads.txt file #### Step 2: AdMob Console Setup 1. Sign into your [AdMob account](https://apps.admob.com/) 2. Navigate to **Mediation** and either create a new mediation group or edit an existing one 3. Configure ad format and platform settings 4. Select **Add ad source** under the **Bidding** card 5. Locate and choose **BidMachine** from the available networks 6. Establish the partnership agreement if prompted 7. Add mapping with your **Placement ID** from the BidMachine dashboard 8. Add BidMachine to GDPR and US state regulations ad partners lists per AdMob's European and US state regulations settings #### Step 3: Enable Secure Signals & User Consent :::danger Required — most common cause of "no bids" BidMachine **will not bid** unless **Secure Signal sharing** is enabled and BidMachine is allowed under your **User Consent** settings in the AdMob/GAM console. These toggles are **off by default** and are the most frequent reason publishers see no fill after an otherwise correct setup. Verify both before troubleshooting anything else. ::: **1. Enable Secure Signal sharing** Secure signals are the encrypted bidding parameters BidMachine needs to participate in the auction. They must be explicitly enabled for the BidMachine bidder: 1. Sign in to your [Google Ad Manager](https://admanager.google.com/) account 2. Go to **Delivery → Bidders**, open **SDK Bidding**, and select **BidMachine** 3. Under **Secure signal sharing (required)**, check whether each item shows **Enabled** or **Disabled** 4. If anything is marked **Disabled**, click the link for each item to enable the **library** and the **sharing of signals** to BidMachine 5. Confirm signals are being passed using **Delivery Tools** or **Ad Inspector** (the *Buyer generated data* field in the third-party bidding parameters should show a substantial character count) :::info Google reference Follow Google's official guide for exact screenshots and current console paths: [Verify your SDK Bidding setup → Enable secure signals](https://support.google.com/admanager/answer/14863770?hl=en#enable-secure-signals). ::: **2. Allow BidMachine under User Consent settings** 1. In the AdMob console, open **Privacy & messaging** and review your **European regulations (GDPR)** and **US state regulations** settings 2. Make sure **BidMachine** is added to your list of allowed ad partners / commonly used ad partners for each applicable regulation 3. If BidMachine is not on the consent vendor list, no consent signal will be passed and bidding will fail :::note App-side requirement The console settings above only work if your app also forwards consent correctly — see [Step 4: Privacy Implementation](#step-4-privacy-implementation) below. ::: #### Step 4: Privacy Implementation {#step-4-privacy-implementation} BidMachine automatically reads GDPR consent set by consent management platforms including UMP SDK. Similarly, it reads GPP consent automatically for US state compliance. Ensure you have implemented a Consent Management Platform (CMP) in your app according to AdMob's privacy requirements. #### Step 5: Testing 1. Register your test device for AdMob 2. Enable test mode in BidMachine's SDK documentation 3. Use Ad Inspector's single ad source testing feature to verify BidMachine ads 4. Disable test modes before production release ### Waterfall Adapter BETA :::info Contact Your Account Manager Waterfall integration is currently in beta. Please contact your BidMachine account manager for setup assistance and access. ::: BidMachine waterfall integration allows you to add BidMachine as a custom event in your AdMob mediation waterfall with specific price points. :::important Adapter Compatibility Use Use the latest available BidMachine adapter version for all formats. ::: #### Manually :::note Multiple Placements To set up multiple placements, repeat the setup process for each placement with its corresponding Placement ID. ::: ##### 1. BidMachine Dashboard Configuration 1. Navigate to the **Source** tab in your BidMachine dashboard and select **Edit** 2. Click **Add Placement** to create new placements (or create them programmatically via the [Placement Management API](/api/bidmachine-placement-management-api)) 3. Save your changes and note the **Placement ID** for later use 4. Access the **app-ads.txt** tab in the BidMachine dashboard, copy the content, and append it to your website's app-ads.txt file ##### 2. AdMob Console Setup 1. Sign into your [AdMob account](https://apps.admob.com/) 2. Navigate to **Mediation** and either create a new mediation group or edit an existing one 3. Configure ad format and platform settings 4. Select **Add Ad Source** under the waterfall section 5. Enter the **eCPM value** for this price point 6. Locate and choose **BidMachine** from the available networks 7. Add mapping with your **Placement ID** from the BidMachine dashboard 8. Click **Done** to save the ad source 9. Repeat steps 4-8 for each price point you want to add **Recommended Price Points:** | Banners/Native/Mrec | Skippable (Int + Video) | Non-Skippable (Rewarded) | |---------------------|-------------------------|---------------------------| | `0.1`, `0.3`, `0.4`, `0.5`, `1.0`, `1.5`, `3.0` | `1.0`, `5.0`, `10.0`, `20.0`, `30.0`, `40.0`, `70.0`, `100.0` | `1.0`, `5.0`, `10.0`, `20.0`, `30.0`, `40.0`, `70.0`, `100.0`, `200.0` | :::note Waterfall Behavior Not all ad units will be called in waterfall but only the ones that match BidMachine bid prices. ::: ##### 3. Privacy Implementation BidMachine automatically reads GDPR consent set by consent management platforms including UMP SDK. Similarly, it reads GPP consent automatically for US state compliance. Ensure you have implemented a Consent Management Platform (CMP) in your app according to AdMob's privacy requirements. ##### 4. Finalizing Setup Once you are done creating ad sources, you should see the final waterfall with your networks and newly created BidMachine ad sources. ##### 6. Testing 1. Register your test device for AdMob 2. Enable test mode in BidMachine's SDK documentation 3. Use Ad Inspector to verify BidMachine waterfall ads at different price points 4. Disable test modes before production release --- ## Console Setup(Admob) import Image from "@theme/IdealImage"; :::danger DEPRECATED - Use Official AdMob Adapter This custom adapter setup is **deprecated**. BidMachine is now an official Google AdMob partner. **Please use the [official AdMob adapter](/sdk/admob/admob-bidding-console) instead** for better performance, official support, and seamless integration with AdMob. ::: Regular BidMachine waterfall integration. It requires adding specific **Custom Events** for selected **Mediation Group**. :::important Adapter Compatibility BidMachine waterfall integration has been supported since v`3.1.1.40` for Android and v`3.1.1.2` for iOS. ::: ## Waterfall Adapter ### Automatically (Chrome extension) 1. Install the [BidMachine Mediation Helper Extension](https://chromewebstore.google.com/detail/bhbbahnainkpbhpknaegjkmgffojffkb?utm_source=item-share-cb) 2. Open the extension and go to the Google AdMob dashboard. The extension will detect your account and find mediation groups associated with it. 3. Select a **Mediation Group** where you want to add BidMachine Prebid. 4. Fill out your data: - **Source Id** - Source Id from your account - **Integration type** - `Waterfall` type should be selected - Keep overwriting existing BidMachine Custom Events checked if you want the extension to replace previously created Custom Events for BidMachine (both prebid and waterfall) - **Compare operator** - select comparator from the dropdown menu - **Price Points** - an array of Price Points used for Custom Events. Can be modified manually 5. Press the `Create` button, and you're all set. ### Manually 1. Creating BidMachine custom events within mediation group Go to Google AdMob dashboard and choose mediation group where you want to create BidMachine ad sources. Go inside chosen mediation group and start creating BidMachine custom events with the prices you want to use 2. Setting up Class name and parameters for custom events Enter the label of ad source and set up the price and click Continue Then in the next window set up class name and class parameters according to the following table | Platform | Ad Type | Class Name | :------- | :------------- | :------------------------------------------------------------------------- | | iOS | Banner | `BidMachineWaterfallCustomEventBanner` | | iOS | Interstitial | `BidMachineWaterfallCustomEventInterstitial` | | iOS | Rewarded Video | `BidMachineWaterfallCustomEventRewarded` | | iOS | Native | `BidMachineWaterfallCustomEventNativeAd` | | Android | Banner | `com.google.ads.mediation.bidmachine.waterfall.BidMachineWaterfallAdapter` | | Android | Interstitial | `com.google.ads.mediation.bidmachine.waterfall.BidMachineWaterfallAdapter` | | Android | Rewarded Video | `com.google.ads.mediation.bidmachine.waterfall.BidMachineWaterfallAdapter` | | Android | Native | `com.google.ads.mediation.bidmachine.waterfall.BidMachineWaterfallAdapter` | :::note Class names On Android, the class name is the same for all ad types, so you can use the same class name for all ad sources. On iOS, you need to specify the class name according to the ad type. ::: Parameters description: | Parameter name | Description | Type | Requirements | Example | | :--------------- | :--------------------------- | :----- | :---------- | :------------------------------ | | `source_id` | Your Source Id | String | Required | `"source_id":"your_source_id"` | | `bm_pf` | eCPM of BidMachine ad source | Double | Required | `"bm_pf":"1.0"` | | `placement_id` | Placement ID from [BidMachine Placement](/dashboard/placement). Placements can also be managed programmatically via the [Placement Management API](/api/bidmachine-placement-management-api). | UUID | Optional | `"placement_id":"your_placement_id"` | :::warning JSON format Parameters should be in JSON format, so make sure to use double quotes for keys and values. For example: ``` {"bm_pf":"1.00", "source_id": "your_source_id", "placement_id": "your_placement_id"} ``` ::: Example of filling Class name and parameters for iOS Banner: :::tip Price Floors In parameters in `bm_pf` field - specify exactly the same price as you used for creating ad source ::: Price Points for BidMachine ad sources can be set up in the following way: | Banners/Native/Mrec | Skippable (Int + Video) | Non-Skippable (Rewarded) | |---------------------|-------------------------|---------------------------| | `0.1`, `0.3`, `0.4`, `0.5`, `1.0`, `1.5`, `3.0` | `1.0`, `5.0`, `10.0`, `20.0`, `30.0`, `40.0`, `70.0`, `100.0` | `1.0`, `5.0`, `10.0`, `20.0`, `30.0`, `40.0`, `70.0`, `100.0`, `200.0` | :::note Not all ad units will be called in waterfall but only the one that matches BidMachine bid prices. ::: When you are finished with filling all needed info - click `Done` 3. Finalising setup You can create several ad sources within same mediation group. Once you are done with creating them - you should see final waterfall with your networks and newly created BidMachine ad sources. If you want to change prices of created ad sources - you should not only change eCPM of it but also change `bm_pf` value in parameters of it. --- ## Adapter Bidding/Waterfall(Ios) import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' This guide shows you how to integrate the official BidMachine adapter for Google AdMob on iOS. :::info Waterfall Integration BETA Waterfall integration is currently in beta and requires adapter version **3.7.1.1** or higher. Please contact your BidMachine account manager for setup assistance and access. ::: ## Import the BidMachine SDK and Adapter :::warning Version Compatibility Failure to integrate the compatible BidMachine SDK and Google Mobile Ads SDK versions might lead to build issues. ::: Requires minimum adapter version 3.6.0.0. 1. In Xcode, select **File > Add Package Dependencies...** 2. Enter this package URL: `https://github.com/googleads/googleads-mobile-ios-mediation-bidmachine.git` 3. Set **Dependency Rule** to **Branch** 4. Enter `main` in the text field Add this line to your Podfile: ```ruby title="Podfile" pod 'GoogleMobileAdsMediationBidMachine', '>= 3.7.1.1' ``` Run: ```bash pod install --repo-update ``` 1. Download the latest BidMachine SDK for iOS and link all `.xcframework` files and bundles 2. Download the latest BidMachine adapter from the Changelog section and link `BidMachineAdapter.xcframework` in your project ## Additional Configuration For complete console setup and integration instructions, see the [AdMob Console Setup (Official)](/sdk/admob/admob-bidding-console) page. --- ## Changelog(Ios) ## Version 3.6.0.1 (Apr 27th, 2026) - Downgraded 'Google-Mobile-Ads-SDK' to '~> 13.0' - 'BidMachine', '~> 3.6.0' ## Version 3.6.0.0 (Apr 17th, 2026) - Fix Native Ad clicks - Update 'Google-Mobile-Ads-SDK' to '13.2.0' - Update 'BidMachine' to '~> 3.6.0' ## Version 3.5.0.1 (Nov 6th, 2025) - Update banner ad sizes mapping logic - Update 'Google-Mobile-Ads-SDK' to '12.12.0' - Update 'BidMachine' to '3.5.0' ## Version 3.4.0.0 (Aug 13th, 2025) - Update 'Google-Mobile-Ads-SDK' to '12.9.0' - Update 'BidMachine' to '3.4.0' ## Version 3.3.0.3 (Jul 24th, 2025) - Fixed an issue with placement comparison for Prebid integrations ## Version 3.3.0.2 (July 17, 2025) **Features**: - Added `Placement ID` support ## Version 3.3.0.1 (Jul 7th, 2025) - Update 'Google-Mobile-Ads-SDK' to '12.6.0' ## Version 3.3.0.0 (Jun 9, 2025) - BidMachine SDK 3.3.0 ## Version 3.2.1.0 (March 24, 2025) - BidMachine SDK 3.2.1 - Google-Mobile-Ads-SDK 12.2.0 ## Version 3.2.0.1 (March 5, 2025) - Google-Mobile-Ads-SDK 12.1.0 ## Version 3.2.0.0 (February 10, 2025) - BidMachine SDK 3.2.0 ## Version 3.1.1.2 (January 10, 2025) - Added Waterfall adapter --- ## Waterfall Custom Adapter(Ios) import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' import Admonition from '@theme/Admonition' import JavaLabel from '@site/src/components/code-labels/java' import KotlinLabel from '@site/src/components/code-labels/kotlin' import SwiftLabel from '@site/src/components/code-labels/swift' import ObjCLabel from '@site/src/components/code-labels/objc' :::danger DEPRECATED - Use Official AdMob Adapter This custom adapter is **deprecated**. BidMachine is now an official Google AdMob partner. **Please use the [official AdMob adapter](/sdk/admob/admob-bidding-console) instead** for better performance, official support, and seamless integration with AdMob. ::: The adapter supports custom waterfall integration for the next ad formats: - Banner - Interstitial - Rewarded - Native :::success Full Technical Documentation To get full documentation and samples please refer to the GitHub [Android](https://github.com/bidmachine/BidMachine-Android-admob-adapter-example) or [iOS](https://github.com/bidmachine/BidMachine-Google-Mobile-Ads-iOS-Adapters). ::: ## Integration In your **Podfile** file add the following dependency which includes the BidMachine adapter for use within AdMob platform: ```ruby title="Podfile" target 'Target' do project 'Project.xcodeproj' pod 'BidMachineAdMobAdapter', '~> 3.6.0.0' end ``` ## Initialization The BidMachineAdMobAdapter starting 3.1.1.2 version offers robust support for waterfall integration. This integration type require to configure mediation groups in AdMob account by adding BidMachine Custom Events and Mappings. Waterfall integration does not require BidMachineSdk initialization code, as it is triggered automatically as part of the MobileAds initialization. However, if you need to configure additional BidMachineSdk settings, refer to the Logging and Test Mode below. ## Logging and Test Mode :::warning All parameters for BidMachine SDK must be set before starting AdMob SDK. ::: }> ```swift BidMachineSdk.shared.populate { builder in builder .withTestMode(true) .withLoggingMode(true) .withBidLoggingMode(true) .withEventLoggingMode(true) } MobileAds.shared.start(completionHandler: nil) ``` :::warning Don't forget to remove `.withTestMode()` before releasing to production! ::: }> ```objc [BidMachineSdk.shared populate:^(id builder) { [builder withTestMode:YES]; [builder withLoggingMode:YES]; [builder withBidLoggingMode:YES]; [builder withEventLoggingMode:YES]; }]; [[GADMobileAds sharedInstance] startWithCompletionHandler:^(GADInitializationStatus * _Nonnull status) { }]; ``` :::warning Don't forget to remove `[builder withTestMode:];` before releasing to production! ::: ## Additional Configuration - [Advanced SDK settings](/sdk/general/ios/advanced/) - [Data privacy settings](/sdk/general/ios/privacy/) --- ## Overview import Step from '@site/src/components/mdx/step' import Stepper from '@site/src/components/mdx/stepper' This page gives you step-by-step instructions for how you set BidMachine live as an ad network on the AdMob Mediation platform. ## How to Create a BidMachine Account? Create a BidMachine Account at [bidmachine.io](https://bidmachine.io/#sign-up). Upon registration, an activation email containing instructions will be sent to the email address you've provided. Please use the provided instructions to activate your account. ## Testing instructions Before deploying the BidMachine SDK and adapter to your live application, you can perform testing with the test mode. This will guarantee a high fill rate (99.99%) during the integration testing process, ensuring that the implementation is functioning correctly. It is crucial to disable the test mode before going live, as failing to do so will result in financial loss. ## Revenue Reports You will be provided with a dashboard, please contact your account manager who will share the credentials with you. --- ## Advanced Settings import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import JavaLabel from "@site/src/components/code-labels/java"; import KotlinLabel from "@site/src/components/code-labels/kotlin"; ## Global Settings ### Logs BidMachine SDK provides a set of logging options to help you debug and monitor the SDK's behavior. You can enable or disable different types of logs, such as general logs, bid logs, and event logs. }> ```java BidMachine.setLoggingEnabled(boolean); ``` }> ```kotlin BidMachine.setLoggingEnabled(Boolean) ``` ### Test Mode BidMachine SDK can be configured to run in test mode, which is useful for testing and debugging purposes. }> ```java BidMachine.setTestMode(boolean); ``` }> ```kotlin BidMachine.setTestMode(Boolean) ``` :::warning Test mode should be disabled in production. ::: ### Location SDK can automatically track user device location to serve better ads. The SDK never requests location permissions itself: it reads the device location only if your app has already obtained a location permission from the user. With `ACCESS_COARSE_LOCATION`, approximate location is collected; with `ACCESS_FINE_LOCATION`, precise location is collected — declare this accordingly in your Google Play Data safety form (see [App Privacy Details on Google Play](./app-privacy-details.mdx)). To make it work for **Android 6.0**, you should request `android.permission.ACCESS_COARSE_LOCATION` and `android.permission.ACCESS_FINE_LOCATION`: }> ```java ActivityCompat.requestPermissions(@NonNull Activity, new String[]{ Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION }, REQ_CODE); ``` }> ```kotlin ActivityCompat.requestPermissions(Activity, arrayOf( Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION ), REQ_CODE) ``` ### Publisher Parameters The publisher info is used to provide information about the publisher of the app. This information is used for targeting and reporting purposes. }> ```java BidMachine.setPublisher(@Nullable Publisher); ``` }> ```kotlin BidMachine.setPublisher(Publisher?) ``` | Param | Type | Description | | :------- | :----- | :------------------------- | | Id | String | Publisher ID | | Name | String | Publisher name | | Domain | String | Publisher domain | | Category | String | Publisher content category | Code Example: }> ```java Publisher publisher = new Publisher.Builder() .setId(@Nullable String) .setName(@Nullable String) .setDomain(@Nullable String) .addCategory(@Nullable String) .addCategories(@Nullable List) .build(); // Sets publisher information BidMachine.setPublisher(publisher); ``` }> ```kotlin val publisher = Publisher.Builder() .setId(String?) .setName(String?) .setDomain(String?) .addCategory(String?) .addCategories(List?) .build() // Sets publisher information BidMachine.setPublisher(publisher) ``` ### Targeting Parameters The targeting info is used to provide information about the user and the app. }> ```java TargetingParams targetingParams = new TargetingParams() .setUserId(@Nullable String) .setGender(@Nullable Gender) .setBirthdayYear(@Nullable Integer) .setKeywords(@Nullable String[]) .setDeviceLocation(@Nullable Location) .setCountry(@Nullable String) .setCity(@Nullable String) .setZip(@Nullable String) .setStoreUrl(@Nullable String) .setStoreCategory(@Nullable String) .setStoreSubCategories(@Nullable String[]) .setFramework(@Nullable String) .setPaid(@Nullable Boolean) .setExternalUserIds(@Nullable List) .addBlockedAdvertiserIABCategory(@NonNull String) .addBlockedAdvertiserDomain(@NonNull String) .addBlockedApplication(@NonNull String); ``` }> ```kotlin val targetingParams = TargetingParams() .setUserId(String?) .setGender(Gender?) .setBirthdayYear(Int?) .setKeywords(vararg String?) .setDeviceLocation(Location?) .setCountry(String?) .setCity(String?) .setZip(String?) .setStoreUrl(String?) .setStoreCategory(String?) .setStoreSubCategories(vararg String?) .setFramework(String?) .setPaid(Boolean?) .setExternalUserIds(List?) .addBlockedAdvertiserIABCategory(String) .addBlockedAdvertiserDomain(String) .addBlockedApplication(String) ``` `TargetingParams` can be passed with 2 ways: - Through global parameters: }> ```java BidMachine.setTargetingParams(targetingParams); ``` }> ```kotlin BidMachine.setTargetingParams(targetingParams) ``` - Through ad request builder: }> ```java adRequestBuilder.setTargetingParams(targetingParams); ``` }> ```kotlin adRequestBuilder.setTargetingParams(targetingParams) ``` You can combine global parameters with regular. If you set Global `TargetingParams` using `UserId`, and then make a request using `TargetingParams` with `Gender` set, both requests will be merged and the resulting `TargetingParams` will include both `UserId` and `Gender`. :::tip Priority of Targeting Parameters Priority is given to the `AdRequest` parameters. ::: ## Auction Request Settings ### Price Floor Parameters The price floor info is used to set a minimum price for the ad unit, you can pass multiple price floors for one ad request. :::tip Price Floor Currency The price floor is always in the US dollars. ::: If you use the method with only **Price** provided `PriceFloorParams.addPriceFloor(Double)`, the **Id** will be generated using `UUID.randomUUID()`. }> ```java PriceFloorParams priceFloorParams = new PriceFloorParams() // Set Bid Price, in this case id will be generated .addPriceFloor(double) // Set Bid Id and Price .addPriceFloor(@NonNull String, double); ``` }> ```kotlin val priceFloorParams = PriceFloorParams() // Set Bid Price, in this case id will be generated .addPriceFloor(Double) // Set Bid Id and Price .addPriceFloor(String, Double) ``` | Parameter | Type | Description | | :-------- | :----- | :----------------------- | | Id | String | Unique floor identifier. | | Price | double | Floor price | To set up price floor parameters for ad request use `setPriceFloorParams` method from `AdRequest` builder according to ads type. }> ```java adRequestBuilder.setPriceFloorParams(priceFloorParams); ``` }> ```kotlin adRequestBuilder.setPriceFloorParams(priceFloorParams) ``` ## Placement Settings ### Custom Parameters You can pass custom parameters in the placement object to be sent to the server. Custom parameters is a dictionary of key-value pairs that can be used for targeting or reporting purposes. }> ```java CustomParams customParams = new CustomParams() .addParam(@NonNull String, @NonNull String) .addParams(@NonNull Map); ``` }> ```kotlin val customParams = CustomParams() .addParam(String, String) .addParams(Map) ``` To set up custom parameters for ad request use `setCustomParams` method from `AdRequest` builder according to ads type. }> ```java adRequestBuilder.setCustomParams(customParams); ``` }> ```kotlin adRequestBuilder.setCustomParams(customParams) ``` ## Auction Info The auction info provides details about the ad auction, including bid ID, creative ID, deal ID, campaign ID, demand source, price, and custom parameters. You can get `AuctionResult` in two ways: - Through `AdRequestListener`. Use `AuctionResult` from `onRequestSuccess` callback }> ```java adRequestBuilder.setListener(new .AdRequestListener() { @Override public void onRequestSuccess(@NonNull adRequest, @NonNull AuctionResult auctionResult) { // Use AuctionResult from onRequestSuccess callback } }); ``` }> ```kotlin adRequestBuilder.setListener(object : .AdRequestListener { override fun onRequestSuccess(adRequest: , auctionResult: AuctionResult) { // Use AuctionResult from onRequestSuccess callback } }); ``` - Through getter. Each `AdRequest` has an option to retrieve auction result information after it has been loaded. }> ```java adRequest.getAuctionResult(); ``` }> ```kotlin adRequest.auctionResult ``` | Parameter | Type | Description | Sample | | ---------------- | ---------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------- | | Id | String | Winner bid ID provided in the request. | `cc5bd14b-aaef-4037-b4f8-879913366e3c` | | Demand Source | String | Winner advertising source name. | `BidMachine Test` | | Price | double | Winner price expressed as CPM. | `0.023` | | Deal | String | Id of Price Floor. | `d6f61bf9-11a8-4172-a77d-4b1ff85a727f` | | Creative Id | String | Winner creative id. | `123.13579` | | CID | String | Winner Campaign ID or other similar grouping of brand-related ads. | `123.13587` | | Ad Domain | Array of String | Winner advertiser domain (top two levels only, e.g., “ford.com”). | `["sample1.com", "sample2.com"]` | | Network Key | String | Winner network key. This network will be loaded. | `mraid` | | Network Params | Map, String - String | Client parameters of winner networks. | — | | Creative Format | Enum | `CreativeFormat`, one of: Banner, Video, Native. | `CreativeFormat.Video` | | Custom Params | Map, String - String | Map that contains additional information about the response. | — | ## Win/Loss notifications Call `notifyMediationWin`/`notifyMediationLoss` on the AdRequest instance when BidMachine wins/loses the mediation among networks. - Win notification: }> ```java adRequest.notifyMediationWin(); ``` }> ```kotlin adRequest.notifyMediationWin() ``` - Loss notification: }> ```java adRequest.notifyMediationLoss("", ); // or adRequest.notifyMediationLoss(); ``` }> ```kotlin adRequest.notifyMediationLoss("", ) // or adRequest.notifyMediationLoss() ``` --- ## App Privacy Details On Google Play # App Privacy Details on Google Play This document outlines the types of user data the app handles, whether we collect it, and relevant remarks for each category. ## Data Collected The app does collect the following data types under specified conditions: - **Device ID** Collected by the BidMachine SDK - **Advertising Data** Collected by the BidMachine SDK - **Other Data Types** The BidMachine SDK may also collect: - **Technical device information** (e.g., device type, operating system, browser) - **Other device information** (e.g., smartphone vs. tablet) - **Network information** (e.g., network provider) - **Carrier user ID** (a unique number assigned by the network provider) ## Data Collected Conditionally (Optional) These data types are collected only if the host app has obtained the corresponding location permission from the user. The BidMachine SDK never requests location permissions itself: - **Precise Location** Optional — collected by the BidMachine SDK only if the host app has obtained the `ACCESS_FINE_LOCATION` permission from the user. The SDK does not request this permission itself. - **Coarse Location** Optional — collected by the BidMachine SDK if the host app has obtained the `ACCESS_COARSE_LOCATION` permission. ## Data Not Collected Below is a list of data types that the app does **not** collect: - **Name** - **Email Address** - **Phone Number** - **Physical Address** - **Other User Contact Info** - **Health** - **Fitness** - **Payment Info** - **Credit Info** - **Other Financial Info** - **Sensitive Info** - **Contacts** - **Emails or Text Messages** - **Photos or Videos** - **Audio Data** - **Gameplay Content** - **Other User Content** - **Browsing History** - **Search History** - **User ID** - **Purchase History** - **Other Usage Data** - **Other Diagnostic Data** --- ## Banner / MREC Ads import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import JavaLabel from "@site/src/components/code-labels/java"; import KotlinLabel from "@site/src/components/code-labels/kotlin"; ## Ad Request ### Placement Create placement configuration using `AdPlacementConfig.bannerBuilder()` with `BannerAdSize`, placement id and other parameters. }> ```java AdPlacementConfig config = AdPlacementConfig.bannerBuilder() .withPlacementId(...) // Set placement id .withCustomParams(...) // Set custom parameters .build(); BannerRequest.Builder bannerRequestBuilder = new BannerRequest.Builder(config) .setTargetingParams(...) // Set TargetingParams instance .setPriceFloorParams(...) // Set price floor parameters .setLoadingTimeOut(...) // Set loading timeout in milliseconds ``` }> ```kotlin val config = AdPlacementConfig.bannerBuilder() .withPlacementId(...) // Set placement id .withCustomParams(...) // Set custom parameters .build() val bannerRequestBuilder = BannerRequest.Builder(config) .setTargetingParams(...) // Set TargetingParams instance .setPriceFloorParams(...) // Set price floor parameters .setLoadingTimeOut(...) // Set loading timeout in milliseconds ``` #### BannerAdSize `BannerAdSize` is a required parameter for banner placement: | Type | Size | Description | | :---------------------------| :-------| :----------------------------------| | `BannerAdSize.Banner` | 320x50 | Standard banner size | | `BannerAdSize.Leaderboard` | 728x90 | Leaderboard banner size for tablets| | `BannerAdSize.MediumRectangle` | 300x250 | Medium rectangle (MREC) banner | #### Adaptive Banners You can create adaptive banners with custom width and maximum height: }> ```java // Adaptive banner with width 350 and max height 100 BannerAdSize adaptiveSize = BannerAdSize.adaptive(350, 100); AdPlacementConfig config = AdPlacementConfig.bannerBuilder(adaptiveSize) .withPlacementId(...) .build(); // Check if banner is adaptive if (adaptiveSize.isAdaptive()) { // Handle responsive rendering } ``` }> ```kotlin // Adaptive banner with width 350 and max height 100 val adaptiveSize = BannerAdSize.adaptive(350, 100) val config = AdPlacementConfig.bannerBuilder(adaptiveSize) .withPlacementId(...) .build() // Check if banner is adaptive if (adaptiveSize.isAdaptive) { // Handle responsive rendering } ``` :::info Calculating Adaptive Height Use `BannerAdSize.getMaxAdaptiveHeight(width)` to get the maximum expected banner height for a given width. Both parameter and return value are in density-independent pixels (dp). ::: }> ```java // Get screen width in dp DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); int screenWidthDp = (int) (displayMetrics.widthPixels / displayMetrics.density); // Calculate maximum adaptive height for screen width int maxHeightDp = BannerAdSize.getMaxAdaptiveHeight(screenWidthDp); // Create adaptive banner with calculated dimensions BannerAdSize adaptiveSize = BannerAdSize.adaptive(screenWidthDp, maxHeightDp); ``` }> ```kotlin // Get screen width in dp val displayMetrics = resources.displayMetrics val screenWidthDp = (displayMetrics.widthPixels / displayMetrics.density).toInt() // Calculate maximum adaptive height for screen width val maxHeightDp = BannerAdSize.getMaxAdaptiveHeight(screenWidthDp) // Create adaptive banner with calculated dimensions val adaptiveSize = BannerAdSize.adaptive(screenWidthDp, maxHeightDp) ``` ### General Request Set the `BannerRequest.AdRequestListener` instance to the`BannerRequest.Builder` instance. }> ```java bannerRequestBuilder.setListener(new BannerRequest.AdRequestListener() { @Override public void onRequestSuccess(@NonNull BannerRequest request, @NonNull AuctionResult auctionResult) { // Called when BannerRequest was requested successfully } @Override public void onRequestFailed(@NonNull BannerRequest request, @NonNull BMError error) { // Called when BannerRequest request failed } @Override public void onRequestExpired(@NonNull BannerRequest request) { // Called when BannerRequest expired } }); ``` }> ```kotlin bannerRequestBuilder.setListener(object : BannerRequest.AdRequestListener { override fun onRequestSuccess(request: BannerRequest, auctionResult: AuctionResult) { // Called when BannerRequest was requested successfully } override fun onRequestFailed(request: BannerRequest, error: BMError) { // Called when BannerRequest request failed } override fun onRequestExpired(request: BannerRequest) { // Called when BannerRequest expired } }) ``` :::note `AdRequestListener` callbacks are delivered on the background thread, not the main one. ::: When all the necessary parameters are set, call `build` on the `BannerRequest.Builder` instance: }> ```java BannerRequest bannerRequest = bannerRequestBuilder.build(); ``` }> ```kotlin val bannerRequest = bannerRequestBuilder.build() ``` :::warning Keep Ad Request You need to keep reference to `BannerRequest` before calling `BannerRequest#request`, otherwise, it is possible it will be cleared by Garbage Collector and callbacks won’t be triggered. ::: ### Client Bidding Request #### Bid Token With S2S integration, you will need a `BidToken` that you need to transfer in the request. Define `AdPlacementConfig`: }> ```java AdPlacementConfig adPlacementConfig = AdPlacementConfig.bannerBuilder() .withPlacementId(...) // Set placement id .build(); ``` }> ```kotlin val adPlacementConfig = AdPlacementConfig.bannerBuilder() .withPlacementId(...) // Set placement id .build() ``` To get a `BidToken`, you can use one of 2 methods: }> ```java // Must be run on background thread String bidToken = BidMachine.getBidToken(@NonNull Context, @NonNull AdPlacementConfig); ``` }> ```kotlin // Must be run on background thread val bidToken = BidMachine.getBidToken(Context, AdPlacementConfig) ``` or }> ```java BidMachine.getBidToken(@NonNull Context, @NonNull AdPlacementConfig, new BidTokenCallback() { @Override public void onCollected(@NonNull String bidToken) { // The BidToken will be returned on a background thread } }); ``` }> ```kotlin BidMachine.getBidToken(Context, AdPlacementConfig) { bidToken -> // The BidToken will be returned on a background thread } ``` #### Bid Payload After completing the server-side auction, you will receive a Base64-encoded payload string, which must be passed as a parameter to the `BannerRequest.Builder`: }> ```java bannerRequestBuilder.setBidPayload(@Nullable String); ``` }> ```kotlin bannerRequestBuilder.setBidPayload(String?) ``` When all the necessary parameters are set, call `build` on the `BannerRequest.Builder` instance: }> ```java BannerRequest bannerRequest = bannerRequestBuilder.build(); ``` }> ```kotlin val bannerRequest = bannerRequestBuilder.build() ``` :::warning Keep Ad Request You need to keep reference to `BannerRequest` before calling `BannerRequest#request`, otherwise, it is possible it will be cleared by Garbage Collector and callbacks won’t be triggered. ::: ## Ad Display ### Prepare the Ad Request object When you need to request an ad and get an [`AuctionResult`](/sdk/general/android/advanced#auction-info), call `request` on the `BannerRequest` instance. }> ```java bannerRequest.request(...); ``` }> ```kotlin bannerRequest.request(...) ``` :::note If you have an in-house meditation and you decide that an advertisement from BidMachine will be shown - call `bannerRequest.notifyMediationWin`, if BidMachine loses the mediation - call `bannerRequest.notifyMediationLoss` ::: Destroy the `BannerRequest` instance if you don't need it anymore. }> ```java bannerRequest.destroy(); ``` }> ```kotlin bannerRequest.destroy() ``` :::warning Don't destroy the `BannerRequest` instance, if it will be used for load the `BannerView` instance or if the `BannerView` instance loaded with the `BannerRequest` instance has not been shown yet. Otherwise, ad will not work correctly, which can affect a lower display rate, fill rate, rendering errors, and as a result - lower revenue. ::: ### Define Ad Listener Before executing `load` on the `BannerView` instance, set up the `BannerListener` instance: }> ```java BannerView bannerView = new BannerView(...); bannerView.setListener(new BannerListener() { @Override public void onAdLoaded(@NonNull BannerView ad) { // Called when Ad was loaded and ready to be displayed } @Override public void onAdLoadFailed(@NonNull BannerView ad, @NonNull BMError error) { // Called when Ad failed to load } @Override public void onAdImpression(@NonNull BannerView ad) { // Called when Ad Impression has been tracked } @Override public void onAdShowFailed(@NonNull BannerView ad, @NonNull BMError error) { // Called when Ad show failed } @Override public void onAdClicked(@NonNull BannerView ad) { // Called when Ad has been clicked } @Override public void onAdExpired(@NonNull BannerView ad) { // Called when Ad expired } }); bannerView.load(bannerRequest); ``` }> ```kotlin val bannerView = BannerView(...) bannerView.setListener(object : BannerListener { override fun onAdLoaded(ad: BannerView) { // Called when Ad was loaded and ready to be displayed } override fun onAdLoadFailed(ad: BannerView, error: BMError) { // Called when Ad failed to load } override fun onAdImpression(ad: BannerView) { // Called when Ad Impression has been tracked } override fun onAdShowFailed(ad: BannerView, error: BMError) { // Called when Ad show failed } override fun onAdClicked(ad: BannerView) { // Called when Ad has been clicked } override fun onAdExpired(ad: BannerView) { // Called when Ad expired } }) bannerView.load(bannerRequest) ``` #### Get loaded ad size `BannerView.adSize` returns the `BannerAdSize` received from the `AdResponse`. Read it in `onAdLoaded` to access the actual width and height of the creative: }> ```java @Override public void onAdLoaded(@NonNull BannerView ad) { BannerAdSize loadedSize = ad.getAdSize(); int width = loadedSize.getWidth(); int height = loadedSize.getHeight(); } ``` }> ```kotlin override fun onAdLoaded(ad: BannerView) { val loadedSize = ad.adSize val width = loadedSize.width val height = loadedSize.height } ``` ### Loading and presenting banner ads Make sure that the `BannerRequest` instance has `AuctionResult`. It means the ads have been requested successfully. }> ```java bannerRequest.getAuctionResult() != null ``` }> ```kotlin bannerRequest.auctionResult != null ``` Use `onAdLoaded` callback to determine the possibility of displaying Before displaying, check if the `BannerView` instance can be displayed: }> ```java bannerView.canShow(); ``` }> ```kotlin bannerView.canShow() ``` To display the `BannerView` instance, you just need to add it to the layout. }> ```java viewGroup.removeAllViews(); viewGroup.addView(bannerView); ``` }> ```kotlin viewGroup.removeAllViews() viewGroup.addView(bannerView) ``` After ad was successful shown and no longer needed, it can be destroyed. }> ```java bannerView.destroy(); ``` }> ```kotlin bannerView.destroy() ``` :::info You can find code examples written in Java and Kotlin: [Github Banner](https://github.com/bidmachine/BidMachine-Android-Examples/tree/master/bidmachine-banner) ::: --- ## Changelog(Android) ## Version 3.8.0 (August 25, 2026) **Features**: * Added `Picture-in-Picture` (`PiP`) support * Improved audio handling for video ads **Bug fixes**: * Added protection against non-closing fullscreen ads * Improved `GDPR` consent handling * Fixed rare `ANR` when playing videos * Improved `OM SDK` compatibility ## Version 3.7.1 (May 29, 2026) **Bug fixes**: * Improved work with `UserAgent` * Stability improvements ## Version 3.7.0 (May 11, 2026) **Features**: * Updated `OM SDK` to 1.6.3 * Added disclaimer view support for native ads * Added `CTV` device type support * Deprecated public API methods: ``` BidMachine.setUSPrivacyString(String) BidMachine.setConsentConfig(Boolean, String) ``` * Added public API methods: ``` BidMachine.setNonPersonalized(Boolean?) BidMachine.setConsentStatus(Boolean) ``` **Bug fixes**: * Fixed `NPE` in `dispatchDetachedFromWindow` * Fixed crash in `BidMachineAd` ## Version 3.6.1 (March 23, 2026) **Bug fixes**: * Stability improvements ## Version 3.6.0 (March 11, 2026) **Features**: * Added viewability tracker for support `IAB` `MRC` * Updated `OM SDK` to 1.6.1 * Improved `BidMachineInitProvider` performance * Mute `WebView` audio via `androidx.webkit` **Bug fixes**: * Fixed rewarded video skip via app backgrounding (`singleTask`) * Fixed `OM SDK` 1.6.1 r8 rules * Fixed `ANR` with `WebChromeClient#getVisitedHistory` ## Version 3.5.1 (December 11, 2025) **Features**: - Added `BannerView.adSize` that returns `BannerAdSize` received from the `AdResponse` - Added `BannerAdSize.getMaxAdaptiveHeight(width)` that returns maximum expected banner height for a given width **Bug fixes:** - Fixed banner expand issues - Fixed `OMSDK` overlapping issues ## Version 3.5.0 (October 21, 2025) :::warning Deprecated `BannerSize` and `AdsFormat` enums are deprecated. Use `BannerAdSize` and `AdFormat` classes instead. The following public API methods are deprecated: ```java BannerRequest.Builder() // no-arg constructor InterstitialRequest.Builder() // no-arg constructor RewardedRequest.Builder() // no-arg constructor NativeRequest.Builder() // no-arg constructor BannerRequest.Builder#setSize(BannerSize) BannerRequest#getSize() InterstitialRequest.Builder#setAdContentType(AdContentType) RewardedRequest.Builder#setAdContentType(AdContentType) NativeRequest.Builder#setMediaAssetTypes(MediaAssetType...) RequestBuilder#setPlacementId(String) RequestBuilder#setCustomParams(CustomParams) AdRequestParameters#getAdsFormat() BannerAdRequestParameters#getBannerSize() ``` ::: **Features**: - Updated public API: - Added `AdFormat` sealed class for type-safe ad formats - Added `AdPlacementConfig` builder methods: ``` AdPlacementConfig.bannerBuilder(BannerAdSize) AdPlacementConfig.interstitialBuilder(AdContentType) AdPlacementConfig.rewardedBuilder(AdContentType) AdPlacementConfig.nativeBuilder(List) ``` - Added new request builder constructors: ``` BannerRequest.Builder(AdPlacementConfig) InterstitialRequest.Builder(AdPlacementConfig) RewardedRequest.Builder(AdPlacementConfig) NativeRequest.Builder(AdPlacementConfig) ``` - Added adaptive banner support: - New `BannerAdSize` class: ``` BannerAdSize.adaptive(width, maxHeight) BannerAdSize.isAdaptive() ``` - Added API method: ``` BannerRequest#getBannerAdSize() ``` - Reworked asset caching logic for improved storage efficiency and faster ad caching - Added support for inline installs on Android - Added support for expandable MRAID ads ## Version 3.4.0 (August 7, 2025) **Features**: - Updated `OM SDK` to `1.5.5` - Reduced SDK size in release builds by **15%** - Deprecated `SessionAdParams` - Deprecated public API methods: ``` AdRequestParameters#getSessionAdParams() RequestBuilder#setSessionAdParams(sessionAdParams) ``` **Bug fixes:** - Fixed `overrideActivityTransition` crash - Fixed animation glitches ## Version 3.3.0 (May 26, 2025) **Features**: - Added `AdPlacementConfig` - Added public API methods: ``` BidMachine.getBidToken(context, adPlacementConfig) BidMachine.getBidToken(context, adPlacementConfig, callback) ``` - Removed public API methods: ``` BidMachine.getBidToken(context) BidMachine.getBidToken(context, callback) ``` - Deprecated public API methods: ``` BidMachine.getBidToken(context, adsFormat) BidMachine.getBidToken(context, adsFormat, callback) ``` - Changed to `@NonNull AdsFormat` in deprecated `getBidToken` methods: ``` BidMachine.getBidToken(context, adsFormat) BidMachine.getBidToken(context, adsFormat, callback) ``` - `BidMachineInitProvider` performance improvements ## Version 3.2.1 (March 21, 2025) **Features**: - Removed `mraid.resize` and `mraid.expand` support - Updated `OM SDK` to 1.5.4 - Restricted ad ids for `COPPA` traffic **Bug fixes**: - Fixed `BidMachineInitProvider` ANR - Fixed `User-Agent` related ANR ## Version 3.2.0 (February 12, 2025) **Features**: - Added support for `ERID` requirements - Added `Deep Links` support - Added `User-Agent` to trackers - Removed image aspect ratio checker from `Native Ad` - Improved Referrer HTTP header field for `MRAID` ad **Bug fixes**: - Fixed `SessionManager` crash - Fixed possible loss of networks during initialization ## Version 3.1.1 (November 19, 2024) **Features**: - Rollback compatibility with Gradle 7.2+ and AGP 7.1+ - Extend MRAID features support **Bug fixes**: - Fix `InstallReferrer` ANR - Internal changes and stability improvements ## Version 3.1.0 (October 30, 2024) **Features**: - Internal changes and stability improvements - Increased target API version to 35 - Updated `OM SDK` to 1.5.2 - Updated r8 rules - Locked all dependencies versions - Increased min Gradle version to 8.0 - Increased min Android Gradle Plugin version to 8.0.2 ## Version 3.0.1 (September 12, 2024) **Features**: - Get rid of orientation in ad unit - All views in native ads are clickable by default if no list is passed explicitly ## Version 3.0.0 (July 23, 2024) > 🚧 Increased `minSdk` to 21 (5.0, Lollipop) **Features**: - Removed deprecated `RichMedia` ad type - Deprecated `SessionPlacementData` - Deprecated `getBidToken` methods without `AdsFormat`: ``` BidMachine.getBidToken(context) BidMachine.getBidToken(context, callback) ``` - Updated `OM SDK` version to 1.5.0 - Added API method to get extras parameters: ``` BidMachine.getExtrasParam(context, key) ``` **Bug fixes**: - Fixed ANR `io.bidmachine.core.Logger.log` - Fixed `IAB` StackOverflowError when calling `Utils.findEndpoint` ## Version 2.7.0 (May 8, 2024) **Features**: - Added `GAM` dynamic version range support from 21.0.0 to 23.0.0 **Bug fixes**: - Fixed `ClassCastException` with `ExoPlayer` ## Version 2.6.0 (April 5, 2024) **Features**: - Increased target API version to 34 - Updated `OM SDK` version to 1.4.12. Passed certification by `OM SDK`. **Bug fixes**: - Fixed ANR `Utils.getCacheDir` - Fixed ANR `UserAgentProvider` ## Version 2.5.2 (March 7, 2024) **Features**: - Small internal dependency improvements. Excluded Multidex. ## Version 2.5.1 (March 1, 2024) **Features**: - Deprecated `RichMedia` ad type - Improved processing `WebViewClient#onRenderProcessGone` (fix for possible `WebView` crashes) ## Version 2.5.0 (February 16, 2024) **Features**: - Improvements with internal modules - Minor optimisation and fixes - Optimised token fetch mechanism ## Version 2.4.2 (January 26, 2024) **Features**: - Internal improvements ## Version 2.4.1 (January 4, 2024) **Features**: - Minor improvements for enhanced internal functionality ## Version 2.4.0 (November 9, 2023) **Features**: - Added GPP Support - Improved integration with Google **Bug fixes**: - Fixed `Context` memory leak - Fixed `OnClose` callback ## Version 2.3.4 (November 9, 2023) **Features**: - Improved visibility tracking logs **Bug fixes**: - Fixed impression tracking with some networks ## Version 2.3.3 (September 4, 2023) **Features**: - Improved integration with Google. - Improved internal tracking logic. - Improved Native Ads tracking. ## Version 2.3.2 (August 2, 2023) **Features**: - Improved object cleanup during `NativeAdObject#unregisterView` ## Version 2.3.1 (July 21, 2023) **Features**: - SDK improvement - Added `onAdShowFailed` callback for Banner/Mrec, Native, RichMedia ad types ## Version 2.2.0 (May 15, 2023) **Features**: - Updated the logic for working with `BidToken` - Added API methods: ``` BidMachine.getBidToken(context, adsFormat) BidMachine.getBidToken(context, adsFormat, callback) ``` **Bugfixes**: - Moved `UserAgent` initialization from `preInitialize` to `initialize` ## Version 2.1.13 (April 13, 2023) **Features**: - SDK improvement ## Version 2.1.12 (March 24, 2023) **Features**: - SDK improvement ## Version 2.1.11 (March 14, 2023) **Features**: - Updated SDK events ## Version 2.1.10 (March 3, 2023) **Features**: - SDK improvement ## Version 2.1.9 (February 23, 2023) **Features**: - Improved `Utils.onBackgroundThread` ## Version 2.1.8 (February 15, 2023) **Features**: - SDK improvement - Increased target API version to 33 - Added more safety for `BidMachineImpl.preInitialize` - Added more information in error events - Updated tracking event logic **Bugfixes**: - Fixed `OutOfMemory` crashes in `NetworkRequest#request` - Fixed `NullPointerException` crashes in `AdRequest#destroy` ## Version 2.1.7 (January 26, 2023) **Bugfixes**: - Fixed `ConcurrentModificationException` crashes in `AdProcessCallbackComposite.executeOnCallback` ## Version 2.1.6 (January 25, 2023) **Bugfixes**: - Fixed `ConcurrentModificationException` crashes in `AdProcessCallbackComposite.executeOnCallback` - Fixed `OutOfMemory` crashes in `NetworkLoadTask#execute` - Fixed `IllegalStateException` crashes in `MediaView#tryPlayVideo` ## Version 2.1.5 (November 16, 2022) **Features**: - SDK improvement ## Version 2.1.4 (November 9, 2022) **Features**: - SDK improvement ## Version 2.1.3 (November 8, 2022) **Features**: - SDK improvement ## Version 2.1.2 (November 7, 2022) **Features**: - Updated analytics ## Version 2.1.1 (October 22, 2022) **Bug fixes**: - Fixed `ConcurrentModificationException` crashes in `AdResponse` ## Version 2.1.0 (September 29, 2022) **Features**: - SDK improvement ## Version 2.0.0 (September 5, 2022) **Features**: - SDK improvement - Added Java 8 - Removed `AdListener#onAdShown`, use `AdListener#onAdImpression` instead ## Version 1.9.10 (August 16, 2022) **Features**: - SDK improvement ## Version 1.9.9 (August 8, 2022) **Features**: - SDK improvement ## Version 1.9.8 (August 1, 2022) **Features**: - Updated IAB library to 1.0.0 ## Version 1.9.7 (July 14, 2022) **Features**: - Deprecated `AdListener#onAdShown`, use `AdListener#onAdImpression` instead ## Version 1.9.6 (June 30, 2022) **Features**: - SDK improvement ## Version 1.9.5 (June 21, 2022) **Features**: - SDK improvement ## Version 1.9.4 (May 30, 2022) **Features**: - SDK improvement ## Version 1.9.3 (March 31, 2022) **Features**: - SDK improvement ## Version 1.9.2 (March 16, 2022) **Features**: - SDK improvement - Increased minimum API version to 16 - Increased target API version to 31 ## Version 1.9.1 (February 11, 2022) **Features**: - Added API method `AdRequest.Builder#setCustomParams` to set custom parameters ## Version 1.9.0 (February 01, 2022) **Features**: - SDK improvement - Added API method `BidMachine.getBidToken` to get BidToken for S2S integration ## Version 1.8.3 (December 29, 2021) **Features**: - SDK improvement ## Version 1.8.2 (December 23, 2021) **Features**: - SDK improvement ## Version 1.8.1 (November 26, 2021) **Features**: - SDK improvement ## Version 1.8.0 (October 26, 2021) **Features**: - Added `RichMediaView` to display video ads into the view ## Version 1.7.7 (October 21, 2021) **Features**: - SDK improvement - Added API method `AdRequest#notifyMediationLoss` with WinnerNetworkName and WinnerNetworkPrice parameters to notify BidMachine of loss if you use BidMachine like in-house mediation - Removed `AuctionResult#getSeat` ## Version 1.7.6 (July 21, 2021) **Features**: - SDK improvement ## Version 1.7.5 (June 30, 2021) **Features**: - SDK improvement ## Version 1.7.4 (May 31, 2021) **Features**: - SDK improvement - Added API method `AdRequest.Builder#setPlacementId` to set placement id - Deprecated `AuctionResult#getSeat` ## Version 1.7.3 (May 18, 2021) **Features**: - SDK improvement - Added `TargetingParams#setExternalUserIds` to pass external user ids - Removed `AdRequest.Builder#disableHeaderBidding` and `AdRequest.Builder#enableHeaderBidding` - Removed client-side price rounding. At the same time, some deprecated methods were removed that were responsible for the price rounding from `BidMachineFetcher` ## Version 1.7.2 (April 20, 2021) **Features**: - SDK improvement - Added API method `AdRequest.Builder#setBidPayload` to set BidPayload - Added support for OMSDK version 1.3.15 ## Version 1.7.1 (March 30, 2021) **Features**: - SDK improvement - Added API method `AdRequest#destroy` to destroy AdRequest - Deprecated client-side rounding, use server side rounding - Deprecated 3rd party helpers, use adapter helpers ## Version 1.6.4 (February 12, 2021) **Features**: - Improved visibility tracker ## Version 1.6.3 (January 18, 2021) **Features**: - Banner improvement ## Version 1.6.2 (December 17, 2020) **Features**: - Added support TCF 2.0 - `IABTCF_TCString` and `IABTCF_gdprApplies` ## Version 1.6.1 (November 3, 2020) **Features**: - SDK improvement ## Version 1.6.0 (September 11, 2020) **Features**: - SDK improvement - Added API method `BidMachine.setUSPrivacyString` to set US privacy string - Added API method `AdRequest.Builder#setNetworks` to set certain networks for AdRequest - Added API method `AdRequest.Builder#setSessionAdParams` to set additional session parameters for AdRequest - Updated AdColony adapter version to 1.6.0.5. - Updated Amazon adapter version to 1.6.0.3. - Updated Facebook adapter version to 1.6.0.4. - Updated MyTarget adapter version to 1.6.0.3. - Updated Tapjoy adapter version to 1.6.0.4. ## Version 1.5.2 (August 3, 2020) **Features**: - SDK improvement - Updated AdColony adapter version to 1.5.2.4. More info [here](https://github.com/bidmachine/BidMachine-Android-SDK/blob/master/adapters/adcolony/CHANGELOG.md) - Updated Criteo adapter version to 1.5.2.4. More info [here](https://github.com/bidmachine/BidMachine-Android-SDK/blob/master/adapters/criteo/CHANGELOG.md) ## Version 1.5.1 (July 15, 2020) **Features**: - Native ad improvement ## Version 1.5.0 (July 10, 2020) **Features**: - SDK improvement - Combining BidMachineFetcher and BidMachineHelper. Use BidMachineFetcher instead BidMachineHelper - Added API method `AdRequest.Builder#setLoadingTimeOut` to set loading timeout for AdRequest - Added API method `AdRequest#notifyMediationWin` and `AdRequest#notifyMediationLoss` to notify BidMachine of win/loss if you use BidMachine like in-house mediation ## Version 1.4.4 (May 22, 2020) **Features**: - Updated Amazon version to 8.3.0 - Updated Criteo version to 3.5.0 ## Version 1.4.3 (April 9, 2020) **Features**: - Added support CCPA based on IAB. More info [here](https://github.com/InteractiveAdvertisingBureau/USPrivacy/blob/master/CCPA/Version%201.0/USP%20API.md) - Updated AdColony version to 4.1.0 - Updated Facebook version to 5.7.1 - Updated Tapjoy version to 12.4.2 ## Version 1.4.1 (January 21, 2020) **Features**: - Added API method `BidMachine.setPublisher` to set publisher information - Added API methods `Builder#disableHeaderBidding` and `Builder#enableHeaderBidding` to AdRequest to disable/enable header bidding on server side ## Version 1.4.0 (November 28, 2019) **Features**: - Added Native Ad type ## Version 1.3.3 (September 20, 2019) **Features**: - Added Amazon network adapter for Header-Bidding - Added Criteo network adapter for Header-Bidding ## Version 1.3.2 (September 12, 2019) **Features**: - Update compatibility with Google's Protobuf libraries ## Version 1.3.1 (September 4, 2019) **Features**: - Added Mintegral network adapter for Header-Bidding - Update proguard rules ## Version 1.3.0 (August 14, 2019) **Features**: - Support of 3d party Ad networks adapters for Header-Bidding that work with BidMachine via SDK - Possibility to change endpoint - Support of GDPR settings exchange with SharedPreferences (you can found more info [here](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/Mobile%20In-App%20Consent%20APIs%20v1.0%20Final.md#how-do-third-party-sdks-vendors-access-the-consent-information-)) --- ## Interstitial Ads import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import JavaLabel from "@site/src/components/code-labels/java"; import KotlinLabel from "@site/src/components/code-labels/kotlin"; ## Ad Request ### Placement Create placement configuration using `AdPlacementConfig.interstitialBuilder()` with `AdContentType`, placement id and other parameters. }> ```java AdPlacementConfig config = AdPlacementConfig.interstitialBuilder() .withPlacementId(...) // Set placement id .withCustomParams(...) // Set custom parameters .build(); InterstitialRequest.Builder interstitialRequestBuilder = new InterstitialRequest.Builder(config) .setTargetingParams(...) // Set TargatingParams instance .setPriceFloorParams(...) // Set price floor parameters .setLoadingTimeOut(...) // Set loading timeout in milliseconds ``` }> ```kotlin val config = AdPlacementConfig.interstitialBuilder() .withPlacementId(...) // Set placement id .withCustomParams(...) // Set custom parameters .build() val interstitialRequestBuilder = InterstitialRequest.Builder(config) .setTargetingParams(...) // Set TargatingParams instance .setPriceFloorParams(...) // Set price floor parameters .setLoadingTimeOut(...) // Set loading timeout in milliseconds ``` #### AdContentType | Type | Description | | :------------------- | :------------------------------------------------------ | | `AdContentType.All` | Flag to request both **Video** and **Static** ad content types. | | `AdContentType.Static` | Flag to request **Static** ad content type only. | | `AdContentType.Video` | Flag to request **Video** ad content type only. | :::info By default `AdContentType` is `AdContentType.All` ::: ### General Request Set the `InterstitialRequest.AdRequestListener` instance to the `InterstitialRequest.Builder` instance. }> ```java interstitialRequestBuilder.setListener(new InterstitialRequest.AdRequestListener() { @Override public void onRequestSuccess(@NonNull InterstitialRequest request, @NonNull AuctionResult auctionResult) { // Called when InterstitialRequest was requested successfully } @Override public void onRequestFailed(@NonNull InterstitialRequest request, @NonNull BMError error) { // Called when InterstitialRequest request failed } @Override public void onRequestExpired(@NonNull InterstitialRequest request) { // Called when InterstitialRequest expired } }); ``` }> ```kotlin interstitialRequestBuilder.setListener(object : InterstitialRequest.AdRequestListener { override fun onRequestSuccess(request: InterstitialRequest, auctionResult: AuctionResult) { // Called when InterstitialRequest was requested successfully } override fun onRequestFailed(request: InterstitialRequest, error: BMError) { // Called when InterstitialRequest request failed } override fun onRequestExpired(request: InterstitialRequest) { // Called when InterstitialRequest expired } }) ``` :::note `AdRequestListener` callbacks run on a background thread, not on the main thread. ::: When all the necessary parameters are set, call `build` on the `InterstitialRequest.Builder` instance: }> ```java InterstitialRequest interstitialRequest = interstitialRequestBuilder.build(); ``` }> ```kotlin val interstitialRequest = interstitialRequestBuilder.build() ``` :::caution Keep ad request You need to keep reference to `InterstitialRequest` before calling `InterstitialRequest.request`, otherwise, it is possible it will be cleared by Garbage Collector and callbacks won’t be triggered. ::: ### Client Bidding Request #### Bid Token With S2S integration, you will need a `BidToken` that you need to transfer in the request. Define `AdPlacementConfig`: }> ```java AdPlacementConfig adPlacementConfig = AdPlacementConfig.interstitialBuilder() .withPlacementId(...) // Set placement id .build(); ``` }> ```kotlin val adPlacementConfig = AdPlacementConfig.interstitialBuilder() .withPlacementId(...) // Set placement id .build() ``` To get a `BidToken`, you can use one of 2 methods: }> ```java // Must be run on background thread String bidToken = BidMachine.getBidToken(@NonNull Context, @NonNull AdPlacementConfig); ``` }> ```kotlin // Must be run on background thread val bidToken = BidMachine.getBidToken(Context, AdPlacementConfig) ``` or }> ```java BidMachine.getBidToken(@NonNull Context, @NonNull AdPlacementConfig, new BidTokenCallback() { @Override public void onCollected(@NonNull String bidToken) { // The BidToken will be returned on a background thread } }); ``` }> ```kotlin BidMachine.getBidToken(Context, AdPlacementConfig) { bidToken -> // The BidToken will be returned on a background thread } ``` #### Bid Payload After completing the server-side auction, you will receive a Base64-encoded payload string, which must be passed as a parameter to the `InterstitialRequest.Builder`: }> ```java interstitialRequestBuilder.setBidPayload(@Nullable String); ``` }> ```kotlin interstitialRequestBuilder.setBidPayload(String?) ``` When all the necessary parameters are set, call `build` on the `InterstitialRequest.Builder` instance: }> ```java InterstitialRequest interstitialRequest = interstitialRequestBuilder.build(); ``` }> ```kotlin val interstitialRequest = interstitialRequestBuilder.build() ``` :::caution Keep ad request You need to keep reference to `InterstitialRequest` before calling `InterstitialRequest.request`, otherwise, it is possible it will be cleared by Garbage Collector and callbacks won’t be triggered. ::: ## Ad Display ### Prepare the Ad Request object When you need to request an ad and get an [`AuctionResult`](/sdk/general/android/advanced#auction-info), call `request` on the `InterstitialRequest` instance. }> ```java interstitialRequest.request(...); ``` }> ```kotlin interstitialRequest.request(...) ``` :::info When you made an in-house meditation and you decided that an advertisement from BidMachine will be shown - call `interstitialRequest.notifyMediationWin`, if BidMachine lost in mediation - call `interstitialRequest.notifyMediationLoss` ::: Destroy the `InterstitialRequest` instance if you don't need it anymore. }> ```java interstitialRequest.destroy(); ``` }> ```kotlin interstitialRequest.destroy() ``` :::caution Don't destroy the `InterstitialRequest` instance, if it will be used for load the `InterstitialAd` instance or if the `InterstitialAd` instance loaded with the `InterstitialRequest` instance has not been shown yet. Otherwise, ad will not work correctly, which can affect a lower display rate, fill rate, rendering errors, and as a result - lower revenue. ::: ### Define Ad Listener Before execute `load` on the `InterstitialAd` instance set the `InterstitialListener` instance: }> ```java InterstitialAd interstitialAd = new InterstitialAd(...); interstitialAd.setListener(new InterstitialListener() { @Override public void onAdLoaded(@NonNull InterstitialAd ad) { // Called when Ad was loaded and ready to be displayed } @Override public void onAdLoadFailed(@NonNull InterstitialAd ad, @NonNull BMError error) { // Called when Ad failed to load } @Override public void onAdImpression(@NonNull InterstitialAd ad) { // Called when Ad Impression has been tracked } @Override public void onAdShowFailed(@NonNull InterstitialAd ad, @NonNull BMError error) { // Called when Ad show failed } @Override public void onAdClicked(@NonNull InterstitialAd ad) { // Called when Ad has been clicked } @Override public void onAdClosed(@NonNull InterstitialAd ad, boolean finished) { // Called when Ad was closed (e.g - user clicked the close button) // finished indicates if the ad was finished (e.g - video playing completed) } @Override public void onAdExpired(@NonNull InterstitialAd ad) { // Called when Ad expired } }); interstitialAd.load(interstitialRequest); ``` }> ```kotlin val interstitialAd = InterstitialAd(...) interstitialAd.setListener(object : InterstitialListener { override fun onAdLoaded(ad: InterstitialAd) { // Called when Ad was loaded and ready to be displayed } override fun onAdLoadFailed(ad: InterstitialAd, error: BMError) { // Called when Ad failed to load } override fun onAdImpression(ad: InterstitialAd) { // Called when Ad Impression has been tracked } override fun onAdShowFailed(ad: InterstitialAd, error: BMError) { // Called when Ad show failed } override fun onAdClicked(ad: InterstitialAd) { // Called when Ad has been clicked } override fun onAdClosed(ad: InterstitialAd, finished: Boolean) { // Called when Ad was closed (e.g - user clicked the close button) // finished indicates if the ad was finished (e.g - video playing completed) } override fun onAdExpired(ad: InterstitialAd) { // Called when Ad expired } }) interstitialAd.load(interstitialRequest) ``` ### Loading and presenting interstitial ads Make sure that the `InterstitialRequest` instance have `AuctionResult`. It's mean ads requested successfully. }> ```java interstitialRequest.getAuctionResult() != null ``` }> ```kotlin interstitialRequest.auctionResult != null ``` Use `onAdLoaded` callback to determine the possibility of displaying. Before displaying, check if the `InterstitialAd` instance can be displayed: }> ```java interstitialAd.canShow(); ``` }> ```kotlin interstitialAd.canShow() ``` To display the `InterstitialAd` instance, you just need to execute `show`. }> ```java interstitialAd.show(); ``` }> ```kotlin interstitialAd.show() ``` After ad was successful shown and no longer needed, it can be destroyed. }> ```java interstitialAd.destroy(); ``` }> ```kotlin interstitialAd.destroy() ``` :::info You can find code examples written in Java and Kotlin: [Github Interstitial](https://github.com/bidmachine/BidMachine-Android-Examples/tree/master/bidmachine-interstitial) ::: --- ## Native Ads import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import JavaLabel from "@site/src/components/code-labels/java"; import KotlinLabel from "@site/src/components/code-labels/kotlin"; ## Ad Request ### Placement Create placement configuration using `AdPlacementConfig.nativeBuilder()` with `MediaAssetType` list, placement id and other parameters. }> ```java List mediaTypes = Arrays.asList( MediaAssetType.Icon, MediaAssetType.Image ); AdPlacementConfig config = AdPlacementConfig.nativeBuilder(mediaTypes) .withPlacementId(...) // Set placement id .withCustomParams(...) // Set custom parameters .build(); NativeRequest.Builder nativeRequestBuilder = new NativeRequest.Builder(config) .setTargetingParams(...) // Set TargetingParams instance .setPriceFloorParams(...) // Set price floor parameters .setLoadingTimeOut(...) // Set loading timeout in milliseconds ``` }> ```kotlin val mediaTypes = listOf( MediaAssetType.Icon, MediaAssetType.Image ) val config = AdPlacementConfig.nativeBuilder(mediaTypes) .withPlacementId(...) // Set placement id .withCustomParams(...) // Set custom parameters .build() val nativeRequestBuilder = NativeRequest.Builder(config) .setTargetingParams(...) // Set TargetingParams instance .setPriceFloorParams(...) // Set price floor parameters .setLoadingTimeOut(...) // Set loading timeout in milliseconds ``` #### MediaAssetType | Type | Description | | :------------------- | :------------------------------------------------- | | MediaAssetType.All | Combination of Icon, Image and Video | | MediaAssetType.Icon | Only icon assets will be downloaded and displayed | | MediaAssetType.Image | Only image assets will be downloaded and displayed | | MediaAssetType.Video | Only video assets will be downloaded and displayed | You can also combine `MediaAssetType` by listing the list of required assets. :::info By default required assets are MediaAssetType.Icon and MediaAssetType.Image ::: ### General Request Set the `NativeRequest.AdRequestListener` instance to the`NativeRequest.Builder` instance. }> ```java nativeRequestBuilder.setListener(new NativeRequest.AdRequestListener() { @Override public void onRequestSuccess(@NonNull NativeRequest request, @NonNull AuctionResult auctionResult) { // Called when NativeRequest was requested successfully } @Override public void onRequestFailed(@NonNull NativeRequest request, @NonNull BMError error) { // Called when NativeRequest request failed } @Override public void onRequestExpired(@NonNull NativeRequest request) { // Called when NativeRequest expired } }); ``` }> ```kotlin nativeRequestBuilder.setListener(object : NativeRequest.AdRequestListener { override fun onRequestSuccess(request: NativeRequest, auctionResult: AuctionResult) { // Called when NativeRequest was requested successfully } override fun onRequestFailed(request: NativeRequest, error: BMError) { // Called when NativeRequest request failed } override fun onRequestExpired(request: NativeRequest) { // Called when NativeRequest expired } }) ``` :::caution `AdRequestListener` callbacks are delivered on the background thread, not the main one. ::: When all the necessary parameters are set, call `build` on the `NativeRequest.Builder` instance: }> ```java NativeRequest nativeRequest = nativeRequestBuilder.build(); ``` }> ```kotlin val nativeRequest = nativeRequestBuilder.build() ``` :::caution Keep ad request You need to keep reference to `NativeRequest` before calling `NativeRequest.request`, otherwise it is possible it will be cleared by Garbage Collector and callbacks won’t be triggered. ::: ### Client Bidding Request #### Bid Token With S2S integration, you will need a `BidToken` that you need to transfer in the request. Define `AdPlacementConfig`: }> ```java List mediaTypes = Arrays.asList( MediaAssetType.Icon, MediaAssetType.Image ); AdPlacementConfig adPlacementConfig = AdPlacementConfig.nativeBuilder(mediaTypes) .withPlacementId(...) // Set placement id .build(); ``` }> ```kotlin val mediaTypes = listOf(MediaAssetType.Icon, MediaAssetType.Image) val adPlacementConfig = AdPlacementConfig.nativeBuilder(mediaTypes) .withPlacementId(...) // Set placement id .build() ``` To get a `BidToken`, you can use one of 2 methods: }> ```java // Must be run on background thread String bidToken = BidMachine.getBidToken(@NonNull Context, @NonNull AdPlacementConfig); ``` }> ```kotlin // Must be run on background thread val bidToken = BidMachine.getBidToken(Context, AdPlacementConfig) ``` or }> ```java BidMachine.getBidToken(@NonNull Context, @NonNull AdPlacementConfig, new BidTokenCallback() { @Override public void onCollected(@NonNull String bidToken) { // The BidToken will be returned on a background thread } }); ``` }> ```kotlin BidMachine.getBidToken(Context, AdPlacementConfig) { bidToken -> // The BidToken will be returned on a background thread } ``` #### Bid Payload After completing the server-side auction, you will receive a Base64-encoded payload string, which must be passed as a parameter to the `NativeRequest.Builder`: }> ```java nativeRequestBuilder.setBidPayload(@Nullable String); ``` }> ```kotlin nativeRequestBuilder.setBidPayload(String?) ``` When all the necessary parameters are set, call `build` on the `NativeRequest.Builder` instance: }> ```java NativeRequest nativeRequest = nativeRequestBuilder.build(); ``` }> ```kotlin val nativeRequest = nativeRequestBuilder.build() ``` :::caution Keep ad request You need to keep reference to `NativeRequest` before calling `NativeRequest.request`, otherwise it is possible it will be cleared by Garbage Collector and callbacks won’t be triggered. ::: ## Ad Display ### Prepare the Ad Request object When you need to request an ad and get an [`AuctionResult`](/sdk/general/android/advanced#auction-info), call `request` on the `NativeRequest` instance. }> ```java nativeRequest.request(...); ``` }> ```kotlin nativeRequest.request(...) ``` :::info If you have an in-house meditation and you decide that an advertisement from BidMachine will be shown - call `nativeRequest.notifyMediationWin`, if BidMachine loses the mediation - call `nativeRequest.notifyMediationLoss` ::: Destroy the `NativeRequest` instance if you don't need it anymore. }> ```java nativeRequest.destroy(); ``` }> ```kotlin nativeRequest.destroy() ``` :::caution Don't destroy the `NativeRequest` instance, if it will be used for load the `NativeAd` instance or if the `NativeAd` instance loaded with the `NativeRequest` instance has not been shown yet. Otherwise, ad will not work correctly, which can affect a lower display rate, fill rate, rendering errors, and as a result - lower revenue. ::: ### Define Ad Listener Before execute `load` on the `NativeAd` instance set the `NativeListener` instance: }> ```java NativeAd nativeAd = new NativeAd(...); nativeAd.setListener(new NativeListener() { @Override public void onAdLoaded(@NonNull NativeAd ad) { // Called when Ad was loaded and ready to be displayed } @Override public void onAdLoadFailed(@NonNull NativeAd ad, @NonNull BMError error) { // Called when Ad failed to load } @Override public void onAdImpression(@NonNull NativeAd ad) { // Called when Ad Impression has been tracked } @Override public void onAdShowFailed(@NonNull NativeAd ad, @NonNull BMError error) { // Called when Ad show failed } @Override public void onAdClicked(@NonNull NativeAd ad) { // Called when Ad has been clicked } @Override public void onAdExpired(@NonNull NativeAd ad) { // Called when Ad expired } }); nativeAd.load(nativeRequest); ``` }> ```kotlin val nativeAd = NativeAd(...) nativeAd.setListener(object : NativeListener { override fun onAdLoaded(ad: NativeAd) { // Called when Ad was loaded and ready to be displayed } override fun onAdLoadFailed(ad: NativeAd, error: BMError) { // Called when Ad failed to load } override fun onAdImpression(ad: NativeAd) { // Called when Ad Impression has been tracked } override fun onAdShowFailed(ad: NativeAd, error: BMError) { // Called when Ad show failed } override fun onAdClicked(ad: NativeAd) { // Called when Ad has been clicked } override fun onAdExpired(ad: NativeAd) { // Called when Ad expired } }) nativeAd.load(nativeRequest) ``` ### Define Layout To display the `NativeAd` instance, you need: - Create layout - Fill `NativeAdContentLayout` by `NativeAd` - Register `NativeAdContentLayout` for interaction #### Create layout Create layout which should be contain `NativeAdContentLayout` with filled attributes, which contains views IDs. These IDs are required to identify and fill views with an ad. | Attribute | Description | | :----------------- | :----------------------------------------------------------------- | | titleViewId | Reference to the view that will contain the title data | | descriptionViewId | Reference to the view that will contain the description data | | ratingViewId | Reference to the view that will contain the rating data | | callToActionViewId | Reference to the view that will contain the CTA data | | iconViewId | Reference to the view that will contain the icon | | providerViewId | Reference to the view that will contain the view that provides DAA | | mediaViewId | Reference to the view that will contain the main image or video | Example of `NativeAdContentLayout` layout: ```xml native_ad_content_layout.xml