Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The MobileFuse SDK supports an SDK bidding implementation that can be used by mediation platforms. Our SDK Bidding solution uses a token generation and rendering mechanism.

The following formats are supported by bidding:

  • Banner

  • Medium Rectangle

  • Interstitial

  • Rewarded

No initialization

The SDK does not need to be initialized for our bidding adapter flows.

Bidding Token Generation

An SDK-generated token should be passed to the MobileFuse bidding endpoint for every bidding request. Our tokens are encoded strings and may be up to 4000 bytes in size, but are generally much smaller.

To generate a token, pass a token request object to the token provider class. Implementation differs for each platform as follows:

Android

Code Block
languagejava
// Optionally pass in privacy preferences
MobileFusePrivacyPreferences.Builder privacyBuilder = new MobileFusePrivacyPreferences.Builder();
privacyBuilder.setUsPrivacyConsentString(mediationPlatform.usPrivacyString);
privacyBuilder.setIabConsentString(mediationPlatform.iabConsentString);
privacyBuilder.setSubjectToCoppa(mediationPlatform.isAgeRestrictedUser);

// Determine test mode
boolean isTestModeEnabled = mediationPlatform.isTestModeEnabled;

// Create our token request
MobileFuseBiddingTokenRequest tokenRequest = MobileFuseBiddingTokenRequest(
    privacyBuilder.build(), 
    isTesting
);

// Generate a token - asynchronous:
MobileFuseBiddingTokenProvider.getToken(
    tokenRequest,
    activity,
    new TokenGeneratorListener() {
        @Override
        public void onTokenGenerated(String token) {
            callback.onTokenCollected(token);
        }
        
        @Override
        public void onTokenGenerationFailed(String error) {
            callback.onTokenCollectionFailed(error);
        }
    }
);

iOS

Code Block
languageobjective-c
// Optionally pass in privacy preferences
MobileFusePrivacyPreferences *privacyPrefs = [[MobileFusePrivacyPreferences alloc] init];
[privacyPrefs setUsPrivacyConsentString: mediationPlatform.usPrivacyString];
[privacyPrefs setIabConsentString: mediationPlatform.iabConsentString];
[privacyPrefs setSubjectToCoppa: mediationPlatform.isAgeRestrictedUser];

// Determine test mode
BOOL isTesting = mediationPlatform.isTestModeEnabled;

// Create our token request
MFBiddingTokenRequest* request = [[MFBiddingTokenRequest alloc] init];
request.privacyPreferences = privacyPrefs;
request.isTestMode = isTesting;

// Generate a token:
NSString* token = [MFBiddingTokenProvider getTokenWithRequest: request];
[delegate didCollectSignal: token];

The returned token is a base-64 encoded string, for example:

Code Block
languagec
"H4sIAAAAAAAAAGWOTQrCMBBG7zLrsVhDVXoHTyBdpE0qgfyRxFAJubuTulJXA+/NfN8UUMbDeC8gVPSavwy3/CEDjGDWDfAHRxnyLvuOdcdDWAZambm1DRbgXlEWwwHPeJkqQlZCun+D4INLbnE6Ej0RZY3jdaqV5DN+4uSW2nBGCW+p9OZmpeVKmlp3mr9eqdSYZKSjvr4BZcS0rdkAAAA="

Our tokens do not contain any user PII, even in an encoded form. If we do implement PII into our bidding tokens, any data will:

  1. Conform to any privacy preferences passed in - PII will not be passed for opted-out or do-no-track users.

  2. Any PII will end-to-end encrypted between our SDK and the MobileFuse ad exchange.

The mediation platform does not need to do any validation on the token, just pass the value on to MobileFuse in the appropriate OpenRTB field.

Bidding

Our bidding endpoint is https://mfx.mobilefuse.com/openrtb?ssp=%%SSP_PARTNER_ID%%

You will be supplied an SSP partner ID that should be passed into our bidding endpoint. Both http and https are supported. You can find sample bid requests at the following page: https://mobilefuse.atlassian.net/wiki/spaces/SUPPLY/pages/426003/OpenRTB+Bid+Requests#Sample-Bid-Requests

The bidding token that was generated from our SDK must be passed in the user.data.segment.signal OpenRTB field. You can also set the test field to 1 to ensure that you receive fill for valid placement IDs.

