An introduction to A/B testing using a Google Optimize example
Juan M. Fonseca-Sol´ ıs
https://juanfonsecasolis.github.com
March 1, 2020
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 1 / 36
An introduction to A/B testing using a Google Optimize example Juan - - PowerPoint PPT Presentation
An introduction to A/B testing using a Google Optimize example Juan M. Fonseca-Sol s https://juanfonsecasolis.github.com March 1, 2020 Juan M. Fonseca-Sol s A/B testing with Google Optimize March 1, 2020 1 / 36 Introduction A/B
https://juanfonsecasolis.github.com
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 1 / 36
◮ Comparing statistically two or more variations and determine which
◮ Measuring success in terms of key performance indicators (KPI) ◮ Offering periodical little increments to clients and obtain fast feedback
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 2 / 36
◮ Comparing statistically two or more variations and determine which
◮ Measuring success in terms of key performance indicators (KPI) ◮ Offering periodical little increments to clients and obtain fast feedback
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 2 / 36
◮ Comparing statistically two or more variations and determine which
◮ Measuring success in terms of key performance indicators (KPI) ◮ Offering periodical little increments to clients and obtain fast feedback
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 2 / 36
◮ Comparing statistically two or more variations and determine which
◮ Measuring success in terms of key performance indicators (KPI) ◮ Offering periodical little increments to clients and obtain fast feedback
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 2 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Some goals in A/B testing are [4]:
Increase the conversion rate Increase the throughput Increase the session time Decrease the bounce rate
◮ In few slides we are going to present an example of an A/B test using
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 3 / 36
◮ Sales nature ◮ Target audience ◮ Revenue per customer
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 4 / 36
◮ Sales nature ◮ Target audience ◮ Revenue per customer
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 4 / 36
◮ Sales nature ◮ Target audience ◮ Revenue per customer
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 4 / 36
1 Available at https://juanfonsecasolis.github.io/blog/JFonseca.interpolacionBL.html. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 5 / 36
1 Available at https://juanfonsecasolis.github.io/blog/JFonseca.interpolacionBL.html. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 5 / 36
1 Available at https://juanfonsecasolis.github.io/blog/JFonseca.interpolacionBL.html. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 5 / 36
◮ The target audience is composed by data scientists, digital signal
◮ There is a section, approximately at 38%, were mathematical
◮ We want to avoid people getting stuck in this section
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 6 / 36
◮ The target audience is composed by data scientists, digital signal
◮ There is a section, approximately at 38%, were mathematical
◮ We want to avoid people getting stuck in this section
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 6 / 36
◮ The target audience is composed by data scientists, digital signal
◮ There is a section, approximately at 38%, were mathematical
◮ We want to avoid people getting stuck in this section
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 6 / 36
◮ The target audience is composed by data scientists, digital signal
◮ There is a section, approximately at 38%, were mathematical
◮ We want to avoid people getting stuck in this section
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 6 / 36
https://venturebeat.com/wp-content/uploads/2016/02/ab-testing.jpg?w=930&strip=all. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 7 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 8 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 8 / 36
◮ Vary text content, size or font ◮ Change images ◮ Replace the one column layout by two columns ◮ Provide a lighter text ◮ etc...
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 9 / 36
◮ Vary text content, size or font ◮ Change images ◮ Replace the one column layout by two columns ◮ Provide a lighter text ◮ etc...
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 9 / 36
◮ Vary text content, size or font ◮ Change images ◮ Replace the one column layout by two columns ◮ Provide a lighter text ◮ etc...
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 9 / 36
◮ Vary text content, size or font ◮ Change images ◮ Replace the one column layout by two columns ◮ Provide a lighter text ◮ etc...
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 9 / 36
◮ Vary text content, size or font ◮ Change images ◮ Replace the one column layout by two columns ◮ Provide a lighter text ◮ etc...
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 9 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 10 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 10 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 10 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 10 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 11 / 36
◮ For the progress bar, we added a library called VerLim.js
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 12 / 36
◮ We created the Google optimize experiment and setup the page’s
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 13 / 36
◮ We made Google Optimize inject the following JS code on variation
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 14 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 15 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 16 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 17 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 17 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 17 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 18 / 36
◮ So, adding a progress bar didn’t make a big different ◮ But, can we trust in the results by having only 48 sessions?
https://support.google.com/optimize/answer/7404625?hl=en
◮ R/yes, but... what is Bayes inference and why it doesn’t need a
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 19 / 36
◮ So, adding a progress bar didn’t make a big different ◮ But, can we trust in the results by having only 48 sessions?
https://support.google.com/optimize/answer/7404625?hl=en
◮ R/yes, but... what is Bayes inference and why it doesn’t need a
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 19 / 36
◮ So, adding a progress bar didn’t make a big different ◮ But, can we trust in the results by having only 48 sessions?
https://support.google.com/optimize/answer/7404625?hl=en
◮ R/yes, but... what is Bayes inference and why it doesn’t need a
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 19 / 36
◮ So, adding a progress bar didn’t make a big different ◮ But, can we trust in the results by having only 48 sessions?
https://support.google.com/optimize/answer/7404625?hl=en
◮ R/yes, but... what is Bayes inference and why it doesn’t need a
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 19 / 36
Hypothesis testing Bayesian approach Frequentist approach Multivariate ANOVA Univariate z-test t-test
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 20 / 36
United Kingdom 1702 D.C., mathematician, “An Essay towards solving a Problem in the Doctrine of Chances”
https://en.wikipedia.org/wiki/Thomas_Bayes. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 21 / 36
◮ P(fact) is the probability “a priori” ◮ P(evidence|fact) is the conditional probability ◮ P(evidence) is the total probability ◮ P(fact|evidence) is the probability “a posteriori” (our target)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 22 / 36
◮ P(fact) is the probability “a priori” ◮ P(evidence|fact) is the conditional probability ◮ P(evidence) is the total probability ◮ P(fact|evidence) is the probability “a posteriori” (our target)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 22 / 36
◮ P(fact) is the probability “a priori” ◮ P(evidence|fact) is the conditional probability ◮ P(evidence) is the total probability ◮ P(fact|evidence) is the probability “a posteriori” (our target)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 22 / 36
◮ P(fact) is the probability “a priori” ◮ P(evidence|fact) is the conditional probability ◮ P(evidence) is the total probability ◮ P(fact|evidence) is the probability “a posteriori” (our target)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 22 / 36
◮ P(fact) is the probability “a priori” ◮ P(evidence|fact) is the conditional probability ◮ P(evidence) is the total probability ◮ P(fact|evidence) is the probability “a posteriori” (our target)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 22 / 36
◮ P(fact) is the probability “a priori” ◮ P(evidence|fact) is the conditional probability ◮ P(evidence) is the total probability ◮ P(fact|evidence) is the probability “a posteriori” (our target)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 22 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 23 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 23 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 23 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 23 / 36
◮ The rest of probabilities can be known also using the gamma
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 24 / 36
◮ The rest of probabilities can be known also using the gamma
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 24 / 36
Hypothesis testing Bayesian approach Frequentist approach Multivariate ANOVA Univariate z-test t-test
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 25 / 36
◮ It’s the term used to group all the tests that depend on n, the sample
◮ It allows to find the probability of getting a certain sample mean ¯
◮ Some types of frequentist tests are:
Z-test T-test (when the sample is not normally distributed) ANalysis Of VAriance (ANOVA)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 26 / 36
◮ It’s the term used to group all the tests that depend on n, the sample
◮ It allows to find the probability of getting a certain sample mean ¯
◮ Some types of frequentist tests are:
Z-test T-test (when the sample is not normally distributed) ANalysis Of VAriance (ANOVA)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 26 / 36
◮ It’s the term used to group all the tests that depend on n, the sample
◮ It allows to find the probability of getting a certain sample mean ¯
◮ Some types of frequentist tests are:
Z-test T-test (when the sample is not normally distributed) ANalysis Of VAriance (ANOVA)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 26 / 36
◮ It’s the term used to group all the tests that depend on n, the sample
◮ It allows to find the probability of getting a certain sample mean ¯
◮ Some types of frequentist tests are:
Z-test T-test (when the sample is not normally distributed) ANalysis Of VAriance (ANOVA)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 26 / 36
◮ It’s the term used to group all the tests that depend on n, the sample
◮ It allows to find the probability of getting a certain sample mean ¯
◮ Some types of frequentist tests are:
Z-test T-test (when the sample is not normally distributed) ANalysis Of VAriance (ANOVA)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 26 / 36
◮ It’s the term used to group all the tests that depend on n, the sample
◮ It allows to find the probability of getting a certain sample mean ¯
◮ Some types of frequentist tests are:
Z-test T-test (when the sample is not normally distributed) ANalysis Of VAriance (ANOVA)
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 26 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Define null and alternative sample hypothesis H0 and Ha ◮ Choose a significance level for evaluating the null-hypothesis (e.g.
◮ Compute the z value:
σ √n
σ √ 48 ◮ Where:
¯ x : mean of the sample σ : standard deviation of the population n : sample size
2In other words, how many standard deviations is µa from ¯ x. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 27 / 36
◮ Set the state decision rule: one or two tails test ◮ Then find the p-value that matches 1 − α (area under the curve)
https://www.dummies.com/wp-content/uploads/451654.image0.jpg 3X-axis on the table is the second decimal place of p. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 28 / 36
◮ Set the state decision rule: one or two tails test ◮ Then find the p-value that matches 1 − α (area under the curve)
https://www.dummies.com/wp-content/uploads/451654.image0.jpg 3X-axis on the table is the second decimal place of p. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 28 / 36
◮ Set the state decision rule: one or two tails test ◮ Then find the p-value that matches 1 − α (area under the curve)
https://www.dummies.com/wp-content/uploads/451654.image0.jpg 3X-axis on the table is the second decimal place of p. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 28 / 36
◮ Set the state decision rule: one or two tails test ◮ Then find the p-value that matches 1 − α (area under the curve)
https://www.dummies.com/wp-content/uploads/451654.image0.jpg 3X-axis on the table is the second decimal place of p. Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 28 / 36
◮ So if z < |p| (for a two tails test), reject the null-hypothesis, if not
◮ 1 − α is the upper bound for the cumulative probability distribution
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 29 / 36
◮ So if z < |p| (for a two tails test), reject the null-hypothesis, if not
◮ 1 − α is the upper bound for the cumulative probability distribution
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 29 / 36
◮ The z-value depends of n ◮ The “a posteriori” probability P(fact|evidence), does not ◮ That’s why Google says that we can still have significant results with
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 30 / 36
◮ The z-value depends of n ◮ The “a posteriori” probability P(fact|evidence), does not ◮ That’s why Google says that we can still have significant results with
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 30 / 36
◮ The z-value depends of n ◮ The “a posteriori” probability P(fact|evidence), does not ◮ That’s why Google says that we can still have significant results with
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 30 / 36
◮ The z-value depends of n ◮ The “a posteriori” probability P(fact|evidence), does not ◮ That’s why Google says that we can still have significant results with
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 30 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 31 / 36
◮ A/B testing requires knowledge about the business domain ◮ You can’t have good results if you don’t design good experiments
◮ Google Optimizely allows you to implement experiments easily ◮ The Bayesian approach does not depend on the sample size
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 32 / 36
◮ A/B testing requires knowledge about the business domain ◮ You can’t have good results if you don’t design good experiments
◮ Google Optimizely allows you to implement experiments easily ◮ The Bayesian approach does not depend on the sample size
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 32 / 36
◮ A/B testing requires knowledge about the business domain ◮ You can’t have good results if you don’t design good experiments
◮ Google Optimizely allows you to implement experiments easily ◮ The Bayesian approach does not depend on the sample size
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 32 / 36
◮ A/B testing requires knowledge about the business domain ◮ You can’t have good results if you don’t design good experiments
◮ Google Optimizely allows you to implement experiments easily ◮ The Bayesian approach does not depend on the sample size
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 32 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 33 / 36
Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 34 / 36
https://images.slideplayer.com/3/780091/slides/slide_29.jpg Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 35 / 36
(Click on the license icon to get more information.) Juan M. Fonseca-Sol´ ıs A/B testing with Google Optimize March 1, 2020 36 / 36