Skip to main content

SDK analytics

The Atomic SDKs capture analytics events relating to user activity. These analytics events are sent back to the Atomic Platform, and include a userId field. The userId is extracted from the JWT you provide to the SDK; a JWT is requested from your app before each analytics event is created and queued.

JWTs are requested from your app using:

  • AACSessionDelegate on iOS, Android and Flutter,
  • the authToken property on React Native;
  • the onAuthTokenRequested callback on Web and Cordova.

The userId field corresponds to the sub or atomic_sub field within your JWT.

The sending of analytics by the SDKs, back to the Platform, happens in the background, provided that the Atomic SDK has been initialized with an API base URL, environment ID and API key, and your app containing the SDK is running. You can find details on how to initialize these values in the corresponding SDK documentation:

Analytics are batched and sent in the background every 30 seconds. If there are no events to send, nothing will happen.

If analytics events cannot be sent back to the Platform - either because the user does not have a network connection, or an API error occurs - they are retained for the next 30 second interval. On this next 30 second interval, another attempt is made to send any available analytics events.

If analytics events remain unsent when the user terminates your app (iOS, Android, React Native, Flutter, Cordova), or when the browser tab is closed (Web), they are not lost. They will remain in an on-disk cache until they are successfully sent. Once your app with the Atomic SDK embedded starts up again, the 30 second timer will re-activate, attempting to send any saved analytics events back to the Platform. Once events are successfully sent, they are removed from the on-disk cache.