Analytics Object

Introduction

This object allows you to manage and send analytics data into your Ocugine project. Use these methods to analyze your games and build reports in real-time. Learn more about analytics in the Dashboard here.

Analytics Object Methods

Analytics.UpdateRetention (update_retention)

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/users/update_retention/
Request POST Params: Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token string If you need to assign retention data for authenticated user - send access token

Response Example:

{
    "complete": true,
    "message": "",
    "data": []
}

Analytics.GetAvailableFlags (update_retention)

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/users/get_available_flags/
Request POST Params: Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "list": [
            "first_open",
            "session_open",
            "session_update",
            "purchase_initialized",
            "purchase_canceled",
            "purchase_processed",
            "application_error",
            "test_flag",
            "my_another_flag"
        ]
    }
}

Analytics.SetUserFlag (set_user_flag)

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/analytics/set_user_flag/
Request POST Params: Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
flag (required) string Analytics Flag
access_token string If you need to assign flag data for authenticated user - send access token

Response Example:

{
    "complete": true,
    "message": "",
    "data": []
}

Analytics.GetUserFlag (get_user_flag)

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/analytics/get_user_flag/
Request POST Params: Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
flag (required) string Analytics Flag
access_token string If you need to get flag data exists for authenticated user - send access token

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "flag": "session_update",
        "exists": true
    }
}

Analytics.GetLatestUserFlags (get_latest_user_flags)

This method requires Project ID and Client Key

API Url:

https://cp.ocugine.pro/api/analytics/get_latest_user_flags/
Request POST Params: Parameter Type Description
app_id (required) double Project ID
app_key (required) string Project Client Key
access_token string If you need to get flags list for authenticated user - send access token

Response Example:

{
    "complete": true,
    "message": "",
    "data": {
        "complete": true,
        "list": [
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "session_update"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "session_open"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "session_open"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "application_error"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "session_update"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "session_update"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "my_another_flag"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "first_open"
            },
            {
                "project_id": "59",
                "viewer": "48f2aceb8c3ed3afc05e2917753e1229",
                "profile_uid": "0",
                "flag": "test_flag"
            }
        ]
    }
}