To block LinkedIn cookies using the OneTrust cookie consent banner script, you can use the following code within the <script type="text/plain" class="optanon-category-C0002"> tag
<script type="text/plain" class="optanon-category-C0002">
// Block LinkedIn cookies
window.onload = function() {
var liCookies = document.cookie.match(/(?:^|;)\s*_lipt=([^;]+)/);
if (liCookies) {
var cookieString = "_lipt=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = cookieString;
}
}
</script>
This code will check if the _lipt LinkedIn cookie exists and if it does, it will set it to expire immediately, effectively blocking it. The code is triggered when the page is fully loaded using the window.onload function.
Note that this solution may not be sufficient to fully block all LinkedIn cookies, as there may be other cookies that LinkedIn uses. It's recommended to review LinkedIn's cookie policy and adjust the code as needed to block all relevant cookies.
To block LinkedIn cookies using the OneTrust cookie consent banner script, you can use the following code within the <script type="text/plain" class="optanon-category-C0002"> tag
<script type="text/plain" class="optanon-category-C0002">
// Block LinkedIn cookies
window.onload = function() {
var liCookies = document.cookie.match(/(?:^|;)\s*_lipt=([^;]+)/);
if (liCookies) {
var cookieString = "_lipt=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
document.cookie = cookieString;
}
}
</script>
This code will check if the _lipt LinkedIn cookie exists and if it does, it will set it to expire immediately, effectively blocking it. The code is triggered when the page is fully loaded using the window.onload function.
Note that this solution may not be sufficient to fully block all LinkedIn cookies, as there may be other cookies that LinkedIn uses. It's recommended to review LinkedIn's cookie policy and adjust the code as needed to block all relevant cookies.