Our.Umbraco.CookieConsent 0.0.3

Suggested Alternatives

Our.Umbraco.CookieConsent 0.0.2

dotnet add package Our.Umbraco.CookieConsent --version 0.0.3
                    
NuGet\Install-Package Our.Umbraco.CookieConsent -Version 0.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Our.Umbraco.CookieConsent" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Our.Umbraco.CookieConsent" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Our.Umbraco.CookieConsent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Our.Umbraco.CookieConsent --version 0.0.3
                    
#r "nuget: Our.Umbraco.CookieConsent, 0.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Our.Umbraco.CookieConsent@0.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Our.Umbraco.CookieConsent&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Our.Umbraco.CookieConsent&version=0.0.3
                    
Install as a Cake Tool

Our.Umbraco.CookieConsent

Umbraco Marketplace NuGet Downloads GitHub License

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.

Configuration

  1. 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.

  2. Customize appearance and behavior
    Use the dashboard to configure:

    • Position of the banner on your site.
    • Categories of cookies to display.
    • Layout and styles to match your site’s design.
    • ...
  3. Manage translations

    • Translations for the popup text can be managed in the Translations section of Umbraco, under the key Our.Umbraco.CookieConsent.
    • The available languages for the cookie consent popup depend on the languages configured for your Umbraco site.
  4. 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")
    

Scripts by category

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:

  • Navigate to the "Scripts" section in the dashboard
  • Add a new entry with the target category (Analytics, Marketing, etc.)
  • Paste your script using safe JS, such as dynamic script injection

Important: HTML <script> tags cannot be directly used inside JavaScript blocks. Instead, use JavaScript to create and inject scripts dynamically.

Example: Google Analytics script

    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

Credits

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.3 243 7/7/2025 0.0.3 is deprecated because it has critical bugs.
0.0.2 226 4/21/2025
0.0.1 539 12/6/2024