start
user
edit user
subscription
edit subscription

Start

The AppAnalytics class is intialized by the javascript file < script type="module" src="../ClientSdk/js/initialise.js">

In order to instatiate a object of class AppAnalytics you need to enter your public key in its constructor when you define the object.

The class makes use of user cookies so if a user has disabled user cookies on thier browser the instatiation process will fail and AppAnalytics() will throw an exception.

The public key is provided to you after you create an Application on Our Dashboard. the public the class AppAnalytics takes must match your public key unless it will throw an exception.

Creating User

In order to make our service work you need to create user

The create_user() function return true value if the values have been successfully validated or throws an exeception when the user input information fails to pass validation checks.

After the function runs succesfully a new cookie is created which stores the user information for later operations if a user has cookies disabled this function will throw an exception.

if any of the value provided are null the function will also throw an Exception.

Checking User

this function checks if the current user has an account if

check_user() return the user info if user is defined else it return false

Creating User Subscription

The create_user_subscrioption() function will return a true value if it is successfuly executed or throw an exception if it fails a validation check.

if a user has cookies disabled this function will throw an exception.

this function cannot be executed be create_user() has succesfully created a user to associate the subscription with,

Edit User

The edit_user() function takes an object with the values that needs to be edited it does not accept null values.

if a value does not change it should not be included in the function. This function will return true on successful execution or throw an exception if the values fail a validation check.

If a user has cookies disabled on thier browser this function will throw an exception.

Edit User Subscription

The function edit_user_subscription() function makes changes the user's subscription if input data passes validation check it return true else it throws an exception