diff --git a/Sources/Analytics/Analytics.docc/user-consent-article.md b/Sources/Analytics/Analytics.docc/user-consent-article.md index 60346d649..98f89cef2 100644 --- a/Sources/Analytics/Analytics.docc/user-consent-article.md +++ b/Sources/Analytics/Analytics.docc/user-consent-article.md @@ -61,3 +61,25 @@ extension AppDelegate: AnalyticsDataSource { In the example above user consent has been hardcoded but a real implementation should check local user consent data to provide parameters matching the current user choices. > Warning: ``AnalyticsDataSource`` methods are called with each event sent. Your implementation should therefore be as efficient as possible. + +### Setup an analytics delegate + +If you want to hook to analytics events to potential track something else like google analytics or blabla or blabla you can do like so: + +```swift +final class AppDelegate: NSObject, UIApplicationDelegate { + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let configuration = Analytics.Configuration( + vendor: .SRF, + sourceKey: .productionSourceKey, + appSiteName: "app-site-name" + ) + try? Analytics.shared.start(with: configuration, delegate: self) + + // ... + } +} +```