Unity SDK
This repository hosts an example unity game running the latest UserWise SDK release. Information on learning how to properly integrate with the SDK can be found in the documentation link below.
Getting Started:
Unity Package Manager
You can quickly install the UserWise SDK without interferring with your project's source code, via use of the UPM (Unity Package Manager).
Within your Unity Editor; click
Window > Package Manager
Click the "+" icon at the top-left of the window -- directly under the tab labelled "Package Manager"
Click the "Add package from git URL"
Type in:
https://github.com/UserWise/userwise_unity_example.git#latest
*.unitypackage
If the UPM method above does not work for your game, you can always import the unitypackage that we provide here.
To install the old unitypackage style, just download the archive, open your Unity project, and double-click to have Unity manage the importing of our SDK assets into your game's source.
Configuring the SDK:
Once you’ve successfully added the SDK to the project you’ll want to add a new script to an object. In this script you’ll initialize UserWise.
private UserWise userwise;
void Start()
{
this.userwise = UserWise.INSTANCE;
// configure the instance
string apiKey = "xxxxx"; //get this from your game settings - https://app.userwise.io/app_settings/general?environment_key=dev
this.userwise.SetApiKey(apiKey);
// this should be unique and
string playerId = "xxxxxxx"
this.userwise.UserId = playerId;
this.userwise.Start();
}
Congratulations, you’ve now successfully integrated UserWise and created a new session!
Make sure to make use of the Stop to pause the SDK and Start to resume the SDK when needed (e.g. your game is backgrounded).
Sending Segmentation Data
One of the first steps with a UserWise integration is to start sending us segmentation data so that we can use that in targeting. Follow the link for detailed instructions about how to configure that. Note: you can also send this data via server to server if preferred.
Retrieving Content:
The SDK wouldn’t do much good if we weren’t returning remote configs from UserWise.
In UserWise we handle all of the segmentation/AB testing variant determination. So we’ll return to you a set of each type of content that the player currently matches for along with upcoming content that’s starting soon (the timeframe on this is configurable). You can find a list of each of the different pieces of content below with detailed instructions for how to setup each:
Events
Messages
Offers
Push Notifications
Remote Config
Emails
Surveys
Refreshing Content:
Keeping the SDK up to date is also important. Follow the link above for more details about how/when you should refresh the content in UserWise to ensure player’s always have the most up to date experience.
Powered by UserWise