Client SDKs
Privacy Controls
Allow users to opt out of analytics
The SDK provides controls that customers can use when implementing privacy preferences. The control is one part of a compliant implementation; it does not determine the correct consent, disclosure, retention, or legal basis by itself.
Toggle Data Collection
Allow users to opt out of analytics:
// Disable data collection
AudiencelabSDK.ToggleMetricsCollection(false);
// Re-enable data collection
AudiencelabSDK.ToggleMetricsCollection(true);
// Check current status
bool isEnabled = AudiencelabSDK.GetIsMetricsCollection();Behavior When Disabled
When data collection is disabled:
- Events are dropped instead of being sent
- No network requests are made to Audiencelab servers
- When re-enabled, events are sent normally
Implementation Example
// In your settings UI
public void OnPrivacyToggleChanged(bool isEnabled)
{
AudiencelabSDK.ToggleMetricsCollection(isEnabled);
// Save user preference
PlayerPrefs.SetInt("AnalyticsEnabled", isEnabled ? 1 : 0);
PlayerPrefs.Save();
}
// On app start, restore user preference
void Start()
{
bool analyticsEnabled = PlayerPrefs.GetInt("AnalyticsEnabled", 1) == 1;
AudiencelabSDK.ToggleMetricsCollection(analyticsEnabled);
}Required-reason API ownership
This host-project example stores the preference with Unity PlayerPrefs.
The Audiencelab SDK does not directly invoke Apple's UserDefaults or another
required-reason API. PlayerPrefs is Unity's abstraction; Unity owns the underlying UserDefaults access and
provides its declaration in the Unity Engine privacy manifest. No additional
required-reason API declaration is needed for the Audiencelab SDK itself.
Review customer code and other embedded SDKs separately.