-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AB test to request new Explore supermenu header from Static
Static has a new header that the GOV.UK Explore team want to AB test as part of their beta.
- Loading branch information
Showing
5 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module ExploreMenuAbTestable | ||
CUSTOM_DIMENSION = 47 | ||
|
||
ALLOWED_VARIANTS = %w[A B Z].freeze | ||
|
||
def explore_menu_test | ||
@explore_menu_test ||= GovukAbTesting::AbTest.new( | ||
"ExploreMenuAbTestable", | ||
dimension: CUSTOM_DIMENSION, | ||
allowed_variants: ALLOWED_VARIANTS, | ||
control_variant: "Z", | ||
) | ||
end | ||
|
||
def explore_menu_variant | ||
explore_menu_test.requested_variant(request.headers) | ||
end | ||
|
||
def set_explore_menu_response | ||
explore_menu_variant.configure_response(response) if explore_menu_testable? | ||
end | ||
|
||
def explore_menu_testable? | ||
explore_menu_variant.variant?("B") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters