The Smart Banner SDK enables you to add Adjust Smart Banners to your website or web app. This guide shows you how to integrate the SDK in your project.
Once you've installed the dependency, import it into your project.
You can load the SDK via a CDN (Content Delivery Network) if you don't want to install it as a runtime dependency. The SDK can be accessed through the global
AdjustSmartBanner namespace when loaded.
When loading the SDK via a CDN, you should use a minified version for better performance.
- A specific version. For example:
- The latest version. For example:
SDK files are cached on the CDN so they are served as fast as possible. The cache is refreshed every 30 minutes. To receive updates immediately, target a specific version of the SDK.
To load the Smart Banner SDK via a CDN, paste the following snippet inside your page's
To initialize the Smart Banner SDK, call the
When you call this method, the SDK detects the device platform. If the device is a mobile platform, the SDK loads available smart banners. Available banners are displayed immediately after initialization.
If your project targets single-platform apps, pass each platform token as a key in the
You can localize your smart banners for better user experience. The Smart Banner SDK reads the language used in the browser and displays the localized copy of a banner if it exists. If you want to override this behavior, you can instruct the SDK to use a different language. There are two ways to set the preferred language:
- Pass it as a
languageparameter to the
- Call the
setLanguagemethod with the two letter language code as a string parameter.
That's it! The SDK is now integrated in your project. Check the other guides in this section for information about the SDK's functionality and how to configure different features.