Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A/B Testing Android Apps with Firebase

A/B Testing Android Apps with Firebase

There are a lot of decisions developers need to make when developing an app, such as: selecting the best color for a button, how often an ad will be shown or how fast the protagonist of our game should run. While these might seem like small changes, they can make a huge influence on your app’s success when put together.

In this talk, Rosário will show you how to run A/B tests using Firebase, how to interpret the test results and the recommended actions to take based on those results.

Expect to come out of the session with knowledge on how Firebase Remote Config integrates with Google Analytics for Firebase to help you make better decisions for your app’s success.

Rosário Pereira Fernandes

November 18, 2020
Tweet

More Decks by Rosário Pereira Fernandes

Other Decks in Programming

Transcript

  1. Half screen photo slide if text is necessary About Me

    • From Mozambique • Firebase GDE • Android Developer • Organizer at GDG Maputo • Writes technical blog posts • Open Source Contributor • Loves video games
  2. Testing changes Make changes periodically? Sign up for free Register

    for more Register for free Week 1 Week 5 Week 3
  3. Testing changes A/B groups Sign up for free Register for

    more Register for free All users Group B Group A
  4. // Import the Firebase BoM implementation platform('com.google.firebase:firebase-bom:26.1.0') // When using

    the BoM, you don't specify versions in Firebase library dependencies // Declare the dependency for the Firebase SDK for Remote Config implementation 'com.google.firebase:firebase-config-ktx' // Declare the dependency for the Firebase SDK for Google Analytics implementation 'com.google.firebase:firebase-analytics-ktx' Add Remote Config to your app
  5. <?xml version="1.0" encoding="utf-8"?> <defaultsMap> <entry> <key>button_label</key> <value>Sign Up for Free</value>

    </entry> <entry> <key>button_color</key> <value>#0000FF</value> </entry> </defaultsMap> // In Kotlin Firebase.remoteConfig.setDefaultsAsync(R.xml.default_values) // fetch values from the server remoteConfig.fetchAndActivate()
  6. // On our Fragment/Activity val remoteConfig = Firebase.remoteConfig val label:

    String = remoteConfig.getString(“button_label”) val color: String = remoteConfig.getString(“button_color”) button.setText(label) button.setBackgroundColor(Color.parseColor(color))
  7. // On our Fragment/Activity button.setOnClickListener { Firebase.analytics.logEvent(“sign_up_started”) { // optional

    params here } } auth.setOnSignUpFinished { Firebase.analytics.logEvent(“sign_up_finished”) { // optional params here } }
  8. // Testing our variants // Get the installation token FirebaseInstallations.getInstance().getToken(false)

    .addOnSuccessListener { task -> if (task.isSuccessful) { Log.d(“ABtest”, “ID: ${task.result!!.token}”) // ijKJddsjasbdjBDJBjdaknsdjN } } // Enable Debug Mode // Dont use this in production val configSettings = remoteConfigSettings { minimumFetchIntervalInSeconds = 0 } Firebase.remoteConfig.setConfigSettingsAsync(configSettings)