Skip to content

Commit

Permalink
Remove 'analytics' from metatags
Browse files Browse the repository at this point in the history
- to make this consistent with other metatags
  • Loading branch information
andysellick committed Sep 13, 2024
1 parent 4f8f5ad commit 4f82ba7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Remove 'analytics' from metatags

# 18.6.1

* Update body classes for govuk-frontend-v5
Expand Down
3 changes: 3 additions & 0 deletions lib/slimmer/processors/metadata_inserter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ def initialize(response, app_name)
def filter(_old_doc, new_doc)
head = new_doc.at_css("head")

# temporarily duplicate these tags with the old names to avoid deployment issues
add_meta_tag("analytics:organisations", @headers[Slimmer::Headers::ORGANISATIONS_HEADER], head, new_doc)
add_meta_tag("analytics:world-locations", @headers[Slimmer::Headers::WORLD_LOCATIONS_HEADER], head, new_doc)
add_meta_tag("organisations", @headers[Slimmer::Headers::ORGANISATIONS_HEADER], head, new_doc)
add_meta_tag("world-locations", @headers[Slimmer::Headers::WORLD_LOCATIONS_HEADER], head, new_doc)
add_meta_tag("format", @headers[Slimmer::Headers::FORMAT_HEADER], head, new_doc)
add_meta_tag("search-result-count", @headers[Slimmer::Headers::RESULT_COUNT_HEADER], head, new_doc)
add_meta_tag("rendering-application", @app_name, head, new_doc)
Expand Down
8 changes: 4 additions & 4 deletions test/processors/metadata_inserter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def test_should_include_format_meta_tag
end

def test_should_include_organisations_meta_tag
assert_meta_tag "analytics:organisations", "<P1><D422>"
assert_meta_tag "organisations", "<P1><D422>"
end

def test_should_include_world_locations_meta_tag
assert_meta_tag "analytics:world-locations", "<WL3>"
assert_meta_tag "world-locations", "<WL3>"
end

def test_should_include_search_result_count_meta_tag
Expand All @@ -71,11 +71,11 @@ def test_should_omit_internal_format_name
end

def test_should_omit_organisations
refute_meta_tag "analytics:organisations"
refute_meta_tag "organisations"
end

def test_should_omit_world_locations
refute_meta_tag "analytics:world-locations"
refute_meta_tag "world-locations"
end

def test_should_omit_result_count
Expand Down

0 comments on commit 4f82ba7

Please sign in to comment.