Skip to content

Commit

Permalink
Make deploying meta tags changes easier
Browse files Browse the repository at this point in the history
- recently updated the names of some of the metatags that GA4 reads for page views
- but it's possible that the changes to those metatags won't be appearing for a while on a lot of pages, as they probably need republishing first
- so for now let's read either the new or the old metatag (which will contain the same information) and avoid breaking a part of the GA4 tracking
- haven't done the same for the strip dates/postcodes/etc. metatags as I think they're all handled internal to the gem
- follow up to changes made in #4222
  • Loading branch information
andysellick committed Sep 18, 2024
1 parent 487cd72 commit 4195808
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
navigation_page_type: this.getMetaContent('navigation-page-type'),
navigation_list_type: this.getMetaContent('navigation-list-type'),
step_navs: this.getMetaContent('stepnavs'),
taxonomy_level1: this.getMetaContent('taxonomy_level1'),
taxonomy_level1: this.getMetaContent('taxonomy_level1') || this.getMetaContent('themes'),
taxonomy_main: this.getMetaContent('taxon-slug'),
taxonomy_main_id: this.getMetaContent('taxon-id'),
taxonomy_all: this.getMetaContent('taxon-slugs'),
Expand All @@ -49,8 +49,8 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics
publishing_government: this.removeHyphensAndDowncase(this.getMetaContent('publishing-government') || this.getMetaContent('ga4-publishing-government')),
political_status: this.getMetaContent('political-status') || this.getMetaContent('ga4-political-status'),
primary_publishing_organisation: this.getMetaContent('primary-publishing-organisation'),
organisations: this.getMetaContent('organisations'),
world_locations: this.getMetaContent('world-locations'),
organisations: this.getMetaContent('organisations') || this.getMetaContent('analytics:organisations'),
world_locations: this.getMetaContent('world-locations') || this.getMetaContent('world-locations'),

/* The existence of a referrer parameter indicates that the page has been dynamically updated via an AJAX request
and therefore we can use it to set the dynamic property appropriately. This value is used by PA's to differentiate
Expand Down

0 comments on commit 4195808

Please sign in to comment.