Deploy non-emergency global banner
A site-wide (global) banner can be activated to convey important information on GOV.UK which is not deemed emergency-level information. Unlike the emergency banner, we show a user the global banner no more than 3 times, by storing the view count in a cookie.
The content of the global banner is contained in
app/views/components/_global_bar.html.erb in Static.
Activate the global banner
- Update the variables
link_textwith the relevant info where applicable, otherwise set them to
- Change the value of
- Optional: set the
trueif the banner should not disappear after being seen 3 times.
- Deploy Static. See the guidance on deploying Static.
Exclude specific pages from showing the banner
The target page linked to from the banner will automatically not show the banner.
To prevent other pages from showing the banner, add them to
Update the global banner version
The number of times a user has viewed the banner is stored in a
global_bar_seen cookie. Once the view count reaches 3, that user will not see
that banner again, even if new banner content is deployed.
The user will only see the banner again after the third time if either:
global_bar_seencookie expires, or
versionfield in their cookie differs from the value of
To show the global banner again for all users including those who have already seen it 3 times:
Remove the global banner
app/views/components/_global_bar.html.erb, change the value of
- Deploy Static.
Troubleshoot the banner
- Check that your rollout of Static succeeded, for example by checking when Static was last synced in Argo CD (staging, production).
- Make sure you are looking at the same environment where you deployed your change to Static.
- Use a fresh private/Incognito window so that your testing is not affected by browser state such as cookies or cache.
- Wait 5–10 minutes for caches to expire, then repeat the previous step.
If the banner is still not showing, there may be a bug or misconfiguration somewhere. You might be able to work around the problem temporarily until the underlying issue is fixed.
- Try clearing the frontend memcache. Log into the AWS web console for the appropriate environment, find frontend-memcached-govuk under Elasticache, Memcached clusters and press the Reboot button. The UI will ask you to confirm the request.
- Consider clearing the page from the CDN cache. Most pages expire from the CDN cache within 5 minutes so this is unlikely (though not impossible) to be the issue.