Floxis Maven/Documentation

Floxis for AdMob and Ad Manager (Android)#

The Floxis SDK adds Floxis demand to an Android app that monetises with AdMob or Google Ad Manager. Floxis is an ad network in your mediation, like any other: you add Floxis entries to your AdMob waterfall or your Ad Manager yield group at the eCPMs your Floxis endpoint suggests, and when your mediation reaches a Floxis entry, the Floxis adapter runs one Floxis auction with that eCPM as the floor.

One artifact covers both Google SDKs, the classic Google Mobile Ads SDK (play-services-ads) and the Next-Gen Mobile Ads SDK, and both ad servers. This guide covers version 0.3.1. The Ad Manager steps are in **In-app SDK (Google Ad Manager)**; everything else is the same as here.

Before you start, set up an endpoint for the app on the Supply page with the integration type Floxis SDK. Open the saved endpoint. At the bottom of its Connection tab, Mediation entries lists, for each format, the Floxis entries to add to your mediation: each one's eCPM, the class name and the parameter to paste. You copy every value from there.

How it works#

  1. Your mediation reaches Floxis. AdMob or Ad Manager calls your ad sources in its usual order. When it reaches a Floxis entry, it calls the Floxis adapter, at the eCPM you gave that entry.
  2. One Floxis auction. The adapter runs one auction for the ad request, with the entry's eCPM as the floor (1.5 s deadline by default).
  3. Fill or pass. Floxis fills only with a bid at or above the entry's eCPM. Otherwise the entry answers no-fill at once and your mediation moves on to the next source.

Nothing runs before your ad server, and nothing changes how your app loads ads. You decide where Floxis sits: your mediation calls its sources in order of eCPM, so the eCPM you give a Floxis entry sets its place, up to the top of your waterfall. An AdMob bidding winner or an Ad Exchange bid that pays more than a Floxis entry still serves first.

When an ad unit has more than one Floxis entry, the first one your mediation reaches runs the auction at the lowest of their eCPMs and keeps the answer for up to 10 seconds. Each later Floxis entry in the same ad request serves that bid only if it pays at least its own eCPM. Two or three entries never mean two or three auctions, and a bid serves once.

FormatSupportedNotes
BannerYesStandard sizes (320x50, 320x100, 300x250, 468x60, 728x90, 160x600). An adaptive banner bids as 728x90 on slots at least 728 dp wide, otherwise as 320x50. Your ad server's refresh drives Floxis, and each refresh is a new auction.
InterstitialYesDisplay and video in one auction; the higher bid wins.
RewardedYesVideo only.
Native, app open, rewarded interstitialNo

Requirements#

ItemVersion
Artifacttech.floxis:floxis-sdk:0.3.1
Google SDKClassic play-services-ads 25.5.0 or newer, or Next-Gen ads-mobile-sdk 1.5.0 or newer. Your app adds it; the Floxis artifact does not.
Prebid Mobile3.4.1, brought in by the Floxis artifact
Minimum AndroidAPI 24 (minSdk = 24)
Compile againstAPI 35 (compileSdk = 35)
Build toolsAndroid Gradle Plugin 8 or newer; the SDK's classes target Java 17
KotlinNot needed for Java apps. Kotlin apps: the SDK is built with Kotlin 2.3

1. Add the SDK#

Add the SDK repository to settings.gradle.kts. The exclusiveContent filter makes Gradle look there only for tech.floxis packages, and everything else still comes from Google and Maven Central:

dependencyResolutionManagement {
  repositories {
    google(); mavenCentral()
    exclusiveContent {
      forRepository { maven("https://maven.floxis.tech/releases") }
      filter { includeGroup("tech.floxis") }
    }
  }
}

Then add the dependency to app/build.gradle.kts, next to the Google SDK your app already uses:

implementation("tech.floxis:floxis-sdk:0.3.1")

The same artifact works with the classic and the Next-Gen Google SDK. It brings in Prebid Mobile 3.4.1 and the shared Floxis runtime (floxis-sdk-common), which you never add yourself. Imports are com.floxis.sdk.*.

Manifest. The SDK adds the INTERNET and ACCESS_NETWORK_STATE permissions and asks for no other permission. Keep your AdMob app ID as Google requires. The advertising ID permission (com.google.android.gms.permission.AD_ID) comes from Google's SDK, not from Floxis.

R8 and ProGuard. You don't add any keep rules. The SDK's rules ship inside the artifact and keep the adapter class that your ad server loads by name.

2. Start Floxis in Application.onCreate#

Start Floxis once, when the app starts, before you initialise the Google SDK. Use the seat and region from your endpoint's Mediation entries panel (Install), where they are already filled in:

