Free Google Tag Manager Compatible Covid-19 Banner Code | No Developer Required

April 10, 2020

Free Google Tag Manager Compatible Covid-19 Banner Code | No Developer Required

Since the Covid-19 pandemic hit South Africa, Swipe ix has been looking at all the little ways in which we as a company can do our part in assisting the South African online industry to cope with the current global crisis we find ourselves in. The South African government recently announced that all domains are required to have a Covid-19 banner present on their websites to combat fake news and assist website visitors in obtaining information regarding the Covid-19 crisis. Swipe immediately grasped this opportunity to develop a simpler version of the government banner, which can be implemented without the assistance of a developer, making it easier for companies to comply with the recent government mandate.

Covid-19 Website Banner Issued By The Government

The government provided banner code can be tricky to implement and requires the assistance of a developer, which most companies do not have access to during the lockdown.Swipe iX originally developed the single-line code to aid our clients during the Covid-19 crisis. Numerous clients requested an alternative to the government issued Covid-19 banner, which resulted in Swipe iX developing the GTM compatible code, now available to the general public.

What Separates Swipe’s Banner Code From The Government Issued Code?

Our banner is less intrusive than the banner provided by the government, offers website visitors the option to close the banner if it obstructs website content, and it's a mere single line of code that wouldn't require source code updates or deployments to activate.“Swipe’s version of the Covid-19 banner allows companies to comply with government regulations, whilst mitigating the banner influence on the overall user experience,” says Deon Heunis, Chief Technical Officer at Swipe iX. “Our banner design is neat and to the point, does not obstruct the website content and offers users the option to close the banner window if it proves disruptive to their original website visit intent.”

Covid-19 Website Banner Developed By Swipe iX

After Swipe iX carefully analysed the government issued banner code, the need for a simpler, single line code, which can be implemented by anybody, became a clear way of helping the online community comply with the government mandate. The nature of the code developed by Swipe differs from the government issued code in that the generated HTML is contained in the Javascript file whereas the gov code is a raw HTML file which could lead to errors during implementation if any of the code were to be copied incorrectly

How To Implement The Covid-19 Banner Code Using GTM

1. Navigate to your Google Tag Manager account and click on the container (website) that you want to add the banner to.

2. Select the “Add a New Tag” option.

3. Click on “tag Configuration” and select the “Custom HTML” option.

4. Copy and paste the swipe code into the HTML field: <script id="swipe-covid-banner" src="" async></script>

5. Select the “Triggering” setting and select “All Pages” to ensure that the banner appears on every webpage on your website.

6. Save the tag and rename it to “Covid-19 Banner”. Be sure to publish the container after completing the steps above to ensure that your new tag is saved and added to your website.

Swipe iX developed the Covid-19 banner code with the sole purpose of assisting South Africans and alleviating a small portion of the pressure felt by businesses during these tough times. As such, the single line of code is completely free, with no strings attached, and anyone can make use of it. If you struggle with implementation or have any questions, get in touch! We’re more than happy to assist in any way we can. Be sure to share this useful article with your company and fellow South Africans - you never know who might benefit from it.

Lourens de Villiers

Senior Front End Engineer

Swipe iX Newsletter

Subscribe to our email newsletter for useful tips and valuable resources, sent out monthly.