Firebase

Firebase is a platform developed by Google and has its own analytics framework (FIRAnalytics). Apptimize integrates with Firebase by automatically importing the following for iOS and Android:

  • Events

  • User ID

  • User Properties

You are also able to use the Apptimize TestInfo API and our participation callbacks to forward your experiment data to Firebase. Please see our data export guidelines for more information on how to set this up.

Automatic Event Importing

Apptimize detects Firebase Events declared with logEventWithName and automatically imports them for use as Goals within your Apptimize Experiments. Apptimize does not support Event Properties so please note that your events will only be imported with their names.

In order for the import to take place, you will first need to trigger your events in a live experiment. We recommend first running an A/A test in your app so that you can successfully have all existing events triggered, without affecting your end-users. Once experiment results are processed in your A/A test, you will see your Firebase Events listed as possible goals for use in your future experiments.

Firebase Events that have been automatically imported from Firebase will appear with the prefix “fb:” in your Goals.

Automatic User ID and Properties Importing

Apptimize automatically imports your Firebase User ID and User Properties and allows you to Target with them in your Apptimize Experiments.

To have User Properties to be available for your targeting, you simply need to fire an event or reach a screen in the app that utilizes your User ID or Properties while your device is paired with the Apptimize Dashboard. To pair with the Dashboard, you will need to open our Preview Variants tool, which will mirror your active device. Once you trigger or navigate to the screen where you’ve called setUserID and/or setUserPropertyString, Apptimize will detect these attributes and automatically import them for use. You should also be able to see the property fire on the left-hand side of the Preview window.

Once you have successfully paired and triggered your events, you will see your User ID/Properties as selectable options in the Target & Launch filter dropdown. You will also be able to filter by your User Properties in your experiment’s Results.

If there are additional user properties (outside of those identified with Firebase) that you would like to target with, please manually set these properties with our Custom Attributes.

Exporting Experiment Data to Firebase

Apptimize maintains a TestInfo API which can be used to export Apptimize experiment results data to Firebase. Here are links to the documentation of this API:

Calling TestInfo will return a map of the following info for all actively running tests:

  • Experiment Name

  • Variant Name

  • Experiment ID

  • Variant ID

  • Enrollment in Experiment Date

  • Start Experiment Date

  • User has Participated since Enrollment

This data provides comprehensive detail around the user’s experiment participation, and can be parsed and/or passed along to firebase or any other third party as you please.

As an example, your output might look like:

testinfo: {
 "New Experiment" = "Variant \"original\" (157581) of test \"New Experiment\" (11452),
 enrolled since 2015-06-06 01:15:56 +0000 (started on 2015-06-06 00:47:15 +0000)";

For additional details and sample implementation, please see our Data Export documentation page.