For the complete documentation index, see llms.txt.

Set up Product Analytics data capture

This page instructs how to set up Product Analytics data capture in combination with Experience Analytics.

  1. Configure and start the SDK with CSQ.start().

    AppDelegate.swift
    import UIKit
    import ContentsquareSDK
    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // ...
    CSQ.start(
    environmentID: "YOUR_ENVIRONMENT_ID"
    )
    }
    }
  2. Enable autocapture with .enableNativeAutocapture = true.

    AppDelegate.swift
    import UIKit
    import ContentsquareSDK
    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // ...
    CSQ.start(
    environmentID: "YOUR_ENVIRONMENT_ID",
    options: [
    .enableNativeAutocapture: true
    ]
    )
    }
    }
  3. (Optional) If your Product Analytics environment is hosted in the EU, set the baseURL option to "https://mh.ba.contentsquare.net".

    CSQ.start(
    environmentID: "YOUR_ENVIRONMENT_ID",
    options: [
    .baseURL: "https://mh.ba.contentsquare.net"
    ]
    )
  4. Add .disablePageviewAutocapture = true.

    AppDelegate.swift
    import UIKit
    import ContentsquareSDK
    @UIApplicationMain
    class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // ...
    CSQ.start(
    environmentID: "YOUR_ENVIRONMENT_ID",
    options: [
    .enableNativeAutocapture: true,
    .disablePageviewAutocapture: true
    ]
    )
    }
    }