Umbraco DXP
CMSCloudHeartcoreMarketplace
  • Umbraco DXP
  • Sustainability Best Practices
  • Commercial products
    • Umbraco Forms
    • Umbraco Deploy
    • Umbraco Workflow
    • Umbraco Commerce
    • Umbraco UI Builder
    • Umbraco Engage
    • Commercial Products, Relations and dependencies
  • Marketplace
    • Introduction
    • Listing Your Package
    • Package Telemetry Data
  • Packages
    • Authorized Services
    • Storage Providers
  • Integrations
    • Categories
    • ActiveCampaign
    • ActiveCampaign with Umbraco Forms
    • Algolia
    • Aprimo
    • CookieBot
    • CommerceTools
    • Dynamics
    • emerchantpay with Umbraco Forms
    • Google Search Console
    • HubSpot
    • HubSpot with Umbraco Forms
    • inriver
    • Semrush
    • Shopify
    • Zapier
    • Zapier with Umbraco Forms
Powered by GitBook
On this page
  • Package Links
  • Minimum version requirements
  • Configuration
  • Templating
  • Custom Implementations

Was this helpful?

Edit on GitHub
Export as PDF
  1. Integrations

CookieBot

Details an integration available for Cookiebot, built and maintained by Umbraco HQ.

PreviousAprimoNextCommerceTools

Last updated 2 months ago

Was this helpful?

This integration provides an implementation model for the banner and declaration.

Package Links

Minimum version requirements

To ensure compatibility, check the Dependencies tab on NuGet for the required Umbraco CMS version. For example, see .

Configuration

The following configuration is required for the Cookiebot scripts to be loaded correctly:

appsettings.json
"Umbraco": {
  "Cookiebot": {
    "Settings": {
      // CBID = Cookiebot Identifier
      "Id": "[YOUR_CBID]"
    }
  }
}

Templating

The banner script needs to be inserted as the first script of the website, by placing it within the <head></head> tag using this syntax:

@await Html.PartialAsync("~/Views/Partials/UmbracoCms.Integrations/Analytics/Cookiebot/Banner.cshtml")

The Declaration script can be added to whatever page you want, using this syntax:

@await Html.PartialAsync("~/Views/Partials/UmbracoCms.Integrations/Analytics/Cookiebot/Declaration.cshtml")

Both scripts "pick up" CBID from the website's configuration file and update the details accordingly.

Custom Implementations

This integration demonstrates how an Umbraco package can be used as an integration with a script-based provider, using partial views and the IConfiguration interface.

You can use this package as a reference for creating integrations with other providers using scripts:

  1. Create a new Razor class library for your integration.

  2. Add partial views where you insert your custom script code.

  3. Inject the IConfiguration interface into your view: @inject Microsoft.Extensions.Configuration.IConfiguration Configuration.

  4. Use Configuration[YOUR_SETTINGS_PATH:KEY] to retrieve the required configuration values.

  5. Add umbraco-marketplace.json file with Marketplace details of the package.

The package is a reusable that will allow editors to load the Cookiebot Banner and Declaration scripts.

Once your integration is ready, all that remains to do is to .

Cookiebot
NuGet install
Source code
Umbraco marketplace listing
Umbraco.Cms.Integrations.Analytics.Cookiebot
Razor class library
deploy the package to NuGet