Please note that this article is an in-depth dive and its intention is to help developers understand architecture relating to Apptimize project configuration and user enrollment. If you have any questions or would like to schedule an Engineering Best Practices training with our team, please reach out to us at email@example.com
Metadata is the experiment information file comprised of your Apptimize Dashboard configurations; it is a file that is downloaded on all end-user devices. It is not device-specific and for any one application, there is only one version of metadata. The metadata contains enough information for the SDK to calculate the enrollment of a user locally for all active projects (A/B tests, feature flags, instant updates). The file itself is a relatively small (<10KB) JSON file.
Since metadata processing happens client-side, enrollment can be adjusted immediately in reaction to changes in device state and/or custom attributes. This also reduces the number of network calls required by the SDK.
How is metadata downloaded?
- The first time Apptimize is initialized on a device it will prompt a request for downloading metadata from our CDN.
- The SDK will then poll periodically to check for metadata updates:
- Every 10 minutes while the app is in the foreground
- Once every 24 hours when the app is backgrounded
- Metadata is requested from a CDN when lower latency is more likely to be helpful. Otherwise it’s requested directly from Apptimize’s own servers.
What if the download fails? The SDK will continue to use the last successfully downloaded metadata. If there is none, the device isn’t enrolled into anything and the user would see the baseline experience.
How are users bucketed?
- The metadata contains all of the information needed for the Apptimize SDK to deliver the experiment as well as the range groups that can be used to determine the enrollment for the device.
- Given the targeting filters and allocation percentage for an A/B experiment, feature flag, or instant update, we calculate range groups for each of the variants or features locally.
- Once Apptimize is initialized, the SDK calculates a seed using either an anonymous ID (device-specific) or user ID which can fall anywhere in a fixed range of values. The enrollment is determined based on which range group this seed falls into for each project.