[NEW] React Native SDK: Adding SKAdNetwork Support

Introduction: SKAdNetwork and SKAN

SKAdNetwork is Apple's new framework for attributing mobile installs without compromising the end-user's privacy. Singular's new version of the iOS SDK helps you implement SKAdNetwork seamlessly and with minimal engineering effort. This SKAdNetwork implementation is based on SKAN - a standard developed by Singular for a smooth implementation of SKAdNetwork.

For a full guide to Singular's SKAdNetwork implementation, see the iOS SDK SKAdNetwork implementation guide.

Enabling SKAdNetwork Tracking

To enable SKAdNetwork tracking for your app, turn on the skAdNetorkEnabled configuration option before initializing Singular:

const config = new SingularConfig('<API_KEY>', '<SECRET>');

// Enable SKAdNetwork
config.withSkAdNetworkEnabled(true);

// Enable manual conversion value updates
config.withManualSkanConversionManagement();

// Register to a callback for when the conversion value is updated
config.conversionValueUpdatedHandler(value => {
	console.log(`Updated conversion value: ${value}`);
  });

Singular.init(config);

Handling Conversion Value Updates

Managed Mode

By default, the SKAdNetwork implementation manages the conversion value directly from the Singular server side.

This allows for maximum flexibility as you can set and change your conversion values through the Singular web app, without modifying your client-side code.

This server-side managed mode also helps you deal with the SKAdNetwork timers. SKAdNetwork allows you to update the conversion value within 24 hours from the time of registration to SKAdNetwork. Any call to update the conversion value extends the timer by 24 more hours. Therefore, when choosing your conversion events, you'll have to make sure the events happen within that update window. In managed mode, you can change the conversion event configuration at any time, without releasing a new version of your app.

Manual Mode

If you want to update the conversion value on your own in the app code, call withManualSkanConversionManagement when you initialize the SDK:

const config = new SingularConfig('<API_KEY>', '<SECRET>');
// Enable SKAdNetwork
config.withSkAdNetworkEnabled(true);

// Enable manual conversion value updates
config.withManualSkanConversionManagement();

Singular.init(config);

Then, to update the conversion value, use the skanUpdateConversionValue method wherever needed in your app's lifecycle:

skanUpdateConversionValue Method (JavaScript)
Description Manually update the SKAdNetwork conversion value.
Signature Singular.skanUpdateConversionValue(conversionValue)
Usage Example
// signup event happened
Singular.event("SignUp");

// update conversion value to 7
Singular.skanUpdateConversionValue(7);

Note: The skanUpdateConversionValue method will not function if you have not set the SDK to manual updates on initialization. 

Retrieving the Conversion Value

To get the current conversion value, use the skanGetConversionValue method. This method works in both managed and manual mode.

skanGetConversionValue Method (JavaScript)
Description Get the current conversion value tracked by the Singular SDK.
Signature Singular.skanGetConversionValue()
Usage Example
const conversionValue = Singular.skanGetConversionValue();

Other iOS 14 Updates

App Tracking Transparency Consent Handling

Note: On September 3rd, Apple announced an update delaying certain privacy features on iOS 14, specifically removing the requirements to use AppTrackingTransparency to access the IDFA until "early next year".  With this change, we recommend NOT implementing the AppTrackingTransprency pop-up with the iOS 14 launch, as IDFA is still accessible as of iOS 14 beta 7.  Read more about iOS 14 beta 7 and the IDFA here

The below content is still available for the future unannounced version of iOS 14, where AppTrackingTransparency will be required again to access the IDFA.

Alongside updates to SKAdnetwork with iOS 14, you are now required to ask for user consent (using ATTrackingManager) before you can access the device's IDFA to utilize it for conventional tracking. If you want to initialize the Singular SDK before you ask the user for consent, you can delay the SDK from firing events without IDFA for a specified interval of time, in order to wait for user consent.

To do so, initialize the Singular SDK with the waitForTrackingAuthorizationWithTimeoutInterval option, as in the following example:

const config = new SingularConfig('<API_KEY>', '<SECRET>');

// Enable SKAdNetwork
config.withSkAdNetworkEnabled(true);

// Wait 5m for tracking authorization before sending any events
config.withWaitForTrackingAuthorizationWithTimeoutInterval(300)

Singular.init(config);
Integration Guides
  1. Basic Integration
  2. Tracking Events and Revenue
  3. Implementing Deep Links
  4. Adding SKAdNetwork Support
  5. Advanced Options
Was this article helpful?