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

Add data-nosnippet to prevent cookie banner text appearing in Google Search snippets #2192

Merged
merged 3 commits into from
Apr 19, 2021

Conversation

vanitabarrett
Copy link
Contributor

@vanitabarrett vanitabarrett commented Apr 16, 2021

What

Add data-nosnippet to the cookie banner component

Why

Taken inspiration from alphagov/govuk_publishing_components#1185
Apply a data-nosnippet attribute to the cookie banner component to stop its text content appearing in Google Search snippets.

We think we can make this change without adding a macro option to remove the attribute, as we can't think of a scenario where you would want the cookie banner text to appear in Google Search snippets.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2192 April 16, 2021 14:34 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2192 April 16, 2021 14:35 Inactive
@vanitabarrett vanitabarrett added this to Needs review 🔍 in Design System Sprint Board via automation Apr 16, 2021
Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

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

I think this makes sense, but as I sort of prompted this PR I think it'd be worth @hannalaakso reviewing in case she can think of any reason why this would ever be problematic.

For users that don't know what data-nosnippet does, is there a better description for the changelog / PR title that focuses on the outcome of the change?

I also wonder if it'd also be useful to cross-reference the PR from GOV.UK where they added this in the commit message? Just as 'prior art'.

Great spot adding the missing README as well.

@vanitabarrett vanitabarrett changed the title Add data-nosnippet to cookie banner component Add data-nosnippet to prevent cookie banner text appearing in Google Search snippets Apr 16, 2021
@vanitabarrett vanitabarrett marked this pull request as ready for review April 16, 2021 15:31
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2192 April 16, 2021 15:31 Inactive
@vanitabarrett vanitabarrett added this to the v3.12.0 milestone Apr 19, 2021
Vanita Barrett added 3 commits April 19, 2021 15:36
The data-nosnippet attribute stops the cookie banner text from appearing in any Google Search text snippets.
Copy link
Member

@hannalaakso hannalaakso left a comment

Choose a reason for hiding this comment

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

This looks good to me 🎉 The NHS also seem to have done this in their cookie banner for nearly a year now which gives me confidence.

@vanitabarrett vanitabarrett merged commit 522a489 into master Apr 19, 2021
Design System Sprint Board automation moved this from Needs review 🔍 to Done 🏁 Apr 19, 2021
@vanitabarrett vanitabarrett deleted the cookie-banner-tweaks branch April 19, 2021 14:55
@vanitabarrett vanitabarrett moved this from Done 🏁 to Ready to release 🚀 in Design System Sprint Board Apr 19, 2021
@36degrees 36degrees mentioned this pull request May 13, 2021
@36degrees 36degrees moved this from Ready to release 🚀 to Done 🏁 in Design System Sprint Board May 13, 2021
@EoinShaughnessy EoinShaughnessy changed the title Add data-nosnippet to prevent cookie banner text appearing in Google Search snippets Add data-nosnippet to prevent cookie banner text appearing in Google Search snippets Sep 27, 2021
hannalaakso added a commit that referenced this pull request Oct 27, 2021
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets.

We have successfully used a similar approach for the [cookie banner](#2192)
and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
hannalaakso added a commit that referenced this pull request Oct 27, 2021
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets.

We have successfully used a similar approach for the [cookie banner](#2192)
and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
hannalaakso added a commit that referenced this pull request Oct 28, 2021
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets.

We have successfully used a similar approach for the [cookie banner](#2192)
and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
hannalaakso added a commit that referenced this pull request Nov 1, 2021
The data-nosnippet attribute stops the 'show' text from appearing in any Google Search text snippets.

We have successfully used a similar approach for the [cookie banner](#2192)
and on [GOV.UK Publishing components](alphagov/govuk_publishing_components#1185)
@vanitabarrett vanitabarrett mentioned this pull request Dec 15, 2021
peteryates added a commit to x-govuk/govuk-components that referenced this pull request Dec 21, 2021
Apply a data-nosnippet attribute to the cookie banner component to stop
it appearing in Google Search snippets.

alphagov/govuk-frontend#2192
frankieroberto added a commit to DFE-Digital/find-teacher-training that referenced this pull request Jan 10, 2022
andymantell added a commit to surevine/govuk-react-jsx that referenced this pull request Jan 29, 2022
tombye added a commit to alphagov/notifications-admin that referenced this pull request Nov 22, 2022
Implemented on the GOVUK Frontend cookie banner
component in:

alphagov/govuk-frontend#2192

This tells Google to ignore the cookie banner when
it indexes the content of our pages.
tombye added a commit to alphagov/notifications-admin that referenced this pull request Nov 23, 2022
Implemented on the GOVUK Frontend cookie banner
component in:

alphagov/govuk-frontend#2192

This tells Google to ignore the cookie banner when
it indexes the content of our pages.
tombye added a commit to alphagov/notifications-admin that referenced this pull request Nov 24, 2022
Implemented on the GOVUK Frontend cookie banner
component in:

alphagov/govuk-frontend#2192

This tells Google to ignore the cookie banner when
it indexes the content of our pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants