<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: blocking LinkedIn cookies using OneTrust cookie consent banner script in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/787595#M33972</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/438164"&gt;@ICaceres&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To block LinkedIn cookies using the OneTrust cookie consent banner script, you can use the following code within the &amp;lt;script type="text/plain" class="optanon-category-C0002"&amp;gt; tag&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;&amp;lt;script type="text/plain" class="optanon-category-C0002"&amp;gt;
  // 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;
    }
  }
&amp;lt;/script&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will check if the &lt;CODE&gt;_lipt&lt;/CODE&gt; 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 &lt;CODE&gt;window.onload&lt;/CODE&gt; function.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 07:08:01 GMT</pubDate>
    <dc:creator>himanshurauthan</dc:creator>
    <dc:date>2023-04-28T07:08:01Z</dc:date>
    <item>
      <title>blocking LinkedIn cookies using OneTrust cookie consent banner script</title>
      <link>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/787254#M33960</link>
      <description>&lt;P&gt;how we can&amp;nbsp;block LinkedIn cookies using the OneTrust cookie consent banner script?&lt;/P&gt;&lt;P&gt;we now, have to use:&lt;BR /&gt;&amp;lt;script type="text/plain" class="optanon-category-C0002"&amp;gt;&lt;/P&gt;&lt;P&gt;//what is the code to block the LinkedIn cookie?&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;because :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _hsq.push(['doNotTrack']);&amp;nbsp; or&amp;nbsp; _hsp.push(['doNotTrack']); doesn't work&lt;BR /&gt;Best Regards.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:03:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/787254#M33960</guid>
      <dc:creator>ICaceres</dc:creator>
      <dc:date>2023-04-27T14:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: blocking LinkedIn cookies using OneTrust cookie consent banner script</title>
      <link>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/787595#M33972</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/438164"&gt;@ICaceres&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To block LinkedIn cookies using the OneTrust cookie consent banner script, you can use the following code within the &amp;lt;script type="text/plain" class="optanon-category-C0002"&amp;gt; tag&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;&amp;lt;script type="text/plain" class="optanon-category-C0002"&amp;gt;
  // 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;
    }
  }
&amp;lt;/script&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will check if the &lt;CODE&gt;_lipt&lt;/CODE&gt; 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 &lt;CODE&gt;window.onload&lt;/CODE&gt; function.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 07:08:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/787595#M33972</guid>
      <dc:creator>himanshurauthan</dc:creator>
      <dc:date>2023-04-28T07:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: blocking LinkedIn cookies using OneTrust cookie consent banner script</title>
      <link>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/1100316#M41864</link>
      <description>&lt;P&gt;I know it's been a few months, but you can look into other cookie banner solutions that are much simpler to implement. They're called &lt;A href="https://www.ketch.com/blog/posts/consent-management" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;consent management platforms&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;(CMPs). You can start with &lt;A href="https://www.ketch.com/ketch-free-cookie-banner" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;free CMP&lt;/SPAN&gt;&lt;/A&gt; solutions first too. Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 03:34:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/blocking-LinkedIn-cookies-using-OneTrust-cookie-consent-banner/m-p/1100316#M41864</guid>
      <dc:creator>StephaneLM</dc:creator>
      <dc:date>2025-01-28T03:34:20Z</dc:date>
    </item>
  </channel>
</rss>

