Swift SDK Version

App Events

  • Represents a name of the Facebook Analytics application event. Could either be one of built-in names or a custom String.
    Seealso
    AppEvent
    Seealso
    AppEventLoggable
    See more

    Declaration

    Swift
    publicenumAppEventName
  • Client-side event logging for specialized application analytics available through Facebook App Insights and for use with Facebook Ads conversion tracking and optimization.
    The AppEventsLogger static class has a few related roles:
    • Logging predefined and application-defined events to Facebook App Insights with a numeric value to sum across a large number of events, and an optional set of key/value parameters that define segments for this event (e.g., ‘purchaserStatus’ : ‘frequent’, or ‘gamerLevel’ : ‘intermediate’)
    • Logging events to later be used for ads optimization around lifetime value.
    • Methods that control the way in which events are flushed out to the Facebook servers.
    Here are some important characteristics of the logging mechanism provided by AppEventsLogger:
    • Events are not sent immediately when logged. They’re cached and flushed out to the Facebook servers in a number of situations:
    • when an event count threshold is passed (currently 100 logged events).
    • when a time threshold is passed (currently 15 seconds).
    • when an app has gone to background and is then brought back to the foreground.
    • Events will be accumulated when the app is in a disconnected state, and sent when the connection is restored and one of the above ‘flush’ conditions are met.
    • The AppEventsLogger class is thread-safe in that events may be logged from any of the app’s threads.
    • The developer can set the flushBehavior to force the flushing of events to only occur on an explicit call to the flush method.
    • The developer can turn on console debug output for event logging and flushing to the server by using the FBSDKLoggingBehaviorAppEvents value in [FBSettings setLoggingBehavior:].
    Some things to note when logging events:
    • There is a limit on the number of unique event names an app can use, on the order of 1000.
    • There is a limit to the number of unique parameter names in the provided parameters that can be used per event, on the order of 25. This is not just for an individual call, but for all invocations for that eventName.
    • Event names and parameter names (the keys in the Dictionary) must be between 2 and 40 characters, and must consist of alphanumeric characters, _, -, or spaces.
    • The length of each parameter value can be no more than on the order of 100 characters.
    See more

    Declaration

    Swift
    publicclassAppEventsLogger