SlideShare ist ein Scribd-Unternehmen logo
1 von 45
A/B Testing in Android
Nir Hartmann
Drippler
Droidcon Tel-Aviv 2014
Why do we need A/B Testing?
• Tests takes the guesswork out
• Enables data-backed decisions
• Enhances engagement and retention
Road map
• What is an A/B test ?
• Segmentation
• Multiple Experiments
What is A/B Test ?
• Case study – onboarding screen
Define the test
• Hypothesis – The layout with the Google+ button at
the left will increase the number of total registered
users
• Goal – A registered user (the user can skip
registration)
• View event
- Login fragment onCreate(), setRetainInstance(true)
- Login activity onCreate(), null savedInstanceState
• Variables – Facebook button position (left or right)
• Participants – New users
Amazon A/B Testing SDK
Like Android:
• Very customizable, you can do just about anything as
long as you know what it is you want to do
• It’s free
• Drippler created an open source library that simplify
the process
Setup the A/B test
• Setup identifier
– https://developer.amazon.com/al/index.html
Setup the A/B test
• Create a project
Setup the A/B test
• Create the test
Dive into the code
• https://github.com/Drippler/ABTester
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
ABTester.init(getApplicationContext(),
"my_public_key", "my_private_key");
}
}
private void initLoginActivityTest() {
try {
ABTester.syncPreFetch(
TimeUnit.SECONDS.toMillis(15),
new ABTest("Login page test", false, "Facebook is
first”) );
} catch (TimeoutException e) {
// Couldn't reach amazon servers
}
}
Fetch the test
Login Fragment
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
ABTester.recordEvent(
"Login fragment shown",
false);
}
Login Fragment
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
boolean shouldShowFacebookFirst =
ABTester.getBoolean("Login page test", "Facebook is
first", false);
if (shouldShowFacebookFirst)
return inflater.inflate(R.layout. facebook_first, null);
else
return inflater.inflate(R.layout. google_first, null);
}
Report goal event
public void onUserLoggedIn() {
ABTester.recordEvent("Sign in", false);
}
@Override
protected void onPause() {
super.onPause();
/* Submit the events that were previously stored locally.
* asynchronously
* call it in the onPause() method of an activity */
ABTester.submitEvents();
}
Analyze the results
Variation Views Conversions Conversion
rate
Change
Google+
first
1064 320 30.08%
Facebook
first
1043 250 23.97% -20.30%
Dice experiment
Goal: maximize the amount of 3’s we get in a 100
dice roll
Dice experiment
Hypothesis: wearing a hat will increase the
chance to roll a 3
Analyze the results
Variation Views Conversions Conversion
rate
Change
Hat off 100 31 31.00%
Hat on 100 38 38.00% +22.58%
Conversion is never a single number.
Confidence level
• Measure the reliability of an estimate
– The confidence levels help us understand if the
results are different merely by chance or by
reason
• 95% confidence level is considered good
Analyze the results
Variation Views Conversions Conversion
rate
Change
Google
First
1064 320 30.08% ±
2.32%
Facebook
First
1043 250 23.97% ±
2.18%
-20.30%
• Confidence level of 99%
Analyze the results
https://developer.amazon.com/public/apis/manage/ab-
testing/doc/math-behind-ab-testing
Choose the best variation
• Launch
– Choose the winning variation
– Control the percentage of customers that receive
a new feature
Road map
• What is an A/B test ?
• Segmentation
• Multiple Experiments
Segmentation
Define the test
• Hypothesis – Coloring the “Rate” button, will
increase the button’s click rate
• Goal – Click event on the “Rate” button
• View event – RateUsDialogFragment show();
• Variables – “Rate” button color
• Participants – All users
Create the test
Rate us DialogFragment
public class RateUsDialog extends DialogFragment {
public static void show(FragmentManager fm,
int color) {
RateUsDialog rateUs = new RateUsDialog();
Bundle extras = new Bundle();
extras.putInt(“color”, color);
rateUs.setArguments(extras);
rateUs.show(fm, “my tag”);
ABTester.recordEvent("Rate us dialog shown", false);
}
Rate us DialogFragment
@Override
public Dialog onCreateDialog(Bundle
savedInstanceState) {
int color = getArguments().getInt("color");
return createColoredDialog(color);
}
Rate us DialogFragment
private Dialog createColoredDialog(int color) {
...
.setPositiveButton("Rate", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int
which) {
ABTester.recordEvent("Rate button click", false);
}
});
return myDialog;
Rate us test
1) Asynchronously prefetching SplashActivity
Default timeout is 60 seconds, and can be overriden by
using preFetch(long timeout, ABTest... Test)
ABTester.preFetch(
new ABTest("Rate us test", false, "Rate button color")
);
Rate us test
2) Show the dialog
String fetchedColor = ABTester.getString(
"Rate us test", "Rate button color", "#F5F5F5");
int color = Color.parseColor(fetchedColor);
RateUsDialog.show(getFragmentManager(), color);
3) Submitting the results onPause()
ABTester.submitEvents();
Analyze the results
Variation Views Conversions Conversion rate Change Confidence
Control
(white)
865 234
27.05%
± 1.51%
Variation
A (green)
904 250
27.65%
± 1.49%
-0.2%
Variation
B (red) 830 230
27.71%
± 1.55% +2.4% 51%
What can I do with these results?
Segmentation
Variation Views Conversions Conversion rate Change Confidence
Control
(white)
432 92 21.30% ± 1.97%
Variation A
(green)
464 165 35.56% ± 2.22% +66.9% 98.7%
Variation B
(red)
420 120 28.57% ± 2.20%
+34.1%
Variation Views Conversions Conversion rate Change Confidence
Control
(white)
433 142 32.79% ± 2.26% +22.2% 97.1%
Variation A
(green)
440 85 19.32% ± 1.88% -27.9%
Variation B
(red)
410 110 26.83% ± 2.19% -18.8%
Under 40
Over 40
Define the test
• Hypothesis – Coloring the “Rate” button, will
increase the button click rate
• Goal – Click event on the “Rate” button
• View event – RateUsDialogFragment show();
• Variables – “Rate” button color
• Participants – All users
Define the test
• Hypothesis – Coloring the “Rate” button, will
increase the button click rate
• Goal – Click event on the “Rate” button
• View event – RateUsDialogFragment show();
• Variables – “Rate” button color
• Participants – Age specific tests
Setup the A/B test
• Create a segment
Create the segment
Assign the segment
• In your code before the fetch
– ABTester.addDimension(”age", myAge);
• Dimension will not change during the
experiment
• ABTester library will automatically add a
“percentile” dimension
– ABTester.addDimension(“percentile”,
new Random().nextInt(100));
Road map
• What is an A/B test ?
• Segmentation
• Multiple Experiments
Multiple Experiments
Multiple Experiments
Multiple Experiments
• Serial tests
– Run the tests one after the other, without the
need to redistribute your app
– More accurate but takes more time
ABTester.preFetch(
new ABTest("Rate us test", false, "Rate button
color", "Rate actionbar icon")
);
Multiple Experiments
• Parallel tests
– Run the tests together, increasing the ‘noise’ for
dependent tests
– Faster
ABTester.preFetch(
new ABTest("Rate us button", false,
"Rate button color”)
new ABTest("Rate us actionbar", false,
"Rate button icon”)
);
Not a replacement for common sense
Thanks, any questions ?
Don’t overthink it, use Drippler’s A/B test library
https://github.com/Drippler/ABTester
Nir Hartmann, nhartmann@drippler.com
Drippler
Droidcon Tel-Aviv 2014

Weitere ähnliche Inhalte

Mehr von DroidConTLV

No more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsNo more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsDroidConTLV
 
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.comMobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.comDroidConTLV
 
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellLiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellDroidConTLV
 
MVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, LightricksMVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, LightricksDroidConTLV
 
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)DroidConTLV
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaDroidConTLV
 
New Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy ZukanovNew Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy ZukanovDroidConTLV
 
Designing a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, GettDesigning a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, GettDroidConTLV
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperDroidConTLV
 
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevKotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevDroidConTLV
 
Flutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, TikalFlutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, TikalDroidConTLV
 
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisReactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisDroidConTLV
 
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevelFun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevelDroidConTLV
 
DroidconTLV 2019
DroidconTLV 2019DroidconTLV 2019
DroidconTLV 2019DroidConTLV
 
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, MondayOk google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, MondayDroidConTLV
 
Introduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, WixIntroduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, WixDroidConTLV
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneDroidConTLV
 
Educating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirEducating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirDroidConTLV
 
Constraint-ly motion - making your app dance - John Hoford, Google
Constraint-ly motion - making your app dance - John Hoford, GoogleConstraint-ly motion - making your app dance - John Hoford, Google
Constraint-ly motion - making your app dance - John Hoford, GoogleDroidConTLV
 
Who needs MVVM? Architecture components & MVP - Timor Surkis, Colu
Who needs MVVM? Architecture components & MVP - Timor Surkis, ColuWho needs MVVM? Architecture components & MVP - Timor Surkis, Colu
Who needs MVVM? Architecture components & MVP - Timor Surkis, ColuDroidConTLV
 

Mehr von DroidConTLV (20)

No more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola SolutionsNo more video loss - Alex Rivkin, Motorola Solutions
No more video loss - Alex Rivkin, Motorola Solutions
 
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.comMobile at Scale: from startup to a big company - Dor Samet, Booking.com
Mobile at Scale: from startup to a big company - Dor Samet, Booking.com
 
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, ClimacellLiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
LiveData on Steroids - Giora Shevach + Shahar Ben Moshe, Climacell
 
MVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, LightricksMVVM In real life - Lea Cohen Tannoudji, Lightricks
MVVM In real life - Lea Cohen Tannoudji, Lightricks
 
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
Best Practices for Using Mobile SDKs - Lilach Wagner, SafeDK (AppLovin)
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
 
New Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy ZukanovNew Android Project: The Most Important Decisions - Vasiliy Zukanov
New Android Project: The Most Important Decisions - Vasiliy Zukanov
 
Designing a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, GettDesigning a Design System - Shai Mishali, Gett
Designing a Design System - Shai Mishali, Gett
 
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, PepperThe Mighty Power of the Accessibility Service - Guy Griv, Pepper
The Mighty Power of the Accessibility Service - Guy Griv, Pepper
 
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDevKotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
Kotlin Multiplatform in Action - Alexandr Pogrebnyak - IceRockDev
 
Flutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, TikalFlutter State Management - Moti Bartov, Tikal
Flutter State Management - Moti Bartov, Tikal
 
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bisReactive UI in android - Gil Goldzweig Goldbaum, 10bis
Reactive UI in android - Gil Goldzweig Goldbaum, 10bis
 
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevelFun with flutter animations - Divyanshu Bhargava, GoHighLevel
Fun with flutter animations - Divyanshu Bhargava, GoHighLevel
 
DroidconTLV 2019
DroidconTLV 2019DroidconTLV 2019
DroidconTLV 2019
 
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, MondayOk google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
Ok google, it's time to bot! - Hadar Franco, Albert + Stav Levi, Monday
 
Introduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, WixIntroduction to React Native - Lev Vidrak, Wix
Introduction to React Native - Lev Vidrak, Wix
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
 
Educating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz TamirEducating your app – adding ML edge to your apps - Maoz Tamir
Educating your app – adding ML edge to your apps - Maoz Tamir
 
Constraint-ly motion - making your app dance - John Hoford, Google
Constraint-ly motion - making your app dance - John Hoford, GoogleConstraint-ly motion - making your app dance - John Hoford, Google
Constraint-ly motion - making your app dance - John Hoford, Google
 
Who needs MVVM? Architecture components & MVP - Timor Surkis, Colu
Who needs MVVM? Architecture components & MVP - Timor Surkis, ColuWho needs MVVM? Architecture components & MVP - Timor Surkis, Colu
Who needs MVVM? Architecture components & MVP - Timor Surkis, Colu
 

Kürzlich hochgeladen

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 

Kürzlich hochgeladen (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 

Free A/B testing for Android platform

  • 1. A/B Testing in Android Nir Hartmann Drippler Droidcon Tel-Aviv 2014
  • 2. Why do we need A/B Testing? • Tests takes the guesswork out • Enables data-backed decisions • Enhances engagement and retention
  • 3. Road map • What is an A/B test ? • Segmentation • Multiple Experiments
  • 4. What is A/B Test ? • Case study – onboarding screen
  • 5. Define the test • Hypothesis – The layout with the Google+ button at the left will increase the number of total registered users • Goal – A registered user (the user can skip registration) • View event - Login fragment onCreate(), setRetainInstance(true) - Login activity onCreate(), null savedInstanceState • Variables – Facebook button position (left or right) • Participants – New users
  • 6. Amazon A/B Testing SDK Like Android: • Very customizable, you can do just about anything as long as you know what it is you want to do • It’s free • Drippler created an open source library that simplify the process
  • 7. Setup the A/B test • Setup identifier – https://developer.amazon.com/al/index.html
  • 8. Setup the A/B test • Create a project
  • 9. Setup the A/B test • Create the test
  • 10. Dive into the code • https://github.com/Drippler/ABTester public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); ABTester.init(getApplicationContext(), "my_public_key", "my_private_key"); } }
  • 11. private void initLoginActivityTest() { try { ABTester.syncPreFetch( TimeUnit.SECONDS.toMillis(15), new ABTest("Login page test", false, "Facebook is first”) ); } catch (TimeoutException e) { // Couldn't reach amazon servers } } Fetch the test
  • 12. Login Fragment @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); ABTester.recordEvent( "Login fragment shown", false); }
  • 13. Login Fragment @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { boolean shouldShowFacebookFirst = ABTester.getBoolean("Login page test", "Facebook is first", false); if (shouldShowFacebookFirst) return inflater.inflate(R.layout. facebook_first, null); else return inflater.inflate(R.layout. google_first, null); }
  • 14. Report goal event public void onUserLoggedIn() { ABTester.recordEvent("Sign in", false); } @Override protected void onPause() { super.onPause(); /* Submit the events that were previously stored locally. * asynchronously * call it in the onPause() method of an activity */ ABTester.submitEvents(); }
  • 15. Analyze the results Variation Views Conversions Conversion rate Change Google+ first 1064 320 30.08% Facebook first 1043 250 23.97% -20.30%
  • 16. Dice experiment Goal: maximize the amount of 3’s we get in a 100 dice roll
  • 17. Dice experiment Hypothesis: wearing a hat will increase the chance to roll a 3
  • 18. Analyze the results Variation Views Conversions Conversion rate Change Hat off 100 31 31.00% Hat on 100 38 38.00% +22.58% Conversion is never a single number.
  • 19. Confidence level • Measure the reliability of an estimate – The confidence levels help us understand if the results are different merely by chance or by reason • 95% confidence level is considered good
  • 20. Analyze the results Variation Views Conversions Conversion rate Change Google First 1064 320 30.08% ± 2.32% Facebook First 1043 250 23.97% ± 2.18% -20.30% • Confidence level of 99%
  • 22. Choose the best variation • Launch – Choose the winning variation – Control the percentage of customers that receive a new feature
  • 23. Road map • What is an A/B test ? • Segmentation • Multiple Experiments
  • 25. Define the test • Hypothesis – Coloring the “Rate” button, will increase the button’s click rate • Goal – Click event on the “Rate” button • View event – RateUsDialogFragment show(); • Variables – “Rate” button color • Participants – All users
  • 27. Rate us DialogFragment public class RateUsDialog extends DialogFragment { public static void show(FragmentManager fm, int color) { RateUsDialog rateUs = new RateUsDialog(); Bundle extras = new Bundle(); extras.putInt(“color”, color); rateUs.setArguments(extras); rateUs.show(fm, “my tag”); ABTester.recordEvent("Rate us dialog shown", false); }
  • 28. Rate us DialogFragment @Override public Dialog onCreateDialog(Bundle savedInstanceState) { int color = getArguments().getInt("color"); return createColoredDialog(color); }
  • 29. Rate us DialogFragment private Dialog createColoredDialog(int color) { ... .setPositiveButton("Rate", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ABTester.recordEvent("Rate button click", false); } }); return myDialog;
  • 30. Rate us test 1) Asynchronously prefetching SplashActivity Default timeout is 60 seconds, and can be overriden by using preFetch(long timeout, ABTest... Test) ABTester.preFetch( new ABTest("Rate us test", false, "Rate button color") );
  • 31. Rate us test 2) Show the dialog String fetchedColor = ABTester.getString( "Rate us test", "Rate button color", "#F5F5F5"); int color = Color.parseColor(fetchedColor); RateUsDialog.show(getFragmentManager(), color); 3) Submitting the results onPause() ABTester.submitEvents();
  • 32. Analyze the results Variation Views Conversions Conversion rate Change Confidence Control (white) 865 234 27.05% ± 1.51% Variation A (green) 904 250 27.65% ± 1.49% -0.2% Variation B (red) 830 230 27.71% ± 1.55% +2.4% 51% What can I do with these results?
  • 33. Segmentation Variation Views Conversions Conversion rate Change Confidence Control (white) 432 92 21.30% ± 1.97% Variation A (green) 464 165 35.56% ± 2.22% +66.9% 98.7% Variation B (red) 420 120 28.57% ± 2.20% +34.1% Variation Views Conversions Conversion rate Change Confidence Control (white) 433 142 32.79% ± 2.26% +22.2% 97.1% Variation A (green) 440 85 19.32% ± 1.88% -27.9% Variation B (red) 410 110 26.83% ± 2.19% -18.8% Under 40 Over 40
  • 34. Define the test • Hypothesis – Coloring the “Rate” button, will increase the button click rate • Goal – Click event on the “Rate” button • View event – RateUsDialogFragment show(); • Variables – “Rate” button color • Participants – All users
  • 35. Define the test • Hypothesis – Coloring the “Rate” button, will increase the button click rate • Goal – Click event on the “Rate” button • View event – RateUsDialogFragment show(); • Variables – “Rate” button color • Participants – Age specific tests
  • 36. Setup the A/B test • Create a segment
  • 38. Assign the segment • In your code before the fetch – ABTester.addDimension(”age", myAge); • Dimension will not change during the experiment • ABTester library will automatically add a “percentile” dimension – ABTester.addDimension(“percentile”, new Random().nextInt(100));
  • 39. Road map • What is an A/B test ? • Segmentation • Multiple Experiments
  • 42. Multiple Experiments • Serial tests – Run the tests one after the other, without the need to redistribute your app – More accurate but takes more time ABTester.preFetch( new ABTest("Rate us test", false, "Rate button color", "Rate actionbar icon") );
  • 43. Multiple Experiments • Parallel tests – Run the tests together, increasing the ‘noise’ for dependent tests – Faster ABTester.preFetch( new ABTest("Rate us button", false, "Rate button color”) new ABTest("Rate us actionbar", false, "Rate button icon”) );
  • 44. Not a replacement for common sense
  • 45. Thanks, any questions ? Don’t overthink it, use Drippler’s A/B test library https://github.com/Drippler/ABTester Nir Hartmann, nhartmann@drippler.com Drippler Droidcon Tel-Aviv 2014