The Adjust Windows SDK enables you to record attribution, events, and more in your Windows app. Follow the steps in this guide to set up your app to work with the Adjust SDK.
1. Add the Adjust SDK to your project
To use the Adjust SDK in your Windows app, you need to add it to your Visual Studio project. You can download the latest version from the GitHub releases page.
Using NuGet
To add the SDK using NuGet:
- Right click on the project in the Solution Explorer to open the NuGet Package Manager window.
- Select Manage NuGet Packages….
- Select the Browse tab.
- Enter
adjust
in the search box and hit Return to search for the Adjust SDK. - The Adjust SDK should appear at the top of the list. Select it and select Install to install the package.
Using the Package Manager Console
To install the Adjust SDK using the Package Manager Console:
- Select TOOLS —> NuGet Package Manager —> Package Manager Console to open the Package Manager Console view.
- Enter the following install command in the prompt and hit Return to run it.
2. Integrate the SDK
Once you’ve added the Adjust SDK to your Visual Studio project, you need to integrate it in your app.
- Open the Solution Explorer.
- Open the
App.xaml.cs
file. - Add the following directive to the top of the file:
3. Initialize the Adjust SDK
To initialize the Adjust SDK, you need to create a config object. This object contains configuration options that control how the Adjust SDK behaves. Pass the following arguments for a minimal setup:
appToken
: Your app’s token.environment
: The environment you want to run the SDK in. Set this toAdjustConfig.EnvironmentSandbox
.
To initialize the Adjust SDK with this config object:
- Declare your config object in the
OnLaunched
method of your app. - Pass the config object as an argument to the
Adjust.ApplicationLaunching
method.
4. Configure the Adjust SDK
Once you’ve added your config object and initialization logic, you can configure the Adjust SDK to record information about different parts of your app. Check out the guides for the SDK’s configuration and features to set up exactly what you want to record.
5. Build and debug your app
Once you’ve integrated the Adjust SDK and set it up, you can start the Visual Studio debugger to check that the SDK is logging as expected. To do this:
- Select Debug —> Start Debugging to open the debugger.
- Check the Output tab to see your app’s logs. Adjust SDK logs are displayed with an [Adjust] tag.