class App : Application() {
    override fun onCreate() {
        super.onCreate()
        Floxis.initialize(
            applicationContext,
            FloxisConfig(seat = "YOUR_SEAT", region = "us-e", timeoutMs = 1500),
        )
        MobileAds.initialize(this)
    }
}

On Next-Gen, initialise Google the way Google asks (on a background thread, with your app ID in InitializationConfig), after Floxis.initialize. In Java, FloxisConfig takes its values in order (seat, region, timeoutMs, debug, enabled, personalizedAds, testMode, storeUrl, shareLocation):

Floxis.initialize(getApplicationContext(), new FloxisConfig("YOUR_SEAT", "us-e", 1500),
    (status, description) -> Log.d("Floxis", "init " + status + " " + description));
OptionWhat it does
seatYour seat from the endpoint. 1 to 128 characters of letters, digits, ., _ and -.
regionYour region from the endpoint. Default us-e.
timeoutMsThe longest a Floxis entry waits for its auction before it reports no fill and your mediation moves on (200 to 10,000 ms, default 1,500).
debugTurns on the SDK's detail log lines under the tag Floxis and Prebid Mobile's debug log. It never changes what is sent.
testModeMarks auctions as test requests. It only takes effect in a debuggable build; a release build ignores it. Floxis bills neither side of a test auction.
enabled / Floxis.setEnabled()Kill switch. false stops all Floxis auctions at once, for example from your remote config. Floxis entries then report no fill and your mediation moves on.
personalizedAds / Floxis.setPersonalizedAds()false stops Floxis auctions: Floxis entries report no fill. Update it when consent changes.
storeUrlThe store URL sent to buyers. Default: the Google Play page for your package.
shareLocationDefault true: sends the device's last known location when the app already has location permission.

How start-up behaves:

  • Floxis.initialize returns at once; Prebid Mobile starts in the background. The optional listener is called once, on the main thread, with SUCCEEDED, SERVER_STATUS_WARNING, FAILED or DISABLED.
  • The Floxis adapter always tells Google it started, so the order of start-up never switches Floxis off for the session. If an ad request reaches a Floxis entry before Floxis.initialize has run, that entry fails with code 203 and your mediation moves on.
  • If start-up fails, the next ad request that reaches Floxis tries again, at most once every 30 seconds.
  • A value outside the limits above throws IllegalArgumentException when you create the FloxisConfig.

There is no Floxis code around your ad loads. Load and show banners, interstitials and rewarded ads exactly as you do today, with your AdMob or Ad Manager ad unit IDs.

3. Add the Floxis entries to AdMob#

Open your endpoint's Mediation entries, choose the AdMob tab and the format. For each ad unit:

  1. Type the Ad unit name. It is your name for the placement, for example home_banner, and it is sent as configId. Floxis reports by it, so give each placement its own name and keep it the same across app versions. Each entry's parameter is rebuilt as you type.

  2. In AdMob, open Mediation, open the ad unit's mediation group (or create one for the format and platform), and in Waterfall choose Add custom event.

  3. Add one custom event per Floxis entry, with its Label and Manual eCPM from the panel. The eCPM sets the entry's place in your waterfall, so you choose how high Floxis sits.

  4. Map each custom event to your ad unit with the Class name and that entry's Parameter:

    com.floxis.sdk.FloxisMediationAdapter

    A parameter looks like this:

    { "configId": "home_banner", "floor": "1.50", "min": "0.55" }
  5. Save. Copy all copies every entry of the format at once, to paste into a spreadsheet.

The panel suggests one to three entries per format at descending eCPMs, priced from your endpoint's recent bids and never below its Default bid floor. You can change an eCPM or remove an entry; the parameter follows.

The one rule that matters. Each entry's parameter floor must equal the eCPM you type in AdMob, in US dollars. The adapter cannot see the eCPM you typed, so it serves only bids that pay at least the parameter's floor. If the two differ, Floxis can fill below the price AdMob ranks the entry at, or pass on bids it should have served. Always copy the eCPM and the parameter from the same row. If your AdMob account reports in another currency, type the eCPM converted into that currency and keep the parameter exactly as shown (it stays in USD).

Banner refresh. Set refresh on the AdMob ad unit as you normally would. Each refresh that reaches a Floxis entry runs a new Floxis auction.

