Links

Web

Please do the following to integrate your web application with devtodev:
1. Add the application to the Space using the wizard for adding applications.
2. To integrate SDK, add the following line to the tag of your page:
<script type="text/javascript" src="https://cdn.devtodev.com/sdk/web/v2/devtodevsdk.js">
</script>
3. Init the SDK.

Initialization

In order for SDK for WEB to start working, it is necessary to perform initialization right after the page is loaded and you have a basic user identifier at your disposal.
window.devtodev.initialize("App ID", config);
  • You can find the App ID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
  • config - is an object that is used for specifying additional properties during initialization.
Since there’s no option to get any consistent identifier in web browsers, we recommend using as a User ID either a social network ID with your app or an ID that your server assigns to a user. It’s best to assign a User ID and specify it in the config object during the SDK initialization instead of using a setUserId method after the initialization.
If you have a games app, we recommend specifying the current player’s lever either in the config or at the earliest possible moment after the initialization via the setCurrentLevel method.
Config
Parameter
Type
Description
userId
string
Unique user identifier. For example, user’s ID in a social network, or a unique account name used for user identification on your server. If at the time of initialization this identifier is not yet available, specify the identifier later using
the setUserId method.
currentLevel
integer
The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.
trackingAvailability
boolean
The property allows or disallows devtodev tracking of the user. By default, it is set to true. SDK stores the previously assigned value. Pass false if the user opted out of tracking in line with GDPR.
logLevel
string
The level of logging the SDK activity. The "No" value is used by default. For troubleshooting during integration, it is recommended to set it to "Debug", and either switch it "No" or use it only for error handling "Error" in the release version.
Example:
var config = {};
config.userId = "Unique user identifier";
config.currentLevel = 2;
config.trackingAvailability = true;
config.LogLevel = "Error";
window.devtodev.initialize("App ID", config);
Last modified 10mo ago