The RTB-Stack SDK offers publishers the capability to pass data related to their content and users to enhance ad targeting and relevance. This is achieved through specific classes and methods designed to handle JSON objects conforming to the IAB OpenRTB Specification ver.2.6.
Relevant Classes and Method:
The data passing functionality can be utilized in the following classes:
Method to Use:
setOrtbObject(JSONObject ortbObject)
Description:
This method sets a JSON object containing content and user-related data.
Parameters:
Data Structure:
Supported Values:
cat
, sectioncat
, pagecat
, publisher
, content
.Here's how to implement the method in your code:
String ortbStr = "YOUR_ORTB_OBJECT"; JSONObject ortbJson = new JSONObject(ortbStr); bannerAdView.setOrtbObject(jsonOrtb);
Below is an example of how the JSON data should be structured:
{ "app":{ "cat":[ "IAB15", "IAB15-10" ], "content":{ "id":"123", "episode":1, "title":"Weather in Seattle" } }, "user":{ "keywords":"cars, sports" } }