Prebid Mobile SDK in Apps: Difference between revisions

No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 7: Line 7:
*iOS: https://docs.prebid.org/prebid-mobile/pbm-api/ios/code-integration-ios.html
*iOS: https://docs.prebid.org/prebid-mobile/pbm-api/ios/code-integration-ios.html
*Android: https://docs.prebid.org/prebid-mobile/pbm-api/android/code-integration-android.html
*Android: https://docs.prebid.org/prebid-mobile/pbm-api/android/code-integration-android.html
===Required documents===
*This documentation
*Excel sheet with account ID and config IDs for each iqadtile


==Step 1 - Integrate Prebid Mobile SDK==
==Step 1 - Integrate Prebid Mobile SDK==
Line 15: Line 19:
At the beginning, the endpoint and account ID must be set in the SDK and placed in an initialization method
At the beginning, the endpoint and account ID must be set in the SDK and placed in an initialization method


*Prebid Server Account Id: '''<<<PREBID_SERVER_ACCOUNT_ID>>>'''
*Prebid Server Account ID: '''<<<PREBID_SERVER_ACCOUNT_ID>>>''', the ID is different for each app, but is the same for all placements within the app. The ID can be found in the Excel sheet.
*Prebid Server Url: '''https://client-pbs.relevant-digital.com/openrtb2/auction'''
*Prebid Server Url: '''https://iqdigital-pbs.relevant-digital.com/openrtb2/auction'''


===Example===
===Example===
Line 22: Line 26:
PrebidMobile.setPrebidServerAccountId("<<<PREBID_SERVER_ACCOUNT_ID>>>")  
PrebidMobile.setPrebidServerAccountId("<<<PREBID_SERVER_ACCOUNT_ID>>>")  


PrebidMobile.setCustomStatusEndpoint("https://client-pbs.relevant-digital.com/s   
PrebidMobile.setCustomStatusEndpoint("https://iqdigital-pbs.relevant-digital.com/s   
tatus")   
tatus")   


PrebidMobile.initializeSdk(   
PrebidMobile.initializeSdk(   
     applicationContext,   
     applicationContext,   
     "https://client-pbs.relevant-digital.com/openrtb2/auction") { status ->   
     "https://iqdigital-pbs.relevant-digital.com/openrtb2/auction") { status ->   
         if (status == InitializationStatus.SUCCEEDED) {   
         if (status == InitializationStatus.SUCCEEDED) {   
             Log.d(TAG, "SDK initialized successfully!")   
             Log.d(TAG, "SDK initialized successfully!")   
Line 41: Line 45:
For each ad placement (iqadtile), a BannerAdUnit must be created and configured:
For each ad placement (iqadtile), a BannerAdUnit must be created and configured:


#'''Config Id''', this is different for each iqadtile and will be provided in a table by iqdigital
#'''Config Id''', this is different for each iqadtile within an app and is provided in the Excel sheet by iqdigital.
#The sizes that have been defined for the iqadtile must also be communicated to the BannerAdUnit. (Important: normally more than one size must be passed, they often differ from iqadtile to iqadtile)
#The sizes that have been defined for the iqadtile must also be communicated to the BannerAdUnit. (Important: normally more than one size must be passed, they often differ from iqadtile to iqadtile)


Line 80: Line 84:
The Headerbidding partners should be informed which DisplayManager and which version is being used.
The Headerbidding partners should be informed which DisplayManager and which version is being used.


====Example:====
===Example Android:====
<pre>
adUnit?.impOrtbConfig = """
    {
        "displaymanager": "Google",
        "displaymanagerver": "${MobileAds.getVersion()}"
    }
""".trimIndent()
)
</pre>
====Example iOS:====
<pre>
<pre>
TargetingParams.setGlobalOrtbConfig(
adUnit.setImpORTBConfig("""
    """
    {
        {
        "displaymanager": "Google",
            "displaymanager": "Google",
        "displaymanagerver": "\(string(for: MobileAds.shared.versionNumber))"
            "displaymanagerver": "${MobileAds.getVersion()}", 
    }
            "ext": { 
""")
                "myext": { 
                    "test": 1 
                }
            } 
        } 
    """.trimIndent()
)
)
</pre>
===Store-URL===
The app should include the corresponding App Store/Play Store URL. Bidders pay attention to this, and it typically increases bids, so it has an impact on revenue.
====Example Android:====
<pre>
TargetingParams.setStoreUrl("https://play.google.com/store/apps/details?id=com.example.app");
</pre>
====Example iOS:====
<pre>
Targeting.shared.storeURL = "https://apps.apple.com/app/id111111111"
</pre>
</pre>


Line 103: Line 124:
The GPID is there to tell certain Headerbidding partners which placement they are bidding on and is therefore very important. The absence of this information leads to worse bids!
The GPID is there to tell certain Headerbidding partners which placement they are bidding on and is therefore very important. The absence of this information leads to worse bids!


*'''gpid''' corresponds to the AdUnit used for the iqadtile, e.g. /183/FAZ_app_android_phone/homepage
*'''gpid''' corresponds to the AdUnit plus the iqadtile identifier used for the iqadtile, which is appended with a hyphen "-", e.g. /183/FAZ_app_android_phone/homepage-iqadtile3
*'''pbadslot''' is a combination of AdUnit, the character '#' and the iqadtile, example /183/FAZ_app_android_phone/homepage#iqadtile3
*'''pbadslot''' is the same value as '''gpid''', example /183/FAZ_app_android_phone/homepage-iqadtile3
*'''relevant_slotInstance''' is the number of the iqadtile, example 3 for iqadtile3
*'''relevant_slotInstance''' is the number of the iqadtile, example 3 for iqadtile3


====Example====
====Example for iqadtile3====
<pre>
<pre>
adUnit?.impOrtbConfig = """   
adUnit?.impOrtbConfig = """   
     {   
     {   
         "ext": {   
         "ext": {   
             "gpid":"/183/FAZ_app_android_phone/homepage"   
             "gpid":"/183/FAZ_app_android_phone/homepage-iqadtile3"   
             "data": {   
             "data": {   
                 "pbadslot":"/183/FAZ_app_android_phone/homepage#iqadtile3"   
                 "pbadslot":"/183/FAZ_app_android_phone/homepage-iqadtile3"   
                 "relevant_slotInstance": "3" // optional extra to RY analytics   
                 "relevant_slotInstance": "3" // optional extra to RY analytics   
             }   
             }