devtodev SDK for Web analytics part integration

To integrate your web application with devtodev system please perform the following actions:

  1. Add the application to the Space using the wizard for adding application

  2. Integration samples of devtodev SDK for WEB are available on GitHub.

  3. To integrate SDK add the following line to the tag of your page.

<script type="text/javascript" src="">



In order for SDK for WEB to start working, it is necessary to perform initialization right after the page is loaded and you have basic user identifier at your disposal.

* @param {string} apiKey - devtodev API key, unique API key can be found in the application
* settings (“My apps” → App Name → “Settings” → “Integration”)
* @param {string} userId - Unique user identifier.
* For example, user’s ID in a social network, or a unique account name used
* for user identification on your server.
* @param {string} previousUserId - Previous unique user identifier. Optional.
* It is used in case of change of the user identifier.

devtodev.init(apiKey, userId, previousUserId);

Attention! In case User ID is changed after SDK was initiated, the method should be called repeatedly with indication of the new User ID. (For example, when user signs into another account in a launched messenger application).

If user has no unique identifier (say, if it is possible to use your application / site without authorization), but you need to get stats for such users, don't set userId during the initialization or set the empty string ("") or null as value of userId. DK will assign the unique identifier to user. This identifier will we used until the real identifier assigns to the user.

Unique API key can be found in the application settings (“My apps” → App Name → “Settings” → “Integration”).

Cross-platform application Initialization 

In cross-platform applications the additional user identifier can be used. It is user cross-platform ID which is unique for all of the platforms. And if cross-platform ID differs from the ID which is main for the platform, you need to set the cross-platform ID.  The cross-platform ID combines the user data for cross-platform project.

We recommend you to apply this method before the SDK initialization, otherwise the user identiticator from the previous session will be used since the SDK initialization moment till the setCrossplatformUserId method call.

If it is difficult to do, set the cross-platform ID as soon as it will be available in the application after SDK initialization.

* Initializes the user with the specified cross-platform identifier
* @param {string} сrossplatformUserId - unique cross-platform user ID used
* for user identification on your server.


Attention! If your application allows user to relogin (changing the user during the working session of application), then the setCrossplatformUserId ​ method should be called just after the authorization. You don't need to call the SDK initialization one more time.

Additional initialization

For the most precise data collection, we strongly recommend specifying some information about the user right after SDK is initiated.


User data initialization

In the first place this additional initialization is required for gaming applications where the player has a game level as a characteristic.

* Initializes the current user level. Required if level feature used in the app.
* @param {number} currentUserLevel- Сurrent game level of the player.


Application data initialization

Method is not obligatory, but if you want to have an ability to build reports with regard to the version of your application, use this method.

* @param {Object} appData - App data object.
* @param {string} appData.appVersion - Current app version. Required.
* @param {number} appData.codeVersion - Current code version. Optional.



Debug mode

To enable the debug mode and make SDK notifications displayed in the console use this method:

* Activates console log
* @param {boolean} status

Basic Methods