Commit afa7582b authored by Alper Akgun's avatar Alper Akgun

Record conversion for 3 experiment in onboarding flow

parent 41f2d403
...@@ -30,6 +30,11 @@ module Registrations ...@@ -30,6 +30,11 @@ module Registrations
record_experiment_user(:remove_known_trial_form_fields, namespace_id: @group.id) record_experiment_user(:remove_known_trial_form_fields, namespace_id: @group.id)
record_experiment_user(:trimmed_skip_trial_copy, namespace_id: @group.id) record_experiment_user(:trimmed_skip_trial_copy, namespace_id: @group.id)
record_experiment_user(:trial_registration_with_social_signin, namespace_id: @group.id) record_experiment_user(:trial_registration_with_social_signin, namespace_id: @group.id)
record_experiment_user(:trial_onboarding_issues, namespace_id: @group.id)
record_experiment_conversion_event(:remove_known_trial_form_fields)
record_experiment_conversion_event(:trimmed_skip_trial_copy)
record_experiment_conversion_event(:trial_registration_with_social_signin)
record_experiment_conversion_event(:trial_onboarding_issues)
url_params[:trial_onboarding_flow] = true url_params[:trial_onboarding_flow] = true
else else
......
...@@ -27,6 +27,7 @@ module Registrations ...@@ -27,6 +27,7 @@ module Registrations
} }
record_experiment_user(:trial_onboarding_issues, trial_onboarding_context) record_experiment_user(:trial_onboarding_issues, trial_onboarding_context)
record_experiment_conversion_event(:trial_onboarding_issues)
redirect_to trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: learn_gitlab_project.id) redirect_to trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: learn_gitlab_project.id)
else else
redirect_to users_sign_up_experience_level_path(namespace_path: @project.namespace, trial_onboarding_flow: params[:trial_onboarding_flow]) redirect_to users_sign_up_experience_level_path(namespace_path: @project.namespace, trial_onboarding_flow: params[:trial_onboarding_flow])
......
...@@ -44,9 +44,11 @@ class TrialsController < ApplicationController ...@@ -44,9 +44,11 @@ class TrialsController < ApplicationController
record_experiment_user(:remove_known_trial_form_fields, namespace_id: @namespace.id) record_experiment_user(:remove_known_trial_form_fields, namespace_id: @namespace.id)
record_experiment_user(:trimmed_skip_trial_copy, namespace_id: @namespace.id) record_experiment_user(:trimmed_skip_trial_copy, namespace_id: @namespace.id)
record_experiment_user(:trial_registration_with_social_signin, namespace_id: @namespace.id) record_experiment_user(:trial_registration_with_social_signin, namespace_id: @namespace.id)
record_experiment_user(:trial_onboarding_issues, namespace_id: @namespace.id)
record_experiment_conversion_event(:remove_known_trial_form_fields) record_experiment_conversion_event(:remove_known_trial_form_fields)
record_experiment_conversion_event(:trimmed_skip_trial_copy) record_experiment_conversion_event(:trimmed_skip_trial_copy)
record_experiment_conversion_event(:trial_registration_with_social_signin) record_experiment_conversion_event(:trial_registration_with_social_signin)
record_experiment_conversion_event(:trial_onboarding_issues)
redirect_to group_url(@namespace, { trial: true }) redirect_to group_url(@namespace, { trial: true })
else else
......
...@@ -236,6 +236,11 @@ RSpec.describe Registrations::GroupsController do ...@@ -236,6 +236,11 @@ RSpec.describe Registrations::GroupsController do
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields, namespace_id: group.id) expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields, namespace_id: group.id)
expect(controller).to receive(:record_experiment_user).with(:trimmed_skip_trial_copy, namespace_id: group.id) expect(controller).to receive(:record_experiment_user).with(:trimmed_skip_trial_copy, namespace_id: group.id)
expect(controller).to receive(:record_experiment_user).with(:trial_registration_with_social_signin, namespace_id: group.id) expect(controller).to receive(:record_experiment_user).with(:trial_registration_with_social_signin, namespace_id: group.id)
expect(controller).to receive(:record_experiment_user).with(:trial_onboarding_issues, namespace_id: group.id)
expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields)
expect(controller).to receive(:record_experiment_conversion_event).with(:trimmed_skip_trial_copy)
expect(controller).to receive(:record_experiment_conversion_event).with(:trial_registration_with_social_signin)
expect(controller).to receive(:record_experiment_conversion_event).with(:trial_onboarding_issues)
is_expected.to redirect_to(new_users_sign_up_project_path(namespace_id: group.id, trial: false, trial_onboarding_flow: true)) is_expected.to redirect_to(new_users_sign_up_project_path(namespace_id: group.id, trial: false, trial_onboarding_flow: true))
end end
......
...@@ -99,6 +99,7 @@ RSpec.describe Registrations::ProjectsController do ...@@ -99,6 +99,7 @@ RSpec.describe Registrations::ProjectsController do
expect(service).to receive(:execute).and_return(project) expect(service).to receive(:execute).and_return(project)
end end
expect(controller).to receive(:record_experiment_user).with(:trial_onboarding_issues, trial_onboarding_context) expect(controller).to receive(:record_experiment_user).with(:trial_onboarding_issues, trial_onboarding_context)
expect(controller).to receive(:record_experiment_conversion_event).with(:trial_onboarding_issues)
expect(subject).to redirect_to(trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: project.id)) expect(subject).to redirect_to(trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: project.id))
end end
end end
......
...@@ -111,6 +111,7 @@ RSpec.describe TrialsController do ...@@ -111,6 +111,7 @@ RSpec.describe TrialsController do
it 'records trial_onboarding_issues experiment users and redirects to onboarding' do it 'records trial_onboarding_issues experiment users and redirects to onboarding' do
expect(controller).to receive(:record_experiment_user).with(:trial_onboarding_issues) expect(controller).to receive(:record_experiment_user).with(:trial_onboarding_issues)
is_expected.to redirect_to(new_users_sign_up_group_path(glm_source: 'about.gitlab.com', trial_onboarding_flow: true)) is_expected.to redirect_to(new_users_sign_up_group_path(glm_source: 'about.gitlab.com', trial_onboarding_flow: true))
end end
end end
...@@ -229,9 +230,11 @@ RSpec.describe TrialsController do ...@@ -229,9 +230,11 @@ RSpec.describe TrialsController do
expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields, namespace_id: namespace.id) expect(controller).to receive(:record_experiment_user).with(:remove_known_trial_form_fields, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_user).with(:trimmed_skip_trial_copy, namespace_id: namespace.id) expect(controller).to receive(:record_experiment_user).with(:trimmed_skip_trial_copy, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_user).with(:trial_registration_with_social_signin, namespace_id: namespace.id) expect(controller).to receive(:record_experiment_user).with(:trial_registration_with_social_signin, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_user).with(:trial_onboarding_issues, namespace_id: namespace.id)
expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields) expect(controller).to receive(:record_experiment_conversion_event).with(:remove_known_trial_form_fields)
expect(controller).to receive(:record_experiment_conversion_event).with(:trimmed_skip_trial_copy) expect(controller).to receive(:record_experiment_conversion_event).with(:trimmed_skip_trial_copy)
expect(controller).to receive(:record_experiment_conversion_event).with(:trial_registration_with_social_signin) expect(controller).to receive(:record_experiment_conversion_event).with(:trial_registration_with_social_signin)
expect(controller).to receive(:record_experiment_conversion_event).with(:trial_onboarding_issues)
subject subject
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment