Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

USING RAILS TO BUILD GROWTH HACKS FAST

Slide 3

Slide 3 text

RUBENS STULZER Full Stack Rails Developer ~ UX Designer @RubensStulzer stulzer

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

GROWTH HACKING A little overview

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Ultimately Growth Hacking is the efforts of product, engineering and marketing where the focus is grow

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

User Experience

Slide 10

Slide 10 text

User Experience Engineering

Slide 11

Slide 11 text

User Experience Engineering Data Science

Slide 12

Slide 12 text

User Experience Engineering Data Science Marketing

Slide 13

Slide 13 text

User Experience Engineering Data Science Marketing GROWTH

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

EVERY GROWTH TEAM SHOULD

Slide 16

Slide 16 text

EVERY GROWTH TEAM SHOULD • Have only one goal, and it should be clean and simple

Slide 17

Slide 17 text

EVERY GROWTH TEAM SHOULD • Have only one goal, and it should be clean and simple • Validate hypothesis, preferably raised through data

Slide 18

Slide 18 text

EVERY GROWTH TEAM SHOULD • Have only one goal, and it should be clean and simple • Validate hypothesis, preferably raised through data • Be prepared to fail fast, and fail often

Slide 19

Slide 19 text

EVERY GROWTH TEAM SHOULD • Have only one goal, and it should be clean and simple • Validate hypothesis, preferably raised through data • Be prepared to fail fast, and fail often • Learn every single time you are validating something, specially if it is a failure

Slide 20

Slide 20 text

EVERY GROWTH TEAM SHOULD • Have only one goal, and it should be clean and simple • Validate hypothesis, preferably raised through data • Be prepared to fail fast, and fail often • Learn every single time you are validating something, specially if it is a failure • Read the numbers and understand them

Slide 21

Slide 21 text

FOCUS FOR GROWTH Acquisition and Activation

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

FOCUS

Slide 24

Slide 24 text

FOCUS • Grow Monthly Active Users on VivaReal mobile apps

Slide 25

Slide 25 text

FOCUS • Grow Monthly Active Users on VivaReal mobile apps • Two important things to do it

Slide 26

Slide 26 text

FOCUS • Grow Monthly Active Users on VivaReal mobile apps • Two important things to do it • Acquire more users through VivaReal Website

Slide 27

Slide 27 text

FOCUS • Grow Monthly Active Users on VivaReal mobile apps • Two important things to do it • Acquire more users through VivaReal Website • Activate more users on VivaReal Apps

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

FUNNEL

Slide 30

Slide 30 text

FUNNEL • There is a huge funnel to bring website users to apps

Slide 31

Slide 31 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps

Slide 32

Slide 32 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store

Slide 33

Slide 33 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store • Download it

Slide 34

Slide 34 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store • Download it • Open it

Slide 35

Slide 35 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store • Download it • Open it • Search for a property

Slide 36

Slide 36 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store • Download it • Open it • Search for a property • And than send a lead

Slide 37

Slide 37 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store • Download it • Open it • Search for a property • And than send a lead Acquisition

Slide 38

Slide 38 text

FUNNEL • There is a huge funnel to bring website users to apps • They need to know about our apps • They need to go to App Store • Download it • Open it • Search for a property • And than send a lead Acquisition Activation

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

EXPERIMENT VALIDATION

Slide 41

Slide 41 text

EXPERIMENT VALIDATION • We don’t know nothing, never, we should experiment it always

Slide 42

Slide 42 text

EXPERIMENT VALIDATION • We don’t know nothing, never, we should experiment it always • The easiest way to validate a hypothesis is through an A/B Test

Slide 43

Slide 43 text

AB TEST IN RAILS The Good, the Bad and the Ugly

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

THE GOOD

Slide 46

Slide 46 text

THE GOOD • Easy to implement the experiment code

Slide 47

Slide 47 text

THE GOOD • Easy to implement the experiment code • It is simple to pick a winner through experiments dashboard

Slide 48

Slide 48 text

THE GOOD • Easy to implement the experiment code • It is simple to pick a winner through experiments dashboard • Don’t need to be an expert on it to get things running

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

