
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Our.Umbraco.CookieConsent
Advanced tools
Our.Umbraco.CookieConsent: A Umbraco package for adding a customizable cookie consent banner to your Umbraco site. Powered by the Orestbida/CookieConsent library.
Easily add a configurable cookie consent banner to your Umbraco site. Features include a dashboard for customizing behavior, appearance, and translations, using the Orestbida/CookieConsent library.
Access the dashboard
Navigate to the Settings tab in the Umbraco Backoffice, and then select the Cookie Consent dashboard to manage all settings related to your banner.
Customize appearance and behavior
Use the dashboard to configure:
Manage translations
Our.Umbraco.CookieConsent
.Render the banner in your layout
To display the cookie banner on your website, add the following line in your main layout file (_Layout.cshtml
or equivalent):
@await Component.InvokeAsync("Cookie")
You can define custom scripts that are injected only after user consent, based on the selected cookie category (e.g. Analytics, Marketing, etc.).
To do so:
Analytics
, Marketing
, etc.)Important: HTML <script>
tags cannot be directly used inside JavaScript blocks. Instead, use JavaScript to create and inject scripts dynamically.
var gtagScript = document.createElement('script');
gtagScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-CN4GDXXXXX';
gtagScript.async = true;
document.head.appendChild(gtagScript);
gtagScript.onload = function () {
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
window.gtag = gtag;
gtag('js', new Date());
gtag('config', 'G-XXXX');
};
This logic will only be executed if the user accepts the analytics category
This package is a simple integration of the CookieConsent library, created by Orest Bida.
Cookie icons used in this project were created by Rohim - Flaticon.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.