Follow

Enjoy Higher eCPM with Demographic - Targeted Ads

View original article on our GitHub

If you know your user's gender, age or location, StartApp can use it to serve better-targeted ads which can increase your eCPM and revenue significantly.

Set Age and Gender

Upon initialization, after providing your DevId and AppId, use the following line:

sdk.preferences = STASDKPreferences.prefrencesWithAge(<USER_AGE>, andGender: <USER_GENDER>)
  • Replace <USER_AGE> with the user's real age
  • Replace <USER_GENDER> with the user's real gender, using STAGender_Male orSTAGender_Female.

Example

// AppDelegate.swift

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // initialize the SDK with your appID and devID
        var sdk: STAStartAppSDK = STAStartAppSDK.sharedInstance()
        sdk.appID = "Your App Id"
        sdk.devID = "Your Developer Id"

        sdk.preferences = STASDKPreferences.prefrencesWithAge(22, andGender: STAGender_Male)

        return true
    }

Set Location

The location of the user is a dynamic property which is changed constantly. Hence, you should provide it every time you load a new Ad:

startAppAd!.loadAdWithAdPreferences(STAAdPreferences.prefrencesWithLatitude(<Real_Latitude>, andLongitude: <Real_Longitude>))

Example

override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        startAppAd!.loadAdWithAdPreferences(STAAdPreferences.prefrencesWithLatitude(37.3190383911, andLongitude: -121.96269989))
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments