Skip to content

Commit

Permalink
ACB/DT - Add AB tests to
Browse files Browse the repository at this point in the history
- log-in-file-self-assessment-tax-return
- pay-self-assessment-tax-bill/pay-weekly-monthly
- stop-being-self-employed
  • Loading branch information
Ana Botto authored and davidtrussler committed Dec 22, 2023
1 parent c1949ec commit bf49721
Show file tree
Hide file tree
Showing 69 changed files with 1,268 additions and 0 deletions.
75 changes: 75 additions & 0 deletions app/controllers/content_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ 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
set_expiry

if is_service_manual?
Expand Down Expand Up @@ -293,5 +296,77 @@ def temporary_ab_test_find_utr_page
@content_item.body.sub!(placeholder, replacement)
end
end

def temporary_ab_test_stop_self_employed
placeholder = "{{ab_test_sa_video_stop_self_employed}}"
if @content_item.base_path == "/stop-being-self-employed" && @content_item.body.include?(placeholder)
ab_test = GovukAbTesting::AbTest.new(
"SAVideoStopSelfEmployed",
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",
)
@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_stop_self_employed.A")
when "B"
I18n.t("ab_tests.sa_video_stop_self_employed.B")
else
I18n.t("ab_tests.sa_video_stop_self_employed.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}}"
if @content_item.base_path == "/log-in-file-self-assessment-tax-return" && @content_item.body.include?(placeholder)
ab_test = GovukAbTesting::AbTest.new(
"SAVideoReturn1",
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_return_1.A")
when "B"
I18n.t("ab_tests.sa_video_return_1.B")
else
I18n.t("ab_tests.sa_video_return_1.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/pay-weekly-monthly" && @content_item.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.body.sub!(placeholder, replacement)
end
end
# /TEMPORARY
end
2 changes: 2 additions & 0 deletions app/views/content_items/guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
<% if ga4_scroll_track_headings_paths.include?(full_url) %>
<meta name="govuk:scroll-tracker" content="" data-module="ga4-scroll-tracker"/>
<% end %>

<%= @requested_variant.analytics_meta_tag.html_safe if @requested_variant.present? %>
<% end %>

<% unless @content_item.requesting_a_part? %>
Expand Down
16 changes: 16 additions & 0 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ ar:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ az:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ be:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ bg:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ bn:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ cs:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ cy:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ da:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ de:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ dr:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ el:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
16 changes: 16 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ 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: <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><div class="gem-c-image-card gem-c-image-card--large" data-module="image-card" data-image-card-module-started="true"><div class="gem-c-image-card__text-wrapper"><div class="gem-c-image-card__header-and-context-wrapper"></div><div class="gem-c-image-card__description">Watch this video to find out how a budget payment plan can help you pay your tax bill on time.</div><figure class="gem-c-image-card__image-wrapper gem-c-image-card__image-wrapper--youtube-embed"><div class="gem-c-govspeak__youtube-video gem-c-image-card__youtube-video-embed"><iframe id="youtube-1" data-video-id="xHn31myAkio" frameborder="0" allowfullscreen="" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" title="How to use a budget payment plan to pay your tax bill online video on YouTube (video)" width="640" height="360" src="https://www.youtube-nocookie.com/embed/xHn31myAkio?enablejsapi=1&amp;origin=http%3A%2F%2F127.0.0.1%3A3090&amp;rel=0&amp;disablekb=1&amp;modestbranding=1&amp;channel&amp;widgetid=1"></iframe></div></figure></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_ready_reckoner:
A:
B:
Z:
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: <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><div class="gem-c-image-card gem-c-image-card--large" data-module="image-card" data-image-card-module-started="true"><div class="gem-c-image-card__text-wrapper"><div class="gem-c-image-card__description">Watch this video to find out more about how to file your tax return.</div></div><figure class="gem-c-image-card__image-wrapper gem-c-image-card__image-wrapper--youtube-embed"><div class="gem-c-govspeak__youtube-video gem-c-image-card__youtube-video-embed"><iframe id="youtube-1" data-video-id="XnP6jaK7ZAY" frameborder="0" allowfullscreen="" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" title="How to file your tax return online video on YouTube" width="640" height="360" src="https://www.youtube.com/embed/_N0ekIOnURM?si=hv5v9sRYdjpngHnt"></iframe></div></figure></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:
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>
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
another_website_html: This call for evidence %{closed} held on <a href="%{url}">another website</a>
Expand Down
16 changes: 16 additions & 0 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ es-419:
A:
B:
Z:
sa_video_pay_bill:
A:
B:
Z:
sa_video_ready_reckoner:
A:
B:
Z:
sa_video_return_1:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
Loading

0 comments on commit bf49721

Please sign in to comment.