Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AB tests for Self Assessment videos #3025

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" && @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
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
12 changes: 12 additions & 0 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ ar:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ az:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ be:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ bg:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ bn:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ cs:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ cy:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ da:
A:
B:
Z:
sa_video_pay_bill:
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
14 changes: 13 additions & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ de:
A:
B:
Z:
sa_video_pay_bill:
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 Expand Up @@ -75,8 +87,8 @@ de:
original_consultation: Originale Anhörung
ran_from: Diese Anhörung lief ab
respond_online: Online antworten
visit_soon: Besuchen Sie diese Seite bald wieder, um das Ergebnis dieser öffentlichen Rückmeldung herunterzuladen.
summary:
visit_soon: Besuchen Sie diese Seite bald wieder, um das Ergebnis dieser öffentlichen Rückmeldung herunterzuladen.
was: war
ways_to_respond: Möglichkeiten, um zu antworten
write_to: 'Schreiben Sie an:'
Expand Down
14 changes: 13 additions & 1 deletion config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ dr:
A:
B:
Z:
sa_video_pay_bill:
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 Expand Up @@ -75,8 +87,8 @@ dr:
original_consultation: مشاورهء اصلی
ran_from: این مشاوره اجرا میشود از
respond_online: بصورت آنلاین پاسخ دهید
visit_soon: به زودی بار دیگر از این صفحه دیدن نمایید تا نتیجه را از این  فیدبک عمومی دانلود نمایید
summary:
visit_soon: به زودی بار دیگر از این صفحه دیدن نمایید تا نتیجه را از این  فیدبک عمومی دانلود نمایید
was: بود
ways_to_respond: طریقه هایی پاسخ دهی
write_to: 'نوشته کنید به:'
Expand Down
12 changes: 12 additions & 0 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ el:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ 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_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
12 changes: 12 additions & 0 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ es-419:
A:
B:
Z:
sa_video_pay_bill:
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
12 changes: 12 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ es:
A:
B:
Z:
sa_video_pay_bill:
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