Targeting Audiences
In order to take advantage of our targeting campaign, you must pass an instance of the AdPreference class in the ad load call. Setting additional preferences helps BlueStack choose better tailored ads from the network.
You need to import the AdPreference component in order to work with preferences.
import {
AdPreference,
ProviderType,
GenderType,
LocationType,
} from "@azerion/bluestack-sdk-react-native";
Here's an example of how to create preferences for any ad:
const preference = new AdPreference();
preference.setAge(30);
preference.setGender("Female");
preference.setLocation(
{
latitude: 52.2781641,
longitude: 4.7482118,
provider: "network",
},
1
);
preference.setLanguage("en");
preference.setContentUrl("https://console.bluestack.app");
preference.setKeyword("brand=myBrand;category=sport");
Location Targeting
Our ad server and certain ads can use the user's location to send more targeted ads by passing Latitude and Longitude.
preference.setLocation(
{
latitude: 52.2781641,
longitude: 4.7482118,
provider: "network",
},
CONSENT_FLAG
);
Note:
The setLocation method takes the following parameters:
- The
Locationinstance. - The
CONSENT_FLAGvalue (corresponds to an int: 0, 1, 2 or 3).- 0 = Do not allow to send location.
- 1 = When you manage location according to the consent value.
- 2 and 3 = Allow the SDK to manage location directly in accordance with the consent value using TCF v1 or TCF v2. See with the Azerion team as it depends on your implementation.
Keyword Targeting
Keywords allow you to target certain ad requests with user data. Keywords are useless for targeting if you cannot provide dynamic values per user/device.
To add keyword targeting, pass these keywords up through the application (they should be formatted as key/value pairs):
- Characters per key: 20
- Characters per value: 40
preference.setKeyword("brand=myBrand;category=sport");
User Demographic Targeting
When people are signed in on your app, please share demographic information from their settings with the following code:
preference.setAge(25);
preference.setGender("Male");
Content mapping for apps
See https://support.google.com/adxseller/answer/6270563 for more details.
preference.setContentUrl("https://my_content_url.com/");