Your app and its consent tool (CMP) decide what the user agreed to. The SDK passes those signals to the auction. The full rules, and what to declare in Google Play's Data safety form, are in SDK privacy and consent.

  • TCF, GPP and US privacy. Your CMP writes the standard IAB keys to SharedPreferences, and the SDK adds them to every Floxis auction. Without consent for Floxis (vendor 1609) and Purpose 1, or with a US opt-out, the auction still runs, without the advertising ID and without device and session signals.
  • Personalised ads. With personalizedAds = false, Floxis runs no auction and its entries report no fill. The SDK no longer changes your Google ad request, so set Google's own non-personalised-ads option on your requests as you do today.
  • Children (COPPA). Floxis passes the child-directed flag to the auction as regs.coppa. Set Google's child-directed tag (tagForChildDirectedTreatment) as usual, and Floxis reads it from each ad request. If your app also sets TargetingParams.setSubjectToCOPPA(true) on Prebid Mobile, the auction is child-directed when either is set.
  • Location. The SDK never asks for a location permission. It sends a location only when the app already holds one, shareLocation is on, and neither a child-directed request, missing TCF special feature 1 consent nor a US opt-out forbids it.

Apps that already run Prebid Mobile. Prebid Mobile holds one server, account and set of options for the whole app. The Floxis SDK points Prebid at Floxis only while it builds and sends a Floxis request, and puts your own settings back straight after, so your own Prebid auctions keep going to your Prebid Server. Start your own Prebid auctions on the main thread, as Floxis does. Floxis is built and tested with Prebid Mobile 3.4.1; if your app asks for another version, Gradle uses the newest one in the build, so test with that version.

5. Add the app-ads.txt line#

Buyers that check app-ads.txt will not bid on the app without the Floxis line. Add it to app-ads.txt at the root of the developer website on the app's Play Store listing. Ask the dashboard assistant "what is my ads.txt line for Floxis" for the exact line for your account. Where the file goes and how to check it is in the **Floxis app-ads.txt Guide**.

6. Test before release#

  1. In a debug build, set debug = true and testMode = true, and register your phone as an AdMob test device. Never click live ads on your own app.
  2. Run adb logcat -s Floxis. Start-up logs its status, then each Floxis auction logs one line (FLX-200), and a held bid below an entry's floor logs another.
  3. Open Ad Inspector and load each ad unit. Check three things:
    • A fill. A Floxis entry shows as the ad source of a served ad.
    • A pass. When Floxis has no bid, the Floxis entry shows a no fill and the next source serves, within timeoutMs.
    • The floor holds. Give a test entry a high eCPM and the same floor in its parameter: it never serves a bid below it (error code 205 in Ad Inspector).
  4. Some buyers don't bid on test requests, so a test build may see few Floxis fills. Floxis bills neither side of a test auction.
  5. Tell your account manager your placement names and the date of the release build, so the first live traffic can be checked with you.

A Floxis entry that fails reports a Google AdError with the domain tech.floxis.sdk:

CodeMeaningWhat to do
101The parameter is missing or invalid: no configId, no floor, or not the 0.3.0 format.Paste the parameter again from Mediation entries.
201Floxis is switched off (enabled = false).Expected while the kill switch is on.
202Personalised ads are off.Expected after a consent refusal.
203Floxis hasn't started.Call Floxis.initialize in Application.onCreate. A failed start is retried on later requests.
204No bid.Normal. Your mediation moves on.
205Floxis had a bid, but below this entry's floor.Normal. A lower Floxis entry may still serve it.
206The auction took longer than timeoutMs.Raise timeoutMs only if this is frequent.
207Floxis was switched off, or personalised ads were turned off, during the auction or before the show.Expected; the next load follows the new setting.
208, 209Network or server error.Retried on the next request. Tell your account manager if it persists.
301, 302The ad could not render, or an internal error.Send the log and the error message to your account manager.
401, 402, 403A full-screen ad expired, was already shown, or was shown before it loaded.Load a new ad.

The full list, and the log codes, are in SDK testing and troubleshooting.

7. Use with other Floxis adapters#

An app that also mediates with Unity LevelPlay adds the Floxis LevelPlay artifact next to this one. See In-app SDK (Unity LevelPlay).

  • Unity LevelPlay reads its seat, region and timeout from its own network settings. Give it the same values.
  • Keep every tech.floxis artifact on the same version.

More documentation#

  • In-app SDK (Google Ad Manager): adding Floxis to an Ad Manager yield group.
  • SDK privacy and consent: the signals the SDK reads and sends, children's apps, and the Data safety form.
  • SDK testing and troubleshooting: every error and log code, and common problems.
  • SDK API reference: every public class and method.
  • SDK release notes: what changed in each version, and how to move from an earlier version.
  • In-app SDK (iOS, AdMob and Ad Manager): the same setup for iOS apps.

Licence#

The SDK ships as signed binaries from maven.floxis.tech, under the licence published there. Floxis.SDK_VERSION gives the version in your build. Your account manager is your contact for support and can share a sample app.