Upsight logo Back to top

Advanced

COPPA


If COPPA applies to you, there is an “opt-out” status that can be used to indicate whether you want Upsight to limit data collection and use, and serve only contextually targeted ads.

By default, the “opt-out” status is set to false. You can change this at any time. To get or set the “opt-out” status, use the following methods:

// Get the opt-out status
Upsight.getOptOutStatus();

// Set the opt-out status
Upsight.setOptOutStatus( true );
Upsight.setOptOutStatus( false );

WARNING It is extremely important to understand the consequences of setting the opt-out status to true. By setting the opt-out status to true, advertising will be limited and platform data collection capabilities will be disabled. Currently, this means that when opt-out is set to true, no advertisements will be available in your apps.

Custom Dimensions


You can target your marketing campaigns to a customized segment of users by creating custom dimensions. Once you have created custom dimensions in the Upsight Marketing Dashboard, you can add them to any content request from the SDK.

Important You must create custom dimensions in the Upsight Marketing Dashboard first before you can use them in the SDK. Please read this article for more information.

You can add custom dimensions as a Dictionary<string,object> to any content request, as shown below.

var dict = new Dictionary<string,object>();
dict.Add( "ua_source", "PlayHaven" );
dict.Add( "gold_balance", 2170 );
dict.Add( "registered", true );

// Pass in the custom dimensions dictionary
Upsight.sendContentRequest( "my_placement", true, false, dict );

You can also add custom dimensions when preloading.

var dict = new Dictionary<string,object>();
dict.Add( "ua_source", "PlayHaven" );
dict.Add( "gold_balance", 2170 );
dict.Add( "registered", true );

// Pass in the custom dimensions dictionary when preloading
Upsight.preloadContentRequest( "my_preloaded_placement", dict );

...

// Send the content request when you’re ready to display it
Upsight.sendContentRequest( "my_preloaded_placement", true );

Please note:

  • Upsight stores all custom dimensions received from the plugin on the server side for each device using your app.
  • The keys that you use in the plugin must match the keys that you created in the Upsight Marketing Dashboard.
  • Sending the same key with a different value for a device will update the custom dimension stored server side.
  • Sending a key with a null value for a device will delete the custom dimension stored server side.

Custom Events


Send custom events when a user performs an action specific to your application. This action can be anything that you deem valuable to track, such as progression to another level in a game.

To send a custom event, create a Dictionary<string,object> representing the event properties you wish to track. The dictionary has the following restrictions:

  • The keys must be strings and the values must be strings, numbers, or dictionaries.
  • The dictionary size must be less than 100 KB.

Note The dictionary must conform to a specific structure in order for your events to be tracked correctly. The Upsight Event Designer does not generate C# code for Unity.

// Construct custom event dictionary
var dict = MiniJSON.Json.Deserialize( "{\"inventory\":{\"swords\":{\"katanas\":3}}}" )
               as Dictionary<string,object>;

// Send the custom event
Upsight.reportCustomEvent( dict );

Preloading


Preloading can make content requests more responsive and potentially load faster. The performance improvements are more noticeable on Android because content is downloaded ahead of time.

Preloading requires two steps: preload the content unit, then display the content unit.

// Preload the content request well ahead of time
Upsight.preloadContentRequest( "my_preloaded_placement" );

...

// Send the content request when you’re ready to display it
Upsight.sendContentRequest( "my_preloaded_placement", true );

Note If you are preloading multiple different placements that display the same content unit, frequency caps for this content unit may not be applied.

Remove IDFA on iOS


If you are not using the Advertising Identifier (IDFA) on iOS, you can completely remove it from the Upsight Unity Plugin.

  1. Switch to the iOS platform in your build settings.
  2. Select "Upsight" > "iOS IDFA Inclusion" > "Disable IDFA Access for Project" from the Unity menu.

    Upsight > iOS IDFA Inclusion > Disable IDFA Access

  3. Regenerate your Xcode project from Unity.

  4. Build your Xcode project.

Tracking In-App Purchases


All In-App Purchases in your app should be tracked, regardless of whether Upsight VGPs triggered these purchases. Whenever an IAP completes (success or failure), make a simple tracking call as shown below. For Android VGPs, see following method.

// IAP tracking calls are platform-dependent
#if UNITY_IPHONE
// Receipt verification is supported on iOS
Upsight.trackInAppPurchase( "com.upsight.test.item"
                          , 1
                          , UpsightIosPurchaseResolution.Buy
                          , iapReceiptData );
#else
// Additional params are required for Android. Receipt verification not supported.
Upsight.trackInAppPurchase( "com.upsight.test.item"
                          , 1
                          , UpsightAndroidPurchaseResolution.Bought
                          , 2.99
                          , "the-order-id"
                          , "Google" );
#endif