Skip to content

Commit

Permalink
Add AB test meta tag to /find-utr-number page
Browse files Browse the repository at this point in the history
If our AB test is active (see ContentItemsController#temporary_ab_test_find_utr_page)
then @requested_variant will be set, and we should use it to add the
required <meta> tag to the page.

Technically this code will work for any Answer that sets a
@requested_variant field, but I think that's probably okay / what people
would want in that situation anyway.
  • Loading branch information
richardTowers committed Oct 23, 2023
1 parent f131985 commit 74559d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/views/content_items/answer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<% elsif scroll_track_percent_paths.include?(@content_item.base_path) %>
<meta name="govuk:scroll-tracker" content="" data-module="auto-scroll-tracker"/>
<% end %>

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

<%= render 'content_items/body_with_related_links' %>

0 comments on commit 74559d5

Please sign in to comment.