Third-party cookies are cookies set by websites that are outside of your current domain. They are mostly used to track users between websites and display more relevant ads on the domain.
For example, the cookies used by Facebook like-button on your domain, support chat functionality provided by a third-party service, and so on. Another example is an advertising service (ex: Google Ads) which also creates a third-party cookie to monitor which websites were visited by each user. This is the main technology used to show you the product ads that you previously searched for on a completely different website.
If you want your domain to comply with the latest regulations, such as CCPA and GDPR, you might want to block those third-party cookies unless the user specifically agreed to use them. This article explains how to establish cookie blocking using Cookie-Script as a cookie compliance solution.
Privacy Pillar provides Automatic Cookie Blocking, a special feature to block cookies at your website until the user gives consent through Privacy Pillar's cookie banner. With this feature, you can block the cookies of any category except essential cookies and when the user allows any categories through the cookie banner, the set cookies under those categories will be enabled.
When you configure the cookie banner, you can configure the automatic cookie blocking as follows:







You can block third-party cookies by blocking the whole third-party functionality. This means Google Analytics, Facebook buttons, AdSense, and anything else that you block won't work until the user agrees with cookie consent. You can manually achieve this in the following ways:
To block third-party cookies, find a JavaScript code that sets third-party cookies and follow the steps.
type attribute from text/javascript to text/plain (if type attribute is missing, just add it)az-data-category attribute. Below is a list of available values for this attribute. If you don't have cookie category choices, you can skip adding this attribute.If all the cookies from a third-party script are assigned to a certain category, you should include that category in az-data-category attribute of the script.
The az-data-category attribute should have a value of the cookie category that this third-party JavaScript is assigned to. This means that whole third-party service cookies should be assigned to one of the following categories (which is usually the case). Possible category values are:
essentialfunctionaladvertisinganalyticssocial_mediaunknownAll JavaScript with such attribute changes will only execute if the user agreed with the cookie policy.
To use multiple categories, list them all, separated by a space. In this case, a third-party script will be included if the user agrees to all categories listed in the az-data-category attribute:
<script type="text/plain" az-data-category="funtional">Change code from:
<script src="/js/myscript.js"></script>Change code to:
<script type="text/plain" az-data-category="functional" az-data-src="/js/myscript.js"></script>To block third-party cookies set with iframe (like YouTube videos), find an iframe code that is setting third-party cookies and follow the steps.
src attribute name to az-data-src.az-data-category attribute. Use the same list of categories as described in the previous section of this article. If you don't have cookie category choices, you can skip adding this attribute.All iframes with such attribute changes will only show up if the user agreed with the cookie policy.
Change code from:
<iframe height="350" src="https://www.youtube.com/embed/xxxxxxxxx" frameborder="0" allowfullscreen></iframe>Change code to:
<iframe height="350" az-data-src="https://www.youtube.com/embed/xxxxxxxxx" alt="Please accept cookie policy first" az-data-category="functional" frameborder="0" allowfullscreen></iframe>In the same manner, you can block image/object elements from setting third-party cookies.
Change code from:
<img src="http://example.com/image.jpg"/>Change code to:
<img az-data-src="https://picsum.photos/200/300/?blur" az-data-category="functional"/>