Autocapture

open class Autocapture

Access to autocapture tracking methods, available as an accessible variable from the main Mixpanel instance.

Warning

Experimental (beta). Autocapture may contain issues, and its API and the properties it captures may change in a future release before general availability.
  • Track a screen view event. This is a convenience method for tracking when users view a screen/page in your application.

    Declaration

    Swift

    open func trackScreenView(screenName: String, properties: Properties? = nil)

    Parameters

    screenName

    The name of the screen/page being viewed. Must be non-empty; if an empty or whitespace-only string is passed, the event is silently dropped.

    properties

    Optional properties to include with this event

  • Track a screen leave event. This is a convenience method for tracking when users leave a screen/page in your application.

    Declaration

    Swift

    open func trackScreenLeave(screenName: String, properties: Properties? = nil)

    Parameters

    screenName

    The name of the screen/page being left. Must be non-empty; if an empty or whitespace-only string is passed, the event is silently dropped.

    properties

    Optional properties to include with this event

Click Tracking

  • Track a click event from a ClickEvent object. Use this for full control over click metadata when your app handles its own click detection.

    Declaration

    Swift

    open func trackClick(_ clickEvent: ClickEvent, properties: Properties? = nil)

    Parameters

    clickEvent

    The click event containing element metadata

    properties

    Optional additional properties to include with this event

  • Track a rage click event from a ClickEvent object. Use this for full control over click metadata when your app handles its own rage click detection.

    Declaration

    Swift

    open func trackRageClick(_ clickEvent: ClickEvent, properties: Properties? = nil)

    Parameters

    clickEvent

    The click event containing element metadata

    properties

    Optional additional properties to include with this event

  • Track a dead click event from a ClickEvent object. Use this for full control over click metadata when your app handles its own dead click detection.

    Declaration

    Swift

    open func trackDeadClick(_ clickEvent: ClickEvent, properties: Properties? = nil)

    Parameters

    clickEvent

    The click event containing element metadata

    properties

    Optional additional properties to include with this event