-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add tracking for our new taxonomy navigation #1054
Conversation
@@ -91,23 +91,42 @@ def load_taxonomy_navigation | |||
.map { |document_collection| document_collection.values_at('base_path', 'title') } | |||
|
|||
# Fetch link attributes of parent step by steps required to render the top navigation banner | |||
@banner_items = @content_item | |||
@step_by_step_links = @content_item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need @step_by_step_links
, or @taxon_links
to be instance variables, only @banner_items
.
.sort_by { |taxon| taxon[:taxon_name] } | ||
.map { |taxon| taxon.values_at('title', 'base_path') } | ||
.map { |taxon| taxon.values_at('title', 'base_path') << "Taxon" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to append "Taxon" to the mapped attributes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, we don't any more, that was my previous attempt at a solution! Will remove
b12af32
to
2a9faf9
Compare
2a9faf9
to
aaaf82c
Compare
end | ||
end | ||
end | ||
|
||
def format_banner_links(links, type) | ||
links.each.with_index(1).map do |link, index| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do map do |(title, base_path), index|
, then the arguments supplied to link_to
will be a little more expressive.
aaaf82c
to
9984905
Compare
Trello: https://trello.com/c/CALq4uG8/132-add-tracking-for-ab-test
Adds Google Analytics tracking to Topic, Collection, related taxon and step by step links.
Banner with taxon and step by step links:
Topic & Collection links:
How to test
You will need to have an extension like ModHeader installed in your browser to see the B Variant. The values should be:
Request Header Name: GOVUK-ABTest-ContentPagesNav
Request Header Value: B
To see Google Analytics events firing in the Dev Tools console, you need an extension like Google Analytics Debugger
Tagged to one taxon
Tagged to multiple taxons
Tagged to a taxon without services
Not tagged to any taxons