Skip to content
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

Update metatags for GA4 #4222

Merged
merged 5 commits into from
Sep 16, 2024
Merged

Update metatags for GA4 #4222

merged 5 commits into from
Sep 16, 2024

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented Sep 13, 2024

What

Updates GOV.UK page metatags used by GA4 to make them more consistent. See individual commits for details.

Must be deployed with alphagov/slimmer#341

Why

This is some final tidying up post GA4 launch, to make things more consistent and clear.

Visual Changes

None.

Trello card: https://trello.com/c/lIVmnFpY/336-page-view-enhancement-some-meta-tags-start-with-analytics

- remove the `analytics:` part from world-locations and organisations meta tags, to make them more consistent with the other meta tags
Copy link
Contributor

@AshGDS AshGDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but just wanted to check - if things like strip-dates are no longer tagged with an analytics name, does that go against what we've been doing in other places?

For example, in meta_tags.rb we have some GA4 specific tags that are:

meta_tags["govuk:ga4-political-status"] = "historic"
meta_tags["govuk:ga4-publishing-government"]

and code wise, we name spaced everything with ga4-, so should the PII specific tags have ga4- on them?

Non-blocking though, so feel free to merge.

@andysellick
Copy link
Contributor Author

Good point @AshGDS, thanks, have updated as suggested.

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4222 September 13, 2024 14:53 Inactive
- not needed, and confusing, as analytics now has little to do with static
- comment is out of date as refers to old Universal Analytics code that has been removed
- on that basis tested to see if removing the line it refers to is still necessary, tests still pass, so removed
- more descriptive and accurate to what it contains
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4222 September 13, 2024 15:14 Inactive
Copy link
Contributor

@AshGDS AshGDS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks - LGTM 👍

@andysellick andysellick merged commit 33d2a29 into main Sep 16, 2024
12 checks passed
@andysellick andysellick deleted the ga4-metatags branch September 16, 2024 07:57
andysellick added a commit that referenced this pull request Sep 18, 2024
- 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
andysellick added a commit that referenced this pull request Sep 18, 2024
- 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
andysellick added a commit that referenced this pull request Sep 18, 2024
- 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
andysellick added a commit that referenced this pull request Sep 18, 2024
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants