Skip to content

Commit

Permalink
Merge pull request #3060 from alphagov/phase-2-ab-tests
Browse files Browse the repository at this point in the history
CA/ACB - Change current A/B tests for phase 2
  • Loading branch information
anatron authored Jan 24, 2024
2 parents fc3508a + 38ec48f commit e9808a0
Show file tree
Hide file tree
Showing 68 changed files with 174 additions and 522 deletions.
53 changes: 14 additions & 39 deletions app/controllers/content_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ def show
load_content_item

temporary_ab_test_find_utr_page
temporary_ab_test_stop_self_employed
temporary_ab_test_sa_video_return_1
temporary_ab_test_sa_video_pay_bill
temporary_ab_test_stop_self_employed_2
temporary_ab_test_sa_video_return_2
set_expiry

if is_service_manual?
Expand Down Expand Up @@ -298,11 +297,11 @@ def temporary_ab_test_find_utr_page
end
end

def temporary_ab_test_stop_self_employed
placeholder = "{{ab_test_sa_video_stop_self_employed}}"
def temporary_ab_test_stop_self_employed_2
placeholder = "{{ab_test_sa_video_stop_self_employed_2}}"
if @content_item.base_path == "/stop-being-self-employed" && @content_item.body.include?(placeholder)
ab_test = GovukAbTesting::AbTest.new(
"SAVideoStopSelfEmployed",
"SAVideoStopSelfEmployed2",
dimension: 47, # https://docs.google.com/spreadsheets/d/1h4vGXzIbhOWwUzourPLIc8WM-iU1b6WYOVDOZxmU1Uo/edit#gid=254065189&range=69:69
allowed_variants: %w[A B Z],
control_variant: "Z",
Expand All @@ -312,21 +311,21 @@ def temporary_ab_test_stop_self_employed

replacement = case @requested_variant.variant_name
when "A"
I18n.t("ab_tests.sa_video_stop_self_employed.A")
I18n.t("ab_tests.sa_video_stop_self_employed_2.A")
when "B"
I18n.t("ab_tests.sa_video_stop_self_employed.B")
I18n.t("ab_tests.sa_video_stop_self_employed_2.B")
else
I18n.t("ab_tests.sa_video_stop_self_employed.Z")
I18n.t("ab_tests.sa_video_stop_self_employed_2.Z")
end
@content_item.body.sub!(placeholder, replacement)
end
end

def temporary_ab_test_sa_video_return_1
placeholder = "{{ab_test_sa_video_return_1}}"
def temporary_ab_test_sa_video_return_2
placeholder = "{{ab_test_sa_video_return_2}}"
if @content_item.base_path == "/log-in-file-self-assessment-tax-return" && @content_item.body.include?(placeholder)
ab_test = GovukAbTesting::AbTest.new(
"SAVideoReturn1",
"SAVideoReturn2",
dimension: 47,
allowed_variants: %w[A B Z],
control_variant: "Z",
Expand All @@ -336,38 +335,14 @@ def temporary_ab_test_sa_video_return_1

replacement = case @requested_variant.variant_name
when "A"
I18n.t("ab_tests.sa_video_return_1.A")
I18n.t("ab_tests.sa_video_return_2.A")
when "B"
I18n.t("ab_tests.sa_video_return_1.B")
I18n.t("ab_tests.sa_video_return_2.B")
else
I18n.t("ab_tests.sa_video_return_1.Z")
I18n.t("ab_tests.sa_video_return_2.Z")
end
@content_item.body.sub!(placeholder, replacement)
end
end

def temporary_ab_test_sa_video_pay_bill
placeholder = "{{ab_test_sa_video_pay_bill}}"
if @content_item.base_path == "/pay-self-assessment-tax-bill" && @content_item.current_part_body.include?(placeholder)
ab_test = GovukAbTesting::AbTest.new(
"SAVideoPayBill",
dimension: 47,
allowed_variants: %w[A B Z],
control_variant: "Z",
)
@requested_variant = ab_test.requested_variant(request.headers)
@requested_variant.configure_response(response)

replacement = case @requested_variant.variant_name
when "A"
I18n.t("ab_tests.sa_video_pay_bill.A")
when "B"
I18n.t("ab_tests.sa_video_pay_bill.B")
else
I18n.t("ab_tests.sa_video_pay_bill.Z")
end
@content_item.current_part_body.sub!(placeholder, replacement)
end
end
# /TEMPORARY
end
8 changes: 2 additions & 6 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ ar:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ az:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ be:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ bg:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ bn:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ cs:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ cy:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ da:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ de:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ dr:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ el:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
16 changes: 6 additions & 10 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ en:
A: in the <a href="/guidance/download-the-hmrc-app"><abbr title="HM Revenue and Customs">HMRC</abbr> app</a> under 'Your details' or in the 'Self Assessment' section
B: in the <a href="/guidance/download-the-hmrc-app"><abbr title="HM Revenue and Customs">HMRC</abbr> app</a> - watch a <a href="https://www.youtube.com/watch?v=LXw9ily9rTo">video about finding your UTR number in the app</a>
Z: in the <a href="/guidance/download-the-hmrc-app"><abbr title="HM Revenue and Customs">HMRC</abbr> app</a> under 'Your details' or in the 'Self Assessment' section
sa_video_pay_bill:
A: <p>Go to your <a rel="external" href="https://www.tax.service.gov.uk/gg/sign-in?continue=/self-assessment/&amp;origin=SA-frontend">HM Revenue and Customs (<abbr title="HM Revenue and Customs">HMRC</abbr>) online account</a> and set up a Direct Debit. Choose the Budget Payment Plan option and follow the instructions to set up your plan.</p>
B: <div class="gem-c-govspeak govuk-govspeak " data-module="govspeak"><p>Go to your <a rel="external" href="https://www.tax.service.gov.uk/gg/sign-in?continue=/self-assessment/&amp;origin=SA-frontend">HM Revenue and Customs (<abbr title="HM Revenue and Customs">HMRC</abbr>) online account</a> and set up a Direct Debit. Choose the Budget Payment Plan option and follow the instructions to set up your plan.</p><p>Watch this video to find out how a budget payment plan can help you pay your tax bill on time.</p><p><a href="https://www.youtube.com/watch?v=xHn31myAkio">How do I budget for my Self Assessment tax bill?</a></p></div>
Z: <p>Go to your <a rel="external" href="https://www.tax.service.gov.uk/gg/sign-in?continue=/self-assessment/&amp;origin=SA-frontend">HM Revenue and Customs (<abbr title="HM Revenue and Customs">HMRC</abbr>) online account</a> and set up a Direct Debit. Choose the Budget Payment Plan option and follow the instructions to set up your plan.</p>
sa_video_return_1:
A: "<p>You do not have to complete your return in one go. You can save your entry and go back to it later if you need to.</p>"
B: <div class="gem-c-govspeak govuk-govspeak " data-module="govspeak"><p>You do not have to complete your return in one go. You can save your entry and go back to it later if you need to.</p><p>Watch this video to find out more about how to file your tax return.</p><p><a href="https://www.youtube.com/watch?v=_N0ekIOnURM">My first Self Assessment tax return</a></p></div>
Z: "<p>You do not have to complete your return in one go. You can save your entry and go back to it later if you need to.</p>"
sa_video_stop_self_employed:
sa_video_return_2:
A: <h2 id="if-you-do-not-have-a-government-gateway-account">If you do not have a Government Gateway account</h2>
B: <div class="gem-c-govspeak govuk-govspeak " data-module="govspeak"><p>Watch this video to find out more about how to file your tax return.</p><p><a href="https://www.youtube.com/watch?v=_N0ekIOnURM">My first Self Assessment tax return</a></p></div><h2 id="if-you-do-not-have-a-government-gateway-account">If you do not have a Government Gateway account</h2>
Z: <h2 id="if-you-do-not-have-a-government-gateway-account">If you do not have a Government Gateway account</h2>
sa_video_stop_self_employed_2:
A: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p>
B: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p><p><a href="https://www.youtube.com/watch?v=g-CkQRLGb0Q">Watch this video to find out how to tell HMRC you're stopping self-employment</a></p>
B: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p><div class="gem-c-govspeak govuk-govspeak" data-module="govspeak"><p>Watch this video to find out how to tell HMRC you're stopping self-employment.</p><p><a href="https://www.youtube.com/watch?v=g-CkQRLGb0Q">How to stop Self Assessment online if youre self-employed</a></p></div>
Z: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p>
call_for_evidence:
and: and
Expand Down
8 changes: 2 additions & 6 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ es-419:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ es:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ et:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ fa:
A:
B:
Z:
sa_video_pay_bill:
sa_video_return_2:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
sa_video_stop_self_employed_2:
A:
B:
Z:
Expand Down
Loading

0 comments on commit e9808a0

Please sign in to comment.