Zendesk analytics tracking
Introduction
Starting with version 2.36.0, we collect anonymous data on end user interactions to help us improve the overall user experience. This includes anonymous interface interactions such as button clicks and other engagement events.
To support user journey analysis, we also gather a unique session identifier (SUID) that enables event tracking while keeping the user's identity anonymous.
Zendesk analytics tracking is enabled by default in the SDK. However, it can be disabled in the following ways:
During SDK initialization
Set enableInternalAnalytics(enabled:) to false in the completionHandler when initializing the SDK to disable Zendesk analytics tracking.
Zendesk.initialize(withChannelKey: "<your_channel_key>",messagingFactory: DefaultMessagingFactory()) { result inswitch result {case .success(let zendesk):// Handle success case// Disable Zendesk analytics, enabled by defaultZendesk.instance?.messaging?.enableInternalAnalytics(enabled: false)case .failure(let error):// Handle failure case}}
After SDK initialization
You can enable/disable analytics at any point during the app user journey after the SDK initialization (for example, when opening the SDK) by calling:
func showMessaging() {// Disable Zendesk analytics, enabled by defaultZendesk.instance?.messaging?.enableInternalAnalytics(enabled: false)let viewController = Zendesk.instance?.messaging?.messagingViewController()// Present the view controller}
Demo App
You can find a demo app showcasing this feature in our Zendesk SDK Demo app github.