LogoLogo
My AppsLive demoNewsArticles
  • Introduction
  • 📌Product updates: 2025
    • 2024
    • 2023
  • Getting Started
    • Registration
    • Adding a space
    • Adding an app to the space
  • Basic Events & Custom Events
  • Integration
    • Expert Tips
      • What to track
      • Payments & Anti-cheat
      • Check your integration
    • Integration of SDK 2.0+
      • SDK Integration
        • Android
        • iOS
        • macOS
        • Windows
        • Web
          • Web SDK Integration
          • Web SDK Releases
        • Unity
        • Unreal Engine
        • Godot Engine
      • Automatic payment tracking
        • App Store
        • Google Play
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anticheat methods
        • Track sessions
      • Push notifications
        • Android
        • iOS
        • Windows (UWP)
        • Unity
          • Android
          • iOS
          • Windows (UWP/WSA)
        • Unreal Engine
      • A/B testing
        • Description of A/B testing on the SDK side
        • Working with A/B tests in the devtodev interface
        • A/B testing examples
    • Integration of SDK 1.0+ (deprecated)
      • SDK Integration
        • iOS
        • Android
        • Windows 8.1 and 10
        • Web
        • Unity
        • Mac OS
        • Adobe Air
        • UE4
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anti-cheat Methods
      • Push Notifications
        • IOS
        • Android
        • Windows 8.1 and Windows 10
        • Unity
        • Abode Air
        • UE4
    • Test Devices
    • Server API
      • Data API 2.0
      • Subscription API
      • Push API
        • IOS
        • Android
        • Windows UWP
        • Windows
      • Raw Export
      • Labels API
      • Data API
    • Import historical data via API
    • Data Export
      • Data Export to Cloud Storage (BigQuery / Amazon S3)
  • 3rd Party Sources
    • Attribution Trackers
      • AppsFlyer
      • Adjust
      • Branch.io
      • Kochava
      • Tenjin
      • Tune (MAT)
      • Singular
      • Custom postback API
      • Facebook Ads referral decryption
    • App Marketplace Data
      • App Store Connect Stats
      • App Store Subscriptions
      • Google Play Console Stats
      • Google Play Subscriptions
      • AppGallery Connect Stats
    • Ad revenue
      • AdColony
      • AdMob
      • Facebook
      • MoPub
      • Unity Ads
      • Vungle
      • Ad revenue API
    • Cohort export
  • Reports and Functionality
    • Space-related Reports and Functionality
      • Overview
      • Custom dashboards & Reports
      • SQL
        • SQL tips
        • SQL Query examples
      • Audience overlap
    • Project-related Reports and Functionality
      • Overview
        • Real-Time Dashboard
        • Acquisition reports
        • Engagement reports
        • Monetization reports
        • In-game analysis reports
        • Cohort analysis
      • Reports
      • Push Notifications
        • Android Notifications
        • IOS Notifications
        • Windows Notifications
        • Button Templates
      • Predictions
      • Users & Segments
      • Filters
      • A/B Testing
      • Tuning
      • Settings
  • Metrics and Glossary
    • Ad networks metrics
    • Market Metrics
    • Prediction Metrics
    • SDK Metrics
    • Subscription metrics
  • Space Management
  • User Profile Management
  • Limits
  • Scenarios and Best Practices
    • Analytics use cases
    • Match-3
    • MMORPG Games
    • Hyper-Casual games
    • Social Casino
    • RPG games
    • Farming games
    • Non-gaming app
    • Acquisition Example
  • FAQ
    • Identification
    • Raw Data
    • All about data discrepancies
  • Slack
Powered by GitBook
On this page
  • Integration
  • Initialization

Was this helpful?

Export as PDF
  1. Integration
  2. Integration of SDK 2.0+
  3. SDK Integration
  4. Web

Web SDK Integration

PreviousWebNextWeb SDK Releases

Last updated 18 days ago

Was this helpful?

The latest up-to-date version of the Web SDK: 2.2

Please see the if you are using an outdated version.

Integration

Please do the following to integrate your web application with devtodev:

  1. 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/devtodevsdk-2.2.js">
</script>

Starting with version 2.1, you must specify the current version number of the SDK in the URI:

<script type="text/javascript"

src="https://cdn.devtodev.com/sdk/web/devtodevsdk-version.js">

</script>

  1. Initialize 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.

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. Must be greater than 0. 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.

applicationVersion

String

The app version. Cannot be empty.

Example:

var config = {};
config.userId = "Unique user identifier";
config.currentLevel = 2;
config.trackingAvailability = true;
config.logLevel = "Error";
config.applicationVersion = "1";
window.devtodev.initialize("App ID", config);

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 method after the initialization.

If you have a game app, we recommend specifying the current player’s lever either in the config or at the earliest possible moment after the initialization via the method.

changelog
Add the application
setUserId
setCurrentLevel