Before You Begin: SDK Prerequisites
Follow the steps in Integrating a Singular SDK: Planning and Prerequisites.
These steps are prerequisites for any Singular SDK integration.
1. Installing the SDK
1.1. Configuration for Android
-
In your AndroidManifest.xml file, add the following permissions:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" />
-
If you have disabled transitive dependencies for the Singular SDK, add the following to your app's build.gradle.
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.google.android.gms:play-services-appset:16.0.0' -
The Singular SDK requires the Google Mobile Ads API, part of the Google Play Services APIs 17.0.0+. If you've already integrated Google Play Services into your app, the requirement is fulfilled. If you haven't, you can integrate Google Mobile Ads individually, by including the following dependency in your app's build.gradle file:
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0+'
For more information, see Google's guide to setting up Google Play Services.
Android Configuration (Proguard and Eclipse)
If you are using Proguard, add the following lines of code to your proguard-unity.txt file:
-keep class com.singular.sdk.** { *; }
-keep public class com.android.installreferrer.** { *; }
-keep public class com.singular.unitybridge.** { *; }
If you are building with Eclipse, use one of the following methods to integrate the AAR into your Eclipse project:
- Use the Eclipse aar plugin: gradle-eclipse-aar-plugin.
- Or integrate the AAR manually:
- Unzip singular_sdk-9.x.x.aar.
- Rename classes.jar to singular_sdk-9.x.x.jar (this is the main SDK jar).
- Integrate the above jar and libs/installreferrer-release.jar (the Google Referrer API library) into your Eclipse project any way you prefer.
- Copy the BIND_GET_INSTALL_REFERRER_SERVICE permission from the AndroidManifest.xml contained in the AAR to your AndroidManifest.xml.
1.2. Configuration for iOS
Link the following libraries/frameworks to your Unity XCode project:
- Security.framework
- SystemConfiguration.framework
- iAD.framework
- AdSupport.framework
- WebKit.framework
- libsqlite3.0.tbd
- libz.tbd
- StoreKit.framework
- AdServices.framework (Must be added, but mark it as Optional since it's only available for devices with iOS 14.3 and higher).
1.3. Downloading and Importing the SDK Package
- To begin, download the SDK unitypackage file.
- Import the unitypackage into your app using Assets > Import Package > Custom package.
-
In the Unity platform:
- Add an object to your Main scene and call it SingularSDKObject.
- Drag and drop the SingularSDK script onto it.
- In the inspection pane, paste in your Singular SDK Key and SDK Secret (to retrieve them, log into your Singular account and go to Developer Tools > SDK Keys).
2. Setting Up a Basic SDK Integration
2.1. Using SKAdNetwork
Starting with Unity SDK version 4.0.16, SKAdNetwork is enabled by default. It is enabled in Managed Mode (in which Singular updates the SKAN conversion value for you using a conversion model you choose in the Singular dashboard).
As long as you are using the latest version of the SDK, you do not need to set anything else or add any code to use SKAdNetwork.
Additional Information
If you are using an older version of the SDK, you need to enable SKAdNetwork in one of the following ways:
- Go to the SingularSDKObject and set SKANEnabled to True.
- Call SingularSDK.SkanRegisterAppForAdNetworkAttribution() in your app code.
If you choose to manage the SKAN conversion value manually using your own logic, you need to do the following:
- Go to the SingularSDKObject and set manualSKANConversionManagement to True.
- Use the following methods in your code to set and retrieve the conversion value.
SingularSDK.SkanUpdateConversionValue Method | |
---|---|
Description |
Update the SKAdNetwork conversion value. Note: Use this method if you have selected to update the SKAdNetwork conversion value manually. This method will work only if manualSKANConversionManagement is set to True. |
Signature | public void SkanUpdateConversionValue(int value) |
Usage Example |
|
SingularSDK.SkanGetConversionValue Method | |
Description | Get the current conversion value tracked by the Singular SDK. |
Signature | public int? SkanGetConversionValue() |
Usage Example |
|
SingularSDK.SetConversionValueUpdatedHandler Method | |
Description | Set a handler to receive notifications when the conversion value is updated. |
Signature | public void SetConversionValueUpdatedHandler(SingularConversionValueUpdatedHandler handler) |
Usage Example |
|
2.2. Handling ATT Consent (Setting an Initialization Delay)
Displaying an ATT (App Tracking Transparency) Prompt
Starting with iOS 14.5, apps are required to ask for user consent (using the App Tracking Transparency framework) before they can access and share some user data that is helpful for tracking purposes, including the device's IDFA.
Singular highly benefits from having the IDFA to identify devices and perform install attribution (although there are ways to perform attribution without the IDFA). We strongly recommend you ask for the user's consent to get the IDFA.
Delaying Initialization to Wait for ATT Response
By default, the Singular SDK sends a user session when it is initialized. When a session is sent from a new device, it immediately triggers Singular's attribution process - which is performed based only on the data available to Singular at that point. Therefore, asking for consent and retrieving the IDFA before the Singular SDK sends the first session is essential.
To delay the firing of a user session, configure the waitForTrackingAuthorizationWithTimeoutInterval option in the SingularSDKObject. This sets the maximum time (in seconds) that the Singular SDK will wait for the user to authorize/deny AppTrackingTransparency Consent before logging events to Singular's servers. The default value for this option is 0 (no wait).
2.3. Handling Deep Links
Deep links are links that lead into specific content inside an app. When a user clicks a deep link on a device that has the app installed, the app opens and shows a specific product or experience.
Singular tracking links can include deep linking as well as deferred deep linking (see our Deep Linking FAQ and the Singular Links FAQ for more information).
The instructions below will show you how to:
- Access the tracking link that led to your app being opened,
- Read the deep link destination, and
- Show the appropriate content.
Notes:
- This article assumes your organization is using Singular Links - Singular's new tracking link technology, launched in 2019. Older customers of Singular may be using Singular's older tracking links (legacy links). To support deep linking with legacy links, see Handling Deep Links with Legacy Links.
- The deep link destinations for your app need to be set up on the Apps page in Singular (see Configuring Your App for Attribution Tracking).
Setting Up Deep Linking Prerequisites
-
Prerequisites for iOS and Android: Follow the instructions in Singular Links Prerequisites for iOS and/or Android.
-
Additional Setup for Unity: In the app's AndroidManifest.xml file, change the activity name property from the default UnityPlayerActivity (e.g., <activity android:name= "net.singular.unitysdk.UnityPlayerActivity">) to SingularUnityActivity:
<activity android:name="com.singular.unitybridge.SingularUnityActivity">
If you've implemented your own custom activity, just call this method in the onNewIntent in your activity:
@Override protected void onNewIntent(Intent intent) { setIntent(intent); // Call this method from your custom activity in onNewIntent SingularUnityBridge.onNewIntent(intent); }
Adding a Deep Links Handler
The Singular SDK provides a handler mechanism to read the details of the tracking link that led to the app being opened.
To use the handler:
- Implement the SingularLinkHandler interface.
- Call the SetSingularLinkHandler method at any point in the class to register the class as the handler for deep links.
- When you call SetSingularLinkHandler, the Singular SDK fetches the tracking link and calls the OnSingularLinkResolved method, passing the tracking link details to it. Override this method to read the link details and process them.
The following sample code shows the three steps:
public class Main : SingularLinkHandler {
// ...
void Awake () {
// Register the class as the Singular Link handler.
// You can call this method at any point in the app's run. It will fetch the tracking link details and call OnSingularLnkResolved.
SingularSDK.SetSingularLinkHandler(this);
}
public void OnSingularLinkResolved(SingularLinkParams linkParams) {
// The deep link destination, as configured in the Manage Links page
string deeplink = linkParams.Deeplink;
// The passthrough parameters added to the link, if any.
string passthrough = linkParams.Passthrough;
// Whether the link configured as a deferred deep link.
bool isLinkDeferred = linkParams.IsDeferred;
// Add code here to process the deeplink
}
// ...
Method Reference
SetSingularLinkHandler Method | |
---|---|
Description | Register a handler that retrieves the details of the tracking link that led to the opening of the app. |
Signature |
|
Usage Example |
|
OnSingularLinkResolved Method | |
---|---|
Description | Callback method for SetSingularLinkHandler. Read the tracking link details and process them. |
Signature |
Note: The SingularLinkParams object contains the following values:
|
Usage Example |
|
Handling Deep Links with Legacy Links
If you are an older Singular customer, you may be using legacy tracking links (Singular's older tracking link mechanism) rather than the newer Singular Links. Legacy links are managed in the Create Link and View Links pages, and they also provide deep linking and deferred deep linking functionality.
If your organization uses legacy links, you need to implement a handler for deep links called SingularDeferredDeepLinkHandler instead of the SingularLinksHandler described above. The implementation is very similar.
- Implement the SingularDeferredDeepLinkHandler interface.
- Call the SetDeferredDeepLinkHandler method at any point in the class to register the class as the handler for deep links.
- When you call SetDeferredDeepLinkHandler, the Singular SDK fetches the tracking link and calls the OnDeferredDeepLink method, passing the tracking link details to it. Override this method to read the link details and process them.
The following sample code shows the three steps:
public class Main : SingularDeferredDeepLinkHandler {
// ...
void Awake () {
// Register the class as the deep link handler.
// You can call this method at any point in the app's run.
SingularSDK.SetDeferredDeepLinkHandler(this);
}
public void OnDeferredDeepLink(string deeplink) {
// Code to handle the deep link goes here.
// In this example, the deep link is just logged.
Debug.Log ("Deep link received:" + deeplink);
}
// ...
The deferred deep link value (if available) will be passed to you if the ddlTimeoutSec value (timeout for deferred deep links) has not passed yet. You can configure ddlTimeoutSec from the inspection pane of your SingularSDKObject.2.4. Initializing the SDK
Note: Remember to remain compliant with the various privacy laws enacted in regions where you are doing business, including GDPR, CCPA, COPPA, and others, when implementing the Singular SDKs. For more information, see SDK Opt-In and Opt-Out Practices.
The SDK initialization code should be called every time your app is opened. It is a prerequisite to all Singular attribution functionality and it also sends a new session to Singular that is used to calculate user retention.
By default, SingularSDK.cs initializes the SDK automatically when the scene is created, through the Awake method.
Manual Initialization
If you prefer to initialize the SDK manually at a later point in the app's run, do the following:
- Disable the Initialize on Awake option in the inspection pane of the SingularSDK object.
- Use the SingularSDK.InitializeSingularSDK static method to initialize the SDK:
SingularSDK.InitializeSingularSDK Method | |
---|---|
Description | Initialize the Singular SDK if it hasn't been initialized on Awake. |
Signature |
|
Usage Example |
|
Note on Thread Safety: The Singular Unity SDK should always be called from the same thread, the same way you call other Unity methods.
2.5. Optional: Configuring the Session Timeout
By default, if the app runs in the background for 60 seconds or more before returning to the foreground, the Singular SDK registers a new session. You can change the default timeout value by modifying the Session Timeout Sec property of your SingularSDKObject.
2.6. Optional: Setting the User ID
The Singular SDK can send a user ID from your app to Singular. This can be a username, email address, randomly generated string, or whichever identifier you use as a user ID. Singular will use the user ID in user-level data exports as well as internal BI postbacks (if you configure any).
To send the user ID to Singular, call the SetCustomUserId method. To unset the ID (for example, If the user logs out of their account), call UnsetCustomUserId.
Notes:
- The user ID persists until you unset it by calling UnsetCustomUserId or until the app is uninstalled. Closing/restarting the app does not unset the user ID.
- If you already have the user ID available when the app opens, and you want it to be available to Singular from the very first session, make sure to set it before initializing the Singular SDK.
SingularSDK.SetCustomUserId Method | |
---|---|
Description | Send the user ID to Singular. |
Signature |
|
Usage Example |
|
SingularSDK.UnsetCustomUserId Method | |
Description | Unset the user ID that has been sent to Singular in the last CustomUserId call. |
Signature |
|
Usage Example |
|
3. Tracking Events and Revenue
3.1. Tracking Events
Singular can collect data about in-app events to help analyze the performance of your campaigns and measure KPIs. For example, your organization may want to collect data about user logins, registrations, tutorial completions, or leveling up in a gaming app.
Singular supports a variety of standard events. These commonly used events are often supported by ad networks for reporting and optimization. Another advantage is that when you use standard event names, Singular recognizes them automatically and adds them to the Events list without you having to define them manually. We recommend using standard events whenever possible.
The list of events sent to Singular (with the accompanying attributes) should be compiled by the UA/marketing/business team based on your organization's marketing KPIs. The business team can follow the guide at How to Track In-App Events: Guide For Singular Attribution Customers.
With each event you track, you can pass various attributes. See the recommended standard attributes per event.
In your code, send standard events to Singular using the event or eventWithArgs methods.
Note: For standard events, use the event's Unity name as it appears in the Unity SDK List of Standard Events and Attributes, e.g., sngLogin.
For custom events, events that your organization wants to measure that do not match any of Singular's standard events, use any custom name (maximum of 32 characters). We recommend using names in English for compatibility with any ad network partners that may receive the event from Singular for optimization purposes.
SingularSDK.Event Method | |
---|---|
Description | Send user events to Singular for tracking. |
Signature |
Note: When passing dictionaries, dictionary values must have one of these types: string, int, long, float, double, null, ArrayList, Dictionary<String,object> |
Usage Example |
|
3.2. Tracking Revenue
Singular can collect data about revenue gained through the app in order to help analyze the performance and ROI of your campaigns. Singular will make the data available in reports, log export, and postbacks.
Notes: Any revenue reported in a different currency will be auto-converted to your organization's preferred currency as set in your Singular account.
You can track revenue events using Unity's built-in IAP (In-App Purchases) object. This way, Singular gets all the available information about the purchase for richer reporting. Singular also gets the purchase receipt, which Singular uses in the back end to validate the purchase and rule out attribution fraud.
SingularSDK.InAppPurchase Method |
|
---|---|
Description | Send an IAP product to Singular to track the purchase event. |
Signature |
Notes:
|
Usage Example |
|
If you cannot use Unity IAP, the Singular SDK provides two methods for passing information about a purchase to Singular "manually":
- Use Revenue to pass information about a purchase to Singular by detailing the transaction currency, the transaction amount, and other optional details.
- CustomRevenue is very similar but also allows you to give the event a custom name.
Note: If you use Revenue/CustomRevenue instead of InAppPurchase, Singular will not be able to verify the purchase receipt.
SingularSDK.Revenue Method |
|
---|---|
Description | Send a revenue event to Singular. |
Signature |
Note: Pass currency as a three-letter ISO 4217 currency code, such as "USD", "EUR", "INR".
|
Usage Example |
|
SingularSDK.CustomRevenue Method |
|
---|---|
Description | Send a revenue event with a custom name to Singular. |
Signature |
Note: Pass currency as a three-letter ISO 4217 currency code, such as "USD", "EUR", "INR".
|
Usage Example |
|
4. Advanced Options
4.1. Creating Short Referrer Links
Note: This functionality is available in SDK version 4.0.16+.
Use short links to transform long, parameter-filled Singular Links into shorter and more secure links that are convenient for sharing.
Typically, you will want to create short links dynamically so that your app's users can share them with friends to invite them to use the app.
To create a short link, you need:
- A Singular Link that leads to your app download (see the Singular Links FAQ).
- Any parameters you want to add to the link dynamically (see Tracking Link Parameters for the list of options).
- The name and ID of the referring user, if you want to be able to track new app installs back to the user who shared the link.
Use the createReferrerShortLink method to create a short link as in the example below.
void callback(string shortLinkURL, string error){
// Add your share logic here if shortLinkURL is not null
// If there was an error, add logic to retry/abort/modify the params
// passed to the function, based on the cause of the error
}
SingularSDK.createReferrerShortLink(
"https://sample.sng.link/B4tbm/v8fp?_dl=https%3A%2F%2Fabc.com",
"John Doe", // Referrer Name
"342", // Referrer ID
new Dictionary<string, string>() {
// a Dictionary object containing any parameters you want to add
{"channel", "sms"}
},
callback
);
4.2. Adding Ad Revenue Attribution Support
Note: Starting in version 3.0.0, Singular added the option to set up ad revenue attribution through the Singular SDK.
Ad revenue attribution can still be set up the old way, using API calls, without updating the Singular SDK in your apps. However, if you want to measure ad revenue for SKAdNetwork campaigns, you have to set up ad revenue attribution through the SDK.
To add ad revenue attribution support in the Singular SDK:
- If you haven't done so yet, contact your Singular Customer Success Manager to enable ad revenue attribution for your account.
- Update to the latest version of the Singular SDK.
- Add the appropriate code snippet to your Singular SDK integration, depending on the mediation platform you use for ad revenue data.
// Note: This is a beta feature. Contact Admob to have it enabled.
RewardedAd rewardedAd;
public void HandleRewardedAdLoaded(object sender, EventArgs args)
{
this.rewardedAd = args.rewardedAd;
}
AdValue impressionData;
private void HandleAdPaidEvent(object sender, AdValueEventArgs args)
{
this.impressionData = args.AdValue;
SingularAdData data = new SingularAdData("Admob", impressionData.CurrencyCode, impressionData.Value/1000000f);
data.WithNetworkName(this.rewardedAd.GetResponseInfo().GetMediationAdapterClassName());
Singular.AdRevenue(data);
}
// The object received from AppLovin MAX's event: OnInterstitialAdRevenuePaidEvent
MaxSdkBase.AdInfo impressionData;
string adUnitId;
double revenue = MaxSdk.GetAdInfo(adUnitId).Revenue;
SingularAdData data = new SingularAdData("AppLovin","USD", revenue);
data.WithAdUnitId(impressionData.AdUnitIdentifier).
WithNetworkName(impressionData.NetworkName).
WithAdPlacementName(impressionData.Placement);
Singular.AdRevenue(data);
// The object received from IronSource's event: OnImpressionSuccess
IronSourceImpressionData impressionData;
SingularAdData data = new SingularAdData("IronSource","USD", impressionData.revenue);
data.WithAdUnitId(impressionData.getInstanceId).
WithAdUnitName(impressionData.getInstanceName).
WithImpressionId(impressionData.getAuctionId).
WithNetworkName(impressionData.adNetwork).
WithAdPlacementName(impressionData.placement).
WithAdType(impressionData.getAdUnit);
Singular.AdRevenue(data);
// Ensure that the ARM SDK Postbacks Flag (click here) in IronSource is turned on
// Initialize the SingularAdData object with the relevant data
SingularAdData data = new SingularAdData("YOUR_AD_PLATFORM", "CURRENCY_CODE", 9.90).
// The more ad data you add, the greater the granularity
data.WithAdGroupId("AD_GROUP_ID")
.WithNetworkName("AD_NETWORK_NAME");
// Report the data to Singular
SingularSDK.AdRevenue(data);
Note: Pass currency as a three-letter ISO 4217 currency code, e.g., "USD," "EUR", "INR".
4.3. Tracking Uninstalls
Note: Uninstall tracking is only available to Enterprise customers.
Android Uninstall Tracking
To enable uninstall tracking for your Android app, first configure the app in the Singular platform as detailed in Setting Up Uninstall Tracking. Then follow the instructions below.
Note: Google deprecated the GCM APIs on April 2018. Use FCM for uninstall tracking.
Enabling Uninstall Tracking Using Firebase Cloud Messaging (FCM):
1. Integrate with FCM:
To track uninstalls, you can use the services of the Firebase Cloud Messaging (FCM) platform. If you are not already using FCM, follow Google's instructions on how to Set up a Firebase Cloud Messaging client app on Android.
FCM Requirements (source)
FCM clients require devices running Android 4.1 or higher that also have the Google Play Store app installed, or an emulator running Android 4.1 with Google APIs. Note that you are not limited to deploying your Android apps through Google Play Store.
Users/devices who are not running on supported versions of Android will not be available for Singular uninstall tracking.
2. Update the AndroidManifest.xml File:
Update your AndroidManifest.xml file to add the necessary intent filter for your app (replace MyFirebaseMessagingService with your class that implements the Firebase Service):
<service android:name=".java.MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter> </service>
<service
android:name=".java.MyFirebaseMessagingService"
android:exported="false">
intent-filter>
action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
3. Register and Send the FCM Device Token:
After retrieving the FCM token, pass it as a parameter to the 'RegisterTokenForUninstall' method:
SingularSDK.RegisterTokenForUninstall(String fcmDeviceToken);
Note that the 'RegisterTokenForUninstall' method should be called before the 'SingularSDK.InitializeSingularSDK()' method.
iOS Uninstall Tracking
Uninstall tracking on iOS is based on Apple push-notification technology. If your app doesn't currently support push notifications, see Apple's guide. If your app already supports push notifications, all you need to do is pass the device token returned from APNS using the RegisterTokenForUninstall method, after the SDK is initialized.
SingularSDK.RegisterTokenForUninstall Method |
|
---|---|
Description | Pass the device token returned from APNS. Note that the APNS token is usually binary data in the native form, but you need to pass it as a string. |
Signature |
|
Usage Example |
|
4.4. Adding Global Properties
The Singular SDK lets you define custom additional properties to send to the Singular servers with every session and event sent from the app. These properties can represent any information you want about the user, the app mode or status, or anything else. Once you set these properties, they are available as dimensions in your reports and you can use them to break down your data.
For example, if you have a gaming app, you can define a property called "Level" and set it initially to "0". Any session and event sent from the app will be sent with "Level": "0". Once the user levels up you reset the property to "1" and so on. You can then get your reports, including sessions, event counts, and revenue data, broken down by user level.
- You can define up to 5 global properties.
- They persist between app runs (with the latest value you gave them) until you unset them or the user uninstalls the app.
- Each property name and value can be up to 200 characters long. If you pass a longer property name or value, it will be truncated to 200 characters.
- Global properties are accessible and available in user-level exports and postbacks. In the future, aggregate reporting support will be added. Let your Singular customer success manager know if you have any questions or are interested in updates to global properties support!
Setting Global Properties Before Initialization
You can use the SetGlobalProperty method to set global properties through SingularSDK before initializing the SDK. Turn off the 'Initialize On awake' flag if you want your global properties to be included in the session.
Note that since global properties and their values persist between app runs, the property that you are setting may already be set to a different value. Use the overrideExisting parameter to tell the SDK whether to override an existing property with the new value or not.
Setting Global Properties After Initialization
Use the following methods to set, unset, and retrieve global properties at any time in the app's run.
SingularSDK.SetGlobalProperty Method | |
---|---|
Description |
Set a global property to a given value. Notes:
|
Signature | public static bool SetGlobalProperty(string key, string value, bool overrideExisting) |
Usage Example |
|
SingularSDK.GetGlobalProperties Method | |
Description | Retrieve all the global properties and their current values as a Map. |
Signature | public static Dictionary<string, string> GetGlobalProperties() |
Usage Example |
|
SingularSDK.UnsetGlobalProperty Method | |
Description | Remove a global property. |
Signature | public static void UnsetGlobalProperty(string key) |
Usage Example |
|
SingularSDK.ClearGlobalProperties Method | |
Description | Remove all global properties. |
Signature | public static void ClearGlobalProperties() |
Usage Example |
|
4.5. Collecting the Install Referrer on Older Android Devices
In Android, the install referrer is Singular's most accurate tool to determine attribution, in addition to helping Singular detect and analyze fraud attempts. It is an identifier provided by the Google Play Store that points to the ad that the user clicked on before installing the app.
On devices that have the latest version of the Google Play Store, the Singular SDK collects the install referrer value automatically (since Singular is integrated with the latest Google Play Referrer API).
To collect the install referrer on older devices, follow the instructions in the Android SDK guide.
5. Complying with Data Privacy Laws
5.1. LimitDataSharing
Singular provides privacy-safeguarding functionality to help you cooperate with any partners who may be complying with consumer privacy laws such as GDPR and CCPA (California Consumer Privacy Act). These partners want to be notified if the end-user has consented to share their private information.
If you have implemented a way to ask users for consent to share their information, use the LimitDataSharing method to notify Singular of the user's choice:
- Use SingularSDK.LimitDataSharing(false) to indicate that the user consented (opted in) to share their information.
- Use SingularSDK.LimitDataSharing(true) if the user did not consent.
Singular will pass this information on to partners who require it in order to comply with relevant regulations.
Note: The use of the method is optional, but there may be attribution information that the partner will share with Singular only if specifically notified that the user has opted in.
SingularSDK.LimitDataSharing Method | |
---|---|
Signature | SingularSDK.LimitDataSharing(bool shouldLimitDataSharing) |
Description | Notify Singular of user consent (opt-in) for sharing private data. |
Usage Example |
|
5.2. Additional Methods for GDPR Compliance
The Singular SDK provides several methods to help you comply with GDPR policies and let Singular know about user consent or non-consent for tracking.
SingularSDK.TrackingOptIn Method | |
---|---|
Description | Notify Singular of user consent (opt-in) for tracking. |
Usage Example |
|
SingularSDK.StopAllTracking Method | |
Description | Stop all tracking activities for this user on this app. Note: Calling this method effectively disables the SDK, even after the app restarts (the state is persistent)! The only way to re-enable tracking is by calling resumeAllTracking().
|
Usage Example |
|
SingularSDK.ResumeAllTracking Method | |
Description | Resume tracking for this user on this app. |
Usage Example |
|
SingularSDK.IsAllTrackingStopped Method | |
Description | Check the tracking status for this user on this app. Returns true if tracking has been stopped using StopAllTracking() and not resumed. |
Usage Example |
|