Progression API
Level progression API
ironSource App Analytics provides users’ progression analysis, such as levels completions and wins percentage. Furthermore, when using this API, users’ level progression can be analyzed. Which level they started, completed or failed.
// The user level progression API
IronSourceAnalytics.updateProgress(@NonNull ISAnalyticsUserProgress userProgress);
Parameters
- ISAnalyticsUserProgress userProgress– The object that represents the progression event
ISAnalyticsUserProgress Object
This object and it’s properties define all the required information regarding a progression event. Levels 1, 2 and 3 represent 3 hierarchy structure in the game. For example, can be used to distinguish between main and side levels, or represent a world, phases within that world and levels of a phase. You can implement one or more levels hierarchy based on what suits your game best
Constructor:
- ISAnalyticsUserProgress(@NonNull String level1) – The main level in the game
Set methods:
- state(@NonNull ISAnalyticsProgressState state) – an enumerated value of the user progression type (mandatory)
- BEGIN
- IN_PROGRESS
- COMPLETE
- FAILED
- level2(@NonNull String level2) – The secondary (in hierarchy) level in the game (optional)
- level3(@NonNull String level3) – The third (in hierarchy) level in the game (optional)
- score(int score) – The score upon the progress update. 0 to represent no change in score or no score (mandatory)
- attempt(int amount) – The number of the attempt upon the level (optional)
Example of level progression update API
// Examples of using the user progression API:
// Start a level
ISAnalyticsUserProgress userProgress_start = new ISAnalyticsUserProgress("level_1").state(ISAnalyticsProgressState.BEGIN).score(0).attempt(1);
IronSourceAnalytics.updateProgress(userProgress_start);
// Complete with score
ISAnalyticsUserProgress userProgress_score = new ISAnalyticsUserProgress("level_1").state(ISAnalyticsProgressState.COMPLETE).score(99).attempt(1);
IronSourceAnalytics.updateProgress(userProgress_score);
// Complete without score
ISAnalyticsUserProgress userProgress_no_score = new ISAnalyticsUserProgress("level_1").state(ISAnalyticsProgressState.COMPLETE).score(0).attempt(1);
IronSourceAnalytics.updateProgress(userProgress_no_score);
// Failed a level
ISAnalyticsUserProgress userProgress_fail = new ISAnalyticsUserProgress("level_1").state(ISAnalyticsProgressState.FAILED).score(0).attempt(1);
IronSourceAnalytics.updateProgress(userProgress_fail);
Custom activity API
Use this API to update any user movement, click within the application or any other custom event, that are not related to level progression
// The users actions API
IronSourceAnalytics.updateCustomActivity(@NonNull ISAnalyticsUserActivity appActivity);
Parameters
- ISAnalyticsUserActivity appActivity – The object that represents the activity event
ISAnalyticsUserActivity Object
This object and it’s properties define all the required information regarding a user activity event
Constructor:
- ISAnalyticsUserActivity(@NonNull String name) – The name of the activity to be analyzed
Set methods:
- property(@NonNull String name) – A specific property of the activity (optional)
Example of user action update API
// Example of user activity within the application without property
ISAnalyticsUserActivity userActivityAdOpen = new ISAnalyticsUserActivity("ad_open");
IronSourceAnalytics.updateCustomActivity(userActivityAdOpen);
IronSourceAnalytics.updateCustomActivity(new ISAnalyticsUserActivity("upload_picture"));
// Examples of user activity within the application with property
ISAnalyticsUserActivity userActivityAdOpenInShop = new ISAnalyticsUserActivity("ad_open").property("shop");
IronSourceAnalytics.updateCustomActivity(userActivityAdOpen);
IronSourceAnalytics.updateCustomActivity(new ISAnalyticsUserActivity("in_shop").property("next_items"));
IronSourceAnalytics.updateCustomActivity(new ISAnalyticsUserActivity("page_open").property("clan"));
ISAnalyticsUserActivity userActivityClanPage = new ISAnalyticsUserActivity("clan_page").property("join_clan");
IronSourceAnalytics.updateCustomActivity(userActivityClanPage);
userActivityClanPage.property("left_clan");
IronSourceAnalytics.updateCustomActivity(userActivityClanPage);