Professional Documents
Culture Documents
Kurufootwear A/B Test Implementation W/ M2 and Google Optimize
Kurufootwear A/B Test Implementation W/ M2 and Google Optimize
Find the descruption of Kurufootwear A/B test implementation w/ M2 and Google Optimize: https://gist.github.com/kshaa
/2764f6921c7a4ad356166621ee6c35e1
Requirements
Implementation brainstorm
We knew Enterprise edition had an integration with some Google service to create an AB test experience and we reimplementing, copying that.
However, we didn't have access to enterprise and it might've taken a lot of time to understand it's code and to integrate it.
We considered making a barebones framework for splitting traffic server side. While that would provide us with immediately loaded & ready A/B
test pages, that might have issues with the multi-instance server set up and would also take a lot of time and thinking.
After a lot of brainstorming with their dedicated developer Jim, we came up with a very simple idea of how to reuse the traffic splitting functionality
of Google Optimize and to have only a barebones modification for layout loading on server side.
Implementation
Before M2 generates the page layout, we check the request URL for an AB test query parameter and depending on it load additional layouts.
This reuses core M2 layout extension/overriding and is very easy to implement. (Literally one observer)
http://www.example.com/customer/account/login?v=x,y
customer_account_login_ab_x.xml
customer_account_login_ab_y.xml
For actually splitting the traffic to "Control" URL and "B test" URL, we use Google Optimize.