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.

    Note: The progression API does not require any pre-init settings

    // The user level progression API
    IronSourceAnalytics.updateProgress(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(string level1) – The main level in the game

    Set methods:

    • state(ISAnalyticsProgressState state) – An enumerated value of the user progression type (mandatory)
      • BEGIN
      • IN_PROGRESS
      • COMPLETE
      • FAILED
    • level2(string value) – The secondary (in hierarchy) level in the game (optional)
    • level3(string value) – The third (in hierarchy) level in the game (optional)
    • score(int amount) – 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 of the level (optional)

    Important! The value of the variable “attempt” starts from 1 (not from 0)

    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 custom activity API
    IronSourceAnalytics.updateCustomActivity(ISAnalyticsUserActivity userActivity)
    

    Parameters

    • ISAnalyticsUserActivity userActivity – 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(string name) – The name of the activity to be analyzed

    Set methods:

    • attribute(string name) – A specific property of the activity (optional)

    Example of user action update API

    // Example of user activity within the application without attribute
    ISAnalyticsUserActivity userActivityAdOpen = new ISAnalyticsUserActivity("ad_open");
    IronSourceAnalytics.updateCustomActivity(userActivityAdOpen);
    IronSourceAnalytics.updateCustomActivity(new ISAnalyticsUserActivity("upload_picture"));
    // Examples of user activity within the application with attribute
    ISAnalyticsUserActivity userActivityAdOpenInShop = new ISAnalyticsUserActivity("ad_open").attribute("shop");
    IronSourceAnalytics.updateCustomActivity(userActivityAdOpen);
    IronSourceAnalytics.updateCustomActivity(new ISAnalyticsUserActivity("in_shop").attribute("next_items"));
    IronSourceAnalytics.updateCustomActivity(new ISAnalyticsUserActivity("page_open").attribute("clan"));
    ISAnalyticsUserActivity userActivityClanPage = new ISAnalyticsUserActivity("clan_page").attribute("join_clan");
    IronSourceAnalytics.updateCustomActivity(userActivityClanPage);
    userActivityClanPage.attribute("left_clan");
    IronSourceAnalytics.updateCustomActivity(userActivityClanPage);