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.
The list of hosts is getting from cookie scan results and the same will be displayed on the Auto Cookie Blocking configuration.
When you enable Auto Cookie Blocking you can select and categorize third-party hosts that you want to block.
When any categories (other than Essential) have not been consented by the website user, the scripts of the hosts under those categories will not be loaded on the website.
When the website user consents to those categories, then the scripts of the hosts will be loaded.
When you configure the cookie banner, you can configure the automatic cookie blocking as follows:
In Banner Configuration, under Advanced Features, enable Cookie Blocking.

Select Auto and save your configuration.
Now, in the side menu, click Auto Cookie Blocking.

- The Auto Cookie Blocking page will appear. Switch to Available Tag tab on the page by clicking on it.

A list of hosts appears in the cookie scan results.

You can add as many hosts as you want by clicking the "+" icon or by selecting multiple tags and then clicking on "Add Selected" button.
- By default, the status of all hosts shows DISABLED, which means tag blocking is disabled, and these hosts will appear on the website on the user side.
After clicking on the "+" or "Add Selected" button all the selected tags will populate under the "Blocked Tags" section. Now, click on the "Blocked Tags" tab.
Click
right to the host that you want to block.

Edit script popup appears. Choose a suitable category from the drop-down menu for the chosen host & select all the available parameters under the Dynamic Params dropdown. Additionally, you have the option to choose whether a host loads implicitly or explicitly for a certain regulation.
Once the selection is done, click the Save button.

Note:
For CCPA & Global Regulation:
Implicit: Without taking into account the user's permission, the host that is set as implicit will load first.
Explicit: Before loading the host or script, the host that is selected to be explicit will need consent for the designated category.
For GDPR & DPDPA Regulation:
By default, the explicit method is applicable.
After completing the configuration, click on the Go to Cookie Banner link to go to the Banner Configuration and Publish the banner.

For best results ensure that tags are loaded in the following order:
Privacy Pillar CMP
All the Blocked tags
Note:
After publishing the cookie banner, whenever you make any changes in Auto Cookie Blocking, you must publish the banner again to reflect the changes.
If the desired tag is not found under the "Available Tags" section then you can add it yourself by clicking on "Add Manually" button OR you can re-run a deep scan with higher number of pages and then verify the same under the "Available Tags" section.
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.
Change type attribute from text/javascript to text/plain (if type attribute is missing, just add it)
If you have scanned your website for cookies, add 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:
Essential cookies: essential
Functional cookies: functional
Advertising cookies: advertising
Analytics cookies: analytics
Social media cookies: social_media
Unclassified & Unknown cookies: unknown
All JavaScript with such attribute changes will only execute if the user agreed with the cookie policy.
Note: It is possible to assign third-party scripts to the above categories, this is helpful if the third-party script sets cookies from the categories and the user must agree to all cookie categories that are set by the script.
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.
Change src attribute name to az-data-src.
If you have scanned your website for cookies and have category checkboxes in the cookie consent pop-up, add 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"/>