LiveRamp

In this article, you will understand how to use the LiveRamp SDK to help Nimbus to identify your users.

Be sure Nimbus is initialized before continuing with the LiveRamp integration.

Integrating Nimbus with LiveRamp requires a Config ID which should be obtained by contacting LiveRamp. Check here for more information.

Installation

Swift Package Manager

Following the steps defined in the integration section to install Nimbus using Swift Package Manager, include the package 'NimbusLiveRampKit' in the selected packages.

CocoaPods

  1. Add the subspec NimbusLiveRampKit for the NimbusSDK declaration into your project’s Podfile. pod 'NimbusSDK', subspecs: ['NimbusRequestKit', 'NimbusLiveRampKit']

  2. Run pod install

LRAtsSDK will be automatically installed when using CocoaPods

Manual Installation

Drag NimbusLiveRampKit.xcframework package into your project and make sure to select “Embed & Sign”.

Configure the SDK to include LiveRamp

Include the LiveRamp request interceptor.

import NimbusLiveRampKit

// Create the request interceptor with email or phoneNumber
let interceptor = NimbusLiveRampInterceptor(configId: "configId", email: "email")

// Add it to the array of request interceptors
NimbusAdManager.requestInterceptors = [interceptor]

NimbusLiveRampInterceptor instance will automatically start LiveRamp’s initialize call when created.

LiveRamp SDK will look for consent strings in UserDefaults in order to properly initialize, be sure to setup these strings before initializing an instance of NimbusLiveRampInterceptor. More information can be found here.

Setup with delegate

Should you need to listen to any of NimbusLiveRampInterceptor‘s callbacks, set the delegate object that conforms to NimbusLiveRampInterceptorDelegate.

import LRAtsSDK

let interceptor = NimbusLiveRampInterceptor(configId: "configId", 
                                            phoneNumber: "phoneNumber", 
                                            delegate: self)
...

// MARK: NimbusLiveRampInterceptorDelegate

func didInitializeLiveRamp(error: Error?) {
    /// Triggered when the SDK initializes with either success or error
}

func didFetchLiveRampEnvelope(envelope: LREnvelope?, error: Error?) {
    /// Triggered when the SDK's fetch envelope finishes with either success or error
}

Both of these methods are asynchronous calls, which means that didFetchLiveRampEnvelope must be called successfully at least once in order to guarantee that LiveRamp’s envelope will be appended to subsequent ad requests.

If user’s consent is not needed based on it’s current location, i.e. GDPR or CCPA are not applicable, then the request interceptor can be initialized with hasConsentForNoLegislation = true.

let interceptor = NimbusLiveRampInterceptor(configId: "configId", 
                                            email: "email", 
                                            hasConsentForNoLegislation: true)

Last updated