Other Analytics - YerdySDK/yerdy-android GitHub Wiki
Player Progression
You can track a user's progression through your app by logging the milestones that the user passes. For example, in an endless runner you might track a player's progression based on how far they run and how many enemies they kill.
// When the user runs 500m - starts the 'distance' player progression category
Yerdy.getInstance().startPlayerProgression("distance", "500m");
// When the user runs 1000m
Yerdy.getInstance().logPlayerProgression("distance", "1000m");
// When the user runs 1500m
Yerdy.getInstance().logPlayerProgression("distance", "1500m");
// etc...
// When the users kills 50 enemies - starts the 'kills' player progression category
Yerdy.getInstance().startPlayerProgression("kills", "50");
// When the users kills 100 enemies
Yerdy.getInstance().logPlayerProgression("kills", "100");
// When the users kills 150 enemies
Yerdy.getInstance().logPlayerProgression("kills", "150");
// etc...
Feature Use Tracking
You can track which features your users use via the logFeatureUse(...)
method. This can aid you when making decisions about which features to improve, or if you need to bring more attention to a feature in your game.
// For example, when they visit the store
Yerdy.getInstance().logFeatureUse("store");
// For example, when they visit the settings screen
Yerdy.getInstance().logFeatureUse("settings");
You'll need to approve which screens you wish to track in the dashboard. Navigate to your app on the Apps page, then Configure → Feature Tracking.
Ad Network Tracking
You can track the health of the various ad networks integrated into your app via the logAdRequest(String network)
and logAdFill(String network)
methods. Simply call logAdRequest
with the name of the ad network when you request an ad, and then call logAdFill
if/when that ad is filled.
Note: You must pass in the exact same name to the logAdRequest
and the logAdFill
methods for Yerdy to match up the requests & fills
public void requestAd() {
String networkName = "SampleAd";
_interstitial = new SampleAdNetwork();
Yerdy.getInstance().logAdRequest(networkName);
_interstitial.requestAd(new SampleAdNetworkHandler() {
@Override
public void interstitialAdDidLoad() {
Yerdy.getInstance().logAdRequest(networkName);
}
}
}
Note: This is targeted towards use with interstitial ads, however it could also be applied to other types of ads as well. Just make sure you have at most one call to logAdFill
per call to logAdRequest
Custom Events
Additionally, you can track events that are specific to your game and any parameters related to that event. For example, in a puzzle game you may wish to see how many stars your users are getting.
Map<String, String> map = new HashMap<String, String>();
map.put("Stars", "3");
Yerdy.getInstance().logEvent("LevelComplete", map);
Note: The parameters keys & values are strings so you may need put some values into "buckets" before logging an event to get meaningful data. For example:
int points = 1244;
String bucket = null;
if(points <= 500)
bucket = "<= 500";
else if(points > 500 && points <= 1000)
bucket = "500 - 1000";
else if(points > 1000 && points <= 1500)
bucket = "1000 - 1500";
else if(points > 1500)
bucket = "> 1500";
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("Points", bucket);
Yerdy.getInstance().logEvent("LevelComplete", parameters);