THE BAD

Slide 51

Slide 51 text

THE BAD • No easy way to segment your users

Slide 52

Slide 52 text

THE BAD • No easy way to segment your users • No easy way to configure traffic allocation for a given experiment

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

THE UGLY

Slide 55

Slide 55 text

THE UGLY <% ab_test(:login_button, "/images/button1.jpg", "/images/button2.jpg") do |button_file| %> <%= image_tag(button_file, alt: "Login!") %> <% end %> <% the_test = ab_test('split-extras', 'splitted', 'not-splitted') %>
">

Slide 56

Slide 56 text

THE UGLY

Slide 57

Slide 57 text

THE UGLY

Slide 58

Slide 58 text

THE UGLY def index the_test = ab_test('new-home', 'new', 'old') if the_test == 'new' render ‘new_index', layout: 'new_application' else render 'old_index', layout: 'application' end end

Slide 59

Slide 59 text

THE UGLY

Slide 60

Slide 60 text

THE UGLY

Slide 61

Slide 61 text

THE UGLY • Doesn’t add good value to the codebase

Slide 62

Slide 62 text

THE UGLY • Doesn’t add good value to the codebase • Someone will probably pick one variation, and you will forget that ugly piece of code there

Slide 63

Slide 63 text

HOW VIVAREAL WORKS Brief overview about our stack

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

STACK

Slide 66

Slide 66 text

STACK • Java, Java everywhere

Slide 67

Slide 67 text

STACK • Java, Java everywhere

Slide 68

Slide 68 text

STACK • Java, Java everywhere

Slide 69

Slide 69 text

STACK • Java, Java everywhere • Huge PostgreSQL

Slide 70

Slide 70 text

STACK • Java, Java everywhere • Huge PostgreSQL • Two different websites for Desktop and Mobile, both on the same project

Slide 71

Slide 71 text

STACK • Java, Java everywhere • Huge PostgreSQL • Two different websites for Desktop and Mobile, both on the same project • RequireJS

Slide 72

Slide 72 text

STACK • Java, Java everywhere • Huge PostgreSQL • Two different websites for Desktop and Mobile, both on the same project • RequireJS • SASS for Mobile website

Slide 73

Slide 73 text

STACK • Java, Java everywhere • Huge PostgreSQL • Two different websites for Desktop and Mobile, both on the same project • RequireJS • SASS for Mobile website • LESS for Desktop website

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

GIT AND DEPLOY

Slide 76

Slide 76 text

GIT AND DEPLOY • Since we use git for our projects, we work with pull requests

Slide 77

Slide 77 text

GIT AND DEPLOY • Since we use git for our projects, we work with pull requests • We use Amazon Elastic Beanstalk

Slide 78

Slide 78 text

GIT AND DEPLOY • Since we use git for our projects, we work with pull requests • We use Amazon Elastic Beanstalk • A huge jenkins to run the build

Slide 79

Slide 79 text

GIT AND DEPLOY • Since we use git for our projects, we work with pull requests • We use Amazon Elastic Beanstalk • A huge jenkins to run the build • We make the swap to the new version

Slide 80

Slide 80 text

GIT AND DEPLOY • Since we use git for our projects, we work with pull requests • We use Amazon Elastic Beanstalk • A huge jenkins to run the build • We make the swap to the new version • Unfortunately takes about half hour to finish deployment process

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

URGENCY

Slide 83

Slide 83 text

URGENCY • Growth Team works under urgency

Slide 84

Slide 84 text

URGENCY • Growth Team works under urgency • We need to validate hypothesis ASAP

Slide 85

Slide 85 text

URGENCY • Growth Team works under urgency • We need to validate hypothesis ASAP • With the current workflow it would be very slow

Slide 86

Slide 86 text

GROWTH TEAM STRATEGY Freedom to do whatever we want

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

STRATEGY

Slide 89

Slide 89 text

STRATEGY • Growth Team should act like a third party application

Slide 90

Slide 90 text

STRATEGY • Growth Team should act like a third party application • One simple javascript should inject a script tag and a stylesheet tag containing the code to make experiments work

