Integrate user insights

After integrating the AdSDK through any of the available methods and integrating the event tags, partners can integrate the user insights. Be aware the user insights require the game or app live in store and to be receiving the event tags for a period of time. The period of time varies based on volume and depth of data.

To receive the user insights, set the callback and specify which insight variables you want:

plugin.BehaviourInsightCallback = OnBehaviourInsight;
plugin.GetBehaviourInsight(new string[] { "p_churn_14d"});

private void OnBehaviourInsight(Dictionary<string, Insight> behaviourInsight)
{
  var insight = behaviourInsight["p_churn_14d"];
  if (insight._error == null) {
    var churn_14d = insight._float;
  }
}
plugin.OnBehaviourInsight = OnBehaviourInsight
plugin.GetBehaviourInsight(["p_churn_14d", "p_churn_1d", "p_churn_30d"])

private func OnBehaviourInsight(insights: [String: Insight]) {
  for (name, insight) in insights {
    if let error = insight._error {
      print("OnBehaviourInsight Error with \(name): \(error)")
    } else {
      print("OnBehaviourInsight \(name): i:\(insight._int) f:\(insight._float) s:\(insight._string)")
    }
  }
}
NSArray *insightList = @[@"p_churn_14d", @"p_churn_1d", @"p_churn_30d"];
[plugin GetBehaviourInsight: insightList];

_plugin.OnBehaviourInsight = ^(NSDictionary<NSString *, Insight *> * behaviourInsight) {
  for (NSString *key in behaviourInsight) {
    Insight* insight = behaviourInsight[key];
    NSLog(@"Behavour insight %@: e:%@ i:%lld f:%f s:%@", key, insight._error, insight._int, insight._float, insight._string);
  }
};
_plugin.OnBehaviourInsight = this::OnBehaviourInsight;

String[] insightList = {"p_churn_14d", "p_churn_1d", "p_churn_30d", "nonE"};
_plugin.GetBehaviourInsight(insightList);

private void OnBehaviourInsight(HashMap<String, Insight> behaviourInsight) {
  for (Map.Entry<String, Insight> entry : behaviourInsight.entrySet()) {
    String name = entry.getKey();
    Insight insight = entry.getValue();
    if (insight._error != null) {
      Log.i("DI", "Behaviour insight error "+ name +": " + insight._error);
    } else {
    	Log.i("DI", "Behaviour insight "+ name + " i:"+ insight._int + " f:"+ insight._float + " s:"+ insight._string);
    }
  }
}

You are guaranteed to receive the callback in the same thread with all keys that you specified in the request. If there is any issue with calculation or network the insight will contain error and default value.

Requesting and receiving user insights:

Predicted user churn / retention: The probability of this specific user to churn at a specific day.

  • The possible request variables are: p_churn_1d, p_churn_3d, p_churn_7d, p_churn_14d, p_churn_30d. The response is in the format: 0.854.
  • For the churn prediction, you can request:p_churn_confidence which is the ML confidence in the prediction and returns a value any of the following: low, medium or high.

Predicted user ad impression value: The predicted market price eCPM value the partner would receive to show a banner, interstitial or rewarded ad to this user.

  • The possible request variables are: pred_ecpm_banner, pred_ecpm_interstitial, pred_ecpm_rewarded. The response is in the format: 12.73.

Predicted user value: The predicted dollar value of a user in: predicted IAP value, predicted Ad value and predicted total value (pLTV).

  • The possible request variables are: pred_iaa_value, pred_iap_value, pred_total_value. The response is in the format: 1.58.

Predicted user bid floors: The predicted bid floor prices for a user for a ad format.

  • The possible request variables are: calculated_user_floor_price_banner, calculated_user_floor_price_interstitial, calculated_user_floor_price_rewarded.

User insights statuses

Alongside each user insight attribute, a status parameter is included. A status is returned in the case the user insight is: test, insight_not_yet_available, error_unsupported_insight. If no status is returned, the user insight is production-ready.

Testing user insights

In order to test user insights, add your SDK user id to the Nefta platform. While testing, the result of each user insight is static and contains the status field with value of test.