On a successful bid, the seatbid.bid.signaldata field will be populated with a signal token that should be passed back to our SDK for rendering (see Rendering an ad from a response token).

Example request/response:

Request

POST https://mfx.mobilefuse.com/openrtb?ssp=partner_name

Code Block
languagejson
{
    "id": "ff71e4a7-2622-493d-bfb8-de446a4152ac",
    "user": {
        "data": {
            "segment": {
                "signal": "H4sIAAAAAAAAAGWOTQrCMBBG7zLrsVhDVXoHTyBdpE0qgfyRxFAJubuTulJXA+/NfN8UUMbDeC8gVPSavwy3/CEDjGDWDfAHRxnyLvuOdcdDWAZambm1DRbgXlEWwwHPeJkqQlZCun+D4INLbnE6Ej0RZY3jdaqV5DN+4uSW2nBGCW+p9OZmpeVKmlp3mr9eqdSYZKSjvr4BZcS0rdkAAAA="
            }
        }
    },
    "imp": [
        {
            "id": "1",
            "tagid": "418545",
            "instl": 0,
            "banner": {
                "format": [
                    {
                        "w": 320,
                        "h": 50
                    }
                ]
            }
        }
    ],
    "device": {
        "geo": {
            "lat": 42.360,
            "lon": -71.057
        },
        "ua": "Mozilla/5.0 (Linux; Android 9; Pixel 3 XL Build/PD1A.180720.030; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.64 Mobile Safari/537.36",
        "ip": "140.241.0.100",
        "ifa": "01234567-1234-1234-1234-012345678901"
    },
    "app": {
        "bundle": "com.test"
    }
}

Response

HTTP/1.1 200 OK

Code Block
languagejson
{
    "id": "ff71e4a7-2622-493d-bfb8-de446a4152ac",
    "bidid": "2daa3b63ca75c5d111318b2530d00b60",
    "seatbid": [
        {
            "bid": [
                {
                    "id": "eea5560fddc6687b22b3b523c20a5106_banner",
                    "adomain": [
                        "mobilefuse.com"
                    ],
                    "impid": "1",
                    "crid": "test_js_banner",
                    "h": 50,
                    "price": 2.681,
                    "w": 320,
                    "lurl": "https://mfx-us-east-1.mobilefuse.com/lurl?reqid=eea5560fddc6687b22b3b523c20a5106&loss=${AUCTION_LOSS}&price=${AUCTION_PRICE}",
                    "exp": 300,
                    "signaldata": "H4sIAAAAAAAAA42QXWvCMBiF/8oIwytj89GkXVHHkF0IY4653RVKPt5ipV9rWnSI/32pwtjuvEo4OSfned8TUrZCCZo70xVtf+c6s0jRru9bl6RBGlT5EQ8Og3I9prOq0UUJ+eBgZpoqDfYOHzrVttA9dvBV2AWAEkKS3FojZRxpxjTXgnHDiBKUyBQt52lw7VqiqS9vKlXUHuD/1/7Je6zXe3B9tneZVnUNndfh2KKEEzJFO5QIf5RDV3rjrcyj/UbaSdk4t7g/PX2uPtab1+xls92eJ21XGPijvr2vV89nT1aBLVTWf7fgcX55L3aUsJmM6RT54mGc6DJbnkcUQhVhJhnD4QO3WOc6xhbCUKqQCqYMGjOubWoH1xCzSnEtuVGRMMJSSjmNNROcWEK0JD7gQPXjSnN/P/hlMXL+AYsE7eDoAQAA"
                }
            ],
            "seat": "mf"
        }
    ]
}

If the MobileFuse bid wins, the seatbid.bid.signaldata field contains a token that should be passed back into the SDK for rendering. Otherwise our Loss URL (seatbid.bid.lurl) should be triggered with the relevant macros expanded.

Rendering an ad from a response token

The signaldata bid response field can be used to complete the entire lifecycle of ad creation and display.

This string should be passed directly to the loadAdFromBiddingToken / loadAdWithBiddingResponseToken methods. The ad instance will then behave in the same was as documented in the standard SDK documentation: MobileFuse SDK

Android

Code Block
languagejava
myAdInstance.loadAdFromBiddingToken(bidResponse.signaldata);

iOS

...

languageobjective-c

...

This page has moved to our new documentation:

...