Slide 91

Slide 91 text

STRATEGY • Growth Team should act like a third party application • One simple javascript should inject a script tag and a stylesheet tag containing the code to make experiments work • Experiments should be controlled through external tool

Slide 92

Slide 92 text

STRATEGY • Growth Team should act like a third party application • One simple javascript should inject a script tag and a stylesheet tag containing the code to make experiments work • Experiments should be controlled through external tool • A Ruby on Rails should app give me a JSON API to work with

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 95

Slide 95 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 96

Slide 96 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 97

Slide 97 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 98

Slide 98 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 99

Slide 99 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 100

Slide 100 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 101

Slide 101 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 102

Slide 102 text

(function() { var scriptElement = document.createElement('script'), body = document.getElementsByTagName('body')[0], head = document.head, link = document.createElement('link'); scriptElement.type = 'text/javascript'; scriptElement.async = true; link.type = 'text/css'; link.rel = 'stylesheet'; scriptElement.src = '//growth.vivareal.com.br/build/lets-grow.js'; link.href = 'http://growth.vivareal.com.br/styles.css'; body.appendChild(scriptElement); head.appendChild(link); })();

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

STRATEGY

Slide 105

Slide 105 text

STRATEGY • No more bullshit code inside production codebase

Slide 106

Slide 106 text

STRATEGY • No more bullshit code inside production codebase • No more approvals from other teams

Slide 107

Slide 107 text

STRATEGY • No more bullshit code inside production codebase • No more approvals from other teams • Deploy in seconds

Slide 108

Slide 108 text

STRATEGY • No more bullshit code inside production codebase • No more approvals from other teams • Deploy in seconds • Freedom to do anything inside the website

Slide 109

Slide 109 text

STRATEGY

Slide 110

Slide 110 text

STRATEGY • Handlebars for template

Slide 111

Slide 111 text

STRATEGY • Handlebars for template • SASS for styling

Slide 112

Slide 112 text

STRATEGY • Handlebars for template • SASS for styling • Simple JavaScript for experiments

Slide 113

Slide 113 text

STRATEGY • Handlebars for template • SASS for styling • Simple JavaScript for experiments • Rails as JSON API

Slide 114

Slide 114 text

STRATEGY • Handlebars for template • SASS for styling • Simple JavaScript for experiments • Rails as JSON API • Grunt tasks for development and deploy

Slide 115

Slide 115 text

(function() { var isPropertyDetailPage = window.location.pathname.match(/\/imovel\/|\/imoveis-lancamento\//), self = this; if (!isPropertyDetailPage) { var variationName = optimizely.variationNamesMap['2658391651'], template; if (variationName === 'Original') { return; } else if (variationName === 'Variation #1') { template = self.GrowthApp.Templates['experiment-1-phone-boxes']({ title: 'Baixe GRÁTIS o app do VivaReal!', subTitle: 'Enviaremos o link para seu celular :)', endPointURL: self.GrowthApp.urlOrigin('api/phone-boxes'), chevronURL: self.GrowthApp.urlOrigin('images/experiment-1/chevron.svg'), CTA: 'Enviar SMS' }); } $('body').append(template); $('.js-heading').on('click', function() { $('.js-form').slideToggle(); $('.sms-box__chevron').toggleClass('sms-box__chevron--is-active'); optimizely.push(['trackEvent', 'triggerSMSBox']); });

Slide 116

Slide 116 text

$('.js-heading').on('click', function() { $('.js-form').slideToggle(); $('.sms-box__chevron').toggleClass('sms-box__chevron--is-active'); optimizely.push(['trackEvent', 'triggerSMSBox']); }); $('#experiment-input').on('focus', function() { optimizely.push(['trackEvent', 'focusOnSMSField']); }); $('.js-form').on('submit', function(event) { event.preventDefault(); var variationURL = $(this).data('url'), url = self.GrowthApp.Utils.urlOrigin(variationURL) + '.json', mobileNumber = $('#experiment-input').val(), leadData = {experiment_lead: {mobile_number: mobileNumber}}; $.post(url, leadData, function(data) { var message = data.message; $('.js-form p').html(message); $('.js-form input.sms-box__text-field').val(''); optimizely.push(['trackEvent', 'SMSSent']); }).fail(function(data) { alert('Ops, algo deu errado, tente novamente mais tarde!'); }); }); } })();

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

{{title}}

{{subTitle}}

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

class API::PhoneBoxesController < API::BaseController def create lead = PhoneLead.new(phone_lead_params) if lead.save render json: {message: phone_lead.success} else render json: {errors: phone_lead.errors.full_messages}, status: :unprocessable_entity end end private def phone_lead_params params.require(:phone_lead).permit(:mobile_number) end end

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

class PhoneLead < ActiveRecord::Base after_create :send_sms validates_presence_of :mobile_number def send_sms client = Twilio::REST::Client.new normalized_number = "+55#{self.mobile_number.gsub(/[(),-,_]/, '')}" client.account.messages.create({ to: normalized_number, from: TWILIO_PHONE_NUMBERS.sample, body: 'Aqui esta o link para baixar gratis o app VivaReal: http://bit.ly/1-AppsVivaReal' }) end end

Slide 123

Slide 123 text

RAILS Why Rails is so important to us

Slide 124

Slide 124 text

No content

Slide 125

Slide 125 text

RAILS

Slide 126

Slide 126 text

RAILS • RSpec to test a bunch of crazy experiments

Slide 127

Slide 127 text

RAILS • RSpec to test a bunch of crazy experiments • Simple JSON API

Slide 128

Slide 128 text

RAILS • RSpec to test a bunch of crazy experiments • Simple JSON API • Easy to code ruby scripts and run them using cronjob to create reports

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

RSPEC

Slide 131

Slide 131 text

RSPEC • The best time to send a SMS to users download our apps

Slide 132

Slide 132 text

RSPEC • The best time to send a SMS to users download our apps • 7 days of week

Slide 133

Slide 133 text

RSPEC • The best time to send a SMS to users download our apps • 7 days of week • 3 times a day

Slide 134

Slide 134 text

RSPEC • The best time to send a SMS to users download our apps • 7 days of week • 3 times a day • 3 links for each time (iOS, Android, Unknown)

Slide 135

Slide 135 text

RSPEC • The best time to send a SMS to users download our apps • 7 days of week • 3 times a day • 3 links for each time (iOS, Android, Unknown) • 63 freaking links to check

Slide 136

Slide 136 text

RSPEC

Slide 137

Slide 137 text

RSPEC

Slide 138

Slide 138 text

RSPEC • Why check those 63 links?

Slide 139

Slide 139 text

RSPEC • Why check those 63 links? • For attribution and tracking

Slide 140

Slide 140 text

RSPEC • Why check those 63 links? • For attribution and tracking • We need to be 100% sure that those app installations came from the SMS we sent, from which time and day, and if those users became MAUs

Slide 141

Slide 141 text

No content

Slide 142

Slide 142 text

RSpec.describe ToStoreController, type: :controller do describe 'each week day' do [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each do |day| [:morning, :afternoon, :night].each do |period| let(:day_period) {"#{day}_#{period}"} let(:month_day) = case_month_day day let(:time) = case_period period context 'redirects user to VivaReal' do it "page on AppStore based on iPhone UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = IOS_UA get day_period expect(response.location).to match(/iOS-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "page on Google Play based on Android UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = ANDROID_UA get day_period expect(response.location).to match(/Android-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "mobile page: #{day} #{period}" do get day_period expect(response.location).to match(/vivareal.com.br\/mobile/) end end end end end end

Slide 143

Slide 143 text

RSpec.describe ToStoreController, type: :controller do describe 'each week day' do [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each do |day| [:morning, :afternoon, :night].each do |period| let(:day_period) {"#{day}_#{period}"} let(:month_day) = case_month_day day let(:time) = case_period period context 'redirects user to VivaReal' do it "page on AppStore based on iPhone UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = IOS_UA get day_period expect(response.location).to match(/iOS-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "page on Google Play based on Android UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = ANDROID_UA get day_period expect(response.location).to match(/Android-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "mobile page: #{day} #{period}" do get day_period expect(response.location).to match(/vivareal.com.br\/mobile/) end end end end end end

Slide 144

Slide 144 text

RSpec.describe ToStoreController, type: :controller do describe 'each week day' do [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each do |day| [:morning, :afternoon, :night].each do |period| let(:day_period) {"#{day}_#{period}"} let(:month_day) = case_month_day day let(:time) = case_period period context 'redirects user to VivaReal' do it "page on AppStore based on iPhone UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = IOS_UA get day_period expect(response.location).to match(/iOS-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "page on Google Play based on Android UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = ANDROID_UA get day_period expect(response.location).to match(/Android-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "mobile page: #{day} #{period}" do get day_period expect(response.location).to match(/vivareal.com.br\/mobile/) end end end end end end

Slide 145

Slide 145 text

RSpec.describe ToStoreController, type: :controller do describe 'each week day' do [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each do |day| [:morning, :afternoon, :night].each do |period| let(:day_period) {"#{day}_#{period}"} let(:month_day) = case_month_day day let(:time) = case_period period context 'redirects user to VivaReal' do it "page on AppStore based on iPhone UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = IOS_UA get day_period expect(response.location).to match(/iOS-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "page on Google Play based on Android UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = ANDROID_UA get day_period expect(response.location).to match(/Android-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "mobile page: #{day} #{period}" do get day_period expect(response.location).to match(/vivareal.com.br\/mobile/) end end end end end end

Slide 146

Slide 146 text

RSpec.describe ToStoreController, type: :controller do describe 'each week day' do [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday].each do |day| [:morning, :afternoon, :night].each do |period| let(:day_period) {"#{day}_#{period}"} let(:month_day) = case_month_day day let(:time) = case_period period context 'redirects user to VivaReal' do it "page on AppStore based on iPhone UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = IOS_UA get day_period expect(response.location).to match(/iOS-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "page on Google Play based on Android UA for period: #{day} #{period}" do request.env['HTTP_USER_AGENT'] = ANDROID_UA get day_period expect(response.location).to match(/Android-SMStest-2015.03.#{month_day}\-#{time}&my_publisher=SMS/) end it "mobile page: #{day} #{period}" do get day_period expect(response.location).to match(/vivareal.com.br\/mobile/) end end end end end end

Slide 147

Slide 147 text

~/growth-app master= ∴

Slide 148

Slide 148 text

~/growth-app master= ∴ ./bin/rspec spec/controllers/to_store_controller_spec.rb

Slide 149

Slide 149 text

~/growth-app master= ∴ ............................................................... Finished in 0.28754 seconds 63 examples, 0 failures ./bin/rspec spec/controllers/to_store_controller_spec.rb

Slide 150

Slide 150 text

No content

Slide 151

Slide 151 text

RSpec.describe API::SmartBannerDesktopController, type: :controller do describe 'create', :vcr do context 'valid' do before :each do post :create, format: :json, non_app_user: {mobile_number: '(11) 99999-9900', experiment_id: 50} end it 'should respond 200' do expect(response.status).to eq 200 end it 'should respond success message' do expect(json['message']).to eq 'SMS Enviado com sucesso!' end it 'stores lead number on database' do expect(NonAppUser.last.mobile_number).to eq '+5511999999900' end end context 'invalid phone' do before :each do post :create, format: :json, non_app_user: {mobile_number: '', experiment_id: nil} end it 'should respond unprocessable entity' do expect(response.status).to eq 422 end it 'should respond rejection message' do expect(json['errors']).to eq ['Número do celular não pode ficar em branco'] end end end end

Slide 152

Slide 152 text

No content

Slide 153

Slide 153 text

AUTOMATED REPORTS

Slide 154

Slide 154 text

AUTOMATED REPORTS • Every single day, a lib run in order to:

Slide 155

Slide 155 text

AUTOMATED REPORTS • Every single day, a lib run in order to: • Get data from our marketing analytics platform

Slide 156

Slide 156 text

AUTOMATED REPORTS • Every single day, a lib run in order to: • Get data from our marketing analytics platform • Add and Organize that data on Google Drive Spreadsheet

Slide 157

Slide 157 text

AUTOMATED REPORTS • Every single day, a lib run in order to: • Get data from our marketing analytics platform • Add and Organize that data on Google Drive Spreadsheet • So, we can keep an eye on all numbers and funnels on a daily basis

Slide 158

Slide 158 text

TRACKING DONE RIGHT Track user events is crucial to grow your business

Slide 159

Slide 159 text

No content

Slide 160

Slide 160 text

TRACK EVERYTHING

Slide 161

Slide 161 text

TRACK EVERYTHING • Never trust on your AB test platform alone

Slide 162

Slide 162 text

TRACK EVERYTHING • Never trust on your AB test platform alone • Track all your events on your AB test platform, plus track it on your analytics tool

Slide 163

Slide 163 text

TRACK EVERYTHING • Never trust on your AB test platform alone • Track all your events on your AB test platform, plus track it on your analytics tool • Hire a Data Scientist (good luck with that)

Slide 164

Slide 164 text

TRACK EVERYTHING • Never trust on your AB test platform alone • Track all your events on your AB test platform, plus track it on your analytics tool • Hire a Data Scientist (good luck with that) • Try to build your own user tracking and analytics platform, as we did in VivaReal

Slide 165

Slide 165 text

No content

Slide 166

Slide 166 text

TRACKING SERIOUS BUSINESS

Slide 167

Slide 167 text

TRACKING SERIOUS BUSINESS • Your AB test platform will probably bring you false positive results

Slide 168

Slide 168 text

TRACKING SERIOUS BUSINESS • Your AB test platform will probably bring you false positive results • Deliver all tracking results to your Data Scientist

Slide 169

Slide 169 text

TRACKING SERIOUS BUSINESS • Your AB test platform will probably bring you false positive results • Deliver all tracking results to your Data Scientist • Re-run you experiments twice at least

Slide 170

Slide 170 text

No content

Slide 171

Slide 171 text

CEREBRO

Slide 172

Slide 172 text

CEREBRO • If is possible, try to have your own platform

Slide 173

Slide 173 text

CEREBRO • If is possible, try to have your own platform • You have all data raw (non processed data)

Slide 174

Slide 174 text

CEREBRO • If is possible, try to have your own platform • You have all data raw (non processed data) • More accurate results

Slide 175

Slide 175 text

CEREBRO • If is possible, try to have your own platform • You have all data raw (non processed data) • More accurate results • More info: http://engenharia.vivareal.com.br/a-look- inside-cerebro-our-user-tracking-and-analytics-platform/

Slide 176

Slide 176 text

No content

Slide 177

Slide 177 text

DAILY REPORTS

Slide 178

Slide 178 text

DAILY REPORTS • Look your numbers on a daily basis

Slide 179

Slide 179 text

DAILY REPORTS • Look your numbers on a daily basis • Act based on them

Slide 180

Slide 180 text

DAILY REPORTS • Look your numbers on a daily basis • Act based on them • Be sure, to know why your numbers is going down or up

Slide 181

Slide 181 text

DAILY REPORTS • Look your numbers on a daily basis • Act based on them • Be sure, to know why your numbers is going down or up • Know why is the most important thing, and just tracking your events carefully, you can really know what is going on

Slide 182

Slide 182 text

SUCCESS Growth Hacking is hard

Slide 183

Slide 183 text

No content

Slide 184

Slide 184 text

Golden metric on mobile apps 2014 2015

Slide 185

Slide 185 text

Golden metric on mobile apps 2014 2015

Slide 186

Slide 186 text

Golden metric on mobile apps 2014 2015

Slide 187

Slide 187 text

Golden metric on mobile apps 2014 2015

Slide 188

Slide 188 text

Golden metric on mobile apps 2014 2015

Slide 189

Slide 189 text

One last thing…

Slide 190

Slide 190 text

IS HIRING, WE NEED YOU

Slide 191

Slide 191 text

http://engenharia.vivareal.com.br/work-with-us/

Slide 192

Slide 192 text

THANK YOU