Building funnels with event tracking

Track user actions with Onside.track and build funnels over these events.

Attribution answers “where did the user come from?”.

See Attribution.

Event tracking answers “what did the user do next?”.

Use Onside.track(_:parameters:) to log user actions. You can then build funnels over these events.

API

Onside.track(
    _ event: OnsideEvent,
    parameters: [OnsideEventParameter: OnsideEventParameterValue]
)

Pass parameters: [:] if you do not need any metadata.

Events

OnsideEvent ships with a set of common event constants. You can also send any custom event name.

  • Use .levelAchieved, .purchaseCompleted, .registrationCompleted, and other predefined cases when they match your action.

  • Use .custom("...") or a string literal for everything else.

OnsideEvent is ExpressibleByStringLiteral, so this works:

Onside.track("my_custom_event", parameters: [:])
chevron-rightFull list of predefined OnsideEvent caseshashtag
public enum OnsideEvent: Sendable, ExpressibleByStringLiteral {
    case levelAchieved
    case purchaseCompleted
    case registrationCompleted
    case tutorialCompleted
    case subscriptionStarted
    case subscriptionRenewed
    case subscriptionCancelled
    case profileUpdated
    case contentViewed
    case contentShared
    case searchPerformed
    case addedToCart
    case checkoutStarted
    case paymentInfoEntered
    case custom(String)
}

Parameters

OnsideEventParameter is the key type for event metadata.

It behaves like events:

  • It includes a prepared set of common parameter keys.

  • It does not limit your API. You can always use a custom key.

  • It is ExpressibleByStringLiteral.

OnsideEventParameterValue supports:

  • String, Double, Int, Bool

  • arrays of these types

chevron-rightFull list of predefined OnsideEventParameter keyshashtag
circle-exclamation

Example

Last updated

Was this helpful?