The Privacy Suite for WordPress

Enable consent on async javascript without script center

Get compliant today in the European Union, United States, Canada, United Kingdom, Australia & South Africa with the only Privacy Suite for WordPress that offers a fully-featured plugin for Worldwide Compliance.

If you’re using a code manager outside of Complianz to add javascript, for example, a Remarketing Pixel from Google, you need to add some code to enable consent for javascript that uses asynchronized loading.

NB. With code managers outside of Complianz, we mean either adding code yourself to the header.php or using a plugin to do this for you. This article is not for Google Tag Manager users.

Recognizing async javascript

Async scripts are easily recognized by looking at the beginning line of your javascript, for example:

Below the comment you will find script aysnc src=. This signifies a script which loads outside of the normal hierarchy and will load simultaneously with other scripts, without being dependent on the order.

Enabling consent on async javascript

Async scripts do not work in the script center, yet. In this case you will add the code to your header.php, or footer if preferred. You can also use a plugin like Header Footer Code Manager. To enable consent on specific javascript, you can use the following attributes for your scripts:

For the above example this will look like:

Recent articles

The Privacy Suite for WordPress
Get compliant today with the only Privacy Suite made for WordPress

Categories

Popular articles

LGPD Brazil and WordPress

The “Marco Civil” and the Brazilian General Data Protection Law (LGPD) In Complianz 5.4 we will add full support for the Civil Rights Framework for

Read More

Join our mailing list - 8 Tips & Tricks in your inbox over the next 8 weeks!