GDPR Cookie Consent

Last modified by Sarah Buliga on 2026/08/11 08:22

GDPR Cookie Consent

Cookie consent popup with different configuration options.

CookieBanner1.png
CategoryApplication
Active Installs34
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Minimal XWiki version supportedXWiki 15.10
SourcesIssues

The GDPR Cookie Consent app allows you to achieve and maintain cookie compliance. With this app you can group cookies into categories. You can then set up a screen that asks for your user's consent to activate or disable the cookies or trackers.

Information

Please note that the GDPR Cookie Consent app needs to be configured in order to register the selections done by the users. Otherwise, it will only remain as a pop-up and the selected options would not affect the analytics results. For more details on how to configure the app, check out the Documentation tab, in the section "Configure the GDPR Cookie Consent app from the XWiki Administration".

Cookies can be grouped in the following categories, depending on the different tool types:

  • necessary: cookies which are mandatory and cannot be disabled
  • preferences: cookies or trackers which are optional and enabled by default; they are only used to remember the user preferences
  • statistics: cookies or trackers which are optional and enabled by default; they are used to record anonymous statistics
  • marketing: cookies or trackers which are optional and disabled by default; they can record personal information

The Consent screen

When the GDPR Cookie Consent app is active, users will see the below screen. After clicking "I accept all cookies", the cookie screen will disappear.

CookieBanner1.png

Configuring the user preferences

If the users would rather prefer to select specific cookies that they would consent to, they need to click on the "Configure" button. They will be provided with the cookies categories to choose from, and when they have finished, they would click on the "OK" button.

CookieBanner2.png

External resources

Configure the GDPR Cookie Consent app from the XWiki Administration

How to make the app work? This section is dedicated to the administrators of the wiki, as they would first need to configure the GDPR Cookie Consent app in order to activate it.

As an administrator, please go to the Global Administration of your wiki > the section Other > the section GDPR Cookie Consent Setup.

The app administration offers you the following features:

  • From the application Administration you’ll be able to see the accepted cookies for the current user.
  • You’ll be able to configure the look and the content of the pop-up screen.
  • Most importantly, you will need to add the cookie script or tracker to the desired three categories (preferences, statistics and marketing) in order to activate the app.

Where do you get the cookie scripts or trackers? Depending on your tool, you will need to find the tracking code on the tool, copy it and then paste it in the selected category (for example, analytics tools could be matched with the statistics category). This action will connect the tool with the GDPR Cookie Consent app.

Information

Extra Step

Please note that if you already have a tracking code from a tool added to your wiki (for example from Google Analytics, Matomo or a tracker from a Marketing Automation or Sales tool), this would need to be removed or modified (see the section "Advanced usage: Modifying existing scripts/code to respect the user's options"). Afterwards, add the tracking code or script on the GDPR Cookie Consent Setup section, in the chosen options.

Information

Extra location for the Cookie Consent Setup

Note that you can also go to the dedicated GDPR Cookie Consent Setup page where you can do the same settings presented above.

cookie-consent-setup-page.png

Configuration fields

 
The settings are grouped in the administration section as follows.

General
 

FieldDefaultDescription
ActiveyesWhen set to no, nothing is emitted and the pop-up never appears.
Typebarbar displays a full-width strip, box a centred panel of maximum 400px.
Positionbottomtop or bottom.
Animationslidenone, slide or fade (1 second).
Background colorFFFFFFBackground of the pop-up.
Foreground color333333Text colour of the pop-up.
Opacity1.0From 1.0 down to 0.0 in steps of 0.1, applied to the whole pop-up.

Customize labels
 

FieldDefaultDescription
Modify the "necessary" / "preference" / "statistics" / "marketing" label(empty)Overrides the checkbox label. When left empty, the translated default is used.
Active cookie typesall fourWhich categories are offered in the configuration pane, and in which order. If none is selected, the pop-up does not appear at all.
Localecurrent localeRead-only. Identifies the language this configuration applies to.

Letting visitors change their choice

 
Give any clickable element the id ResetCookies. Clicking it clears the stored choice and re-opens the pop-up:

{{html}}<a href="#" id="ResetCookies">Reset cookie options</a>{{/html}}

Advanced usage: Modifying existing scripts/code to respect the user's options

This situation is met when there already is an existing script added on the instance from a chosen tool. If it would not be removed, the tech administrator could add a wrapper code to the tool script in order to read the options from the GDPR Cookie Consent app. Check out the details below for this procedure.

FieldDescription
Preferences ScriptsCode injected on every page once the visitor has consented to preferences.
Statistics ScriptsThe same, for statistics.
Marketing ScriptsThe same, for marketing.

The GDPR Cookie Consent app actually adds a cookie itself in order to remember the visitor's preferences.

This cookie is called "gdprSettings" and stores an array which can have some or all the following values depending on what the visitor chooses:

necessary,preferences,statistics,marketing

The example below shows one way to determine if a particular option was chosen using the velocity scripting language:

#set($gdprSettings = $util.decodeURI($xwiki.getUserPreferenceFromCookie("gdprSettings")))
#set($gdprArray = $gdprSettings.split(','))
#set($hasStatistics = $gdprArray.contains('preferences'))
#set($hasPreferences = $gdprArray.contains('statistics'))
#set($hasMarketing = $gdprArray.contains('marketing'))
#if("${hasStatistics}" == "true")
  ##Insert here the code that will be executed only if the preferences and statistics checkboxes were checked
#end

The gdprSettings macro

It takes no content, supports inline mode and accepts one optional parameter:
 

ParameterMandatory?DefaultDescription
gdprHasNononeOne of preferences, statistics or marketing. Outputs true or false. When omitted, the macro outputs the full list of accepted categories.
{{gdprSettings /}}
{{gdprSettings gdprHas="statistics" /}}

If the visitor has not answered yet, the macro displays "The current user has not yet accepted the cookie policy" instead.

Thus, if there are applications or tracker in another part of the wiki which were not set to pass through the GDPR Cookie Consent app and cannot be resumed to html tags, they can be modified to read the users options before executing the tracking code.

This standard application can be installed using the XWiki extension manager. More information on how to install and manage extensions can be found on the xwiki.org community website.

Options

The price is per year and varies depending on the support level and the number of users.

Support / Users
GDPR Cookie Consent is part of the XWiki Pro package. By purchasing this package, you will benefit from more extensions at a better price. Check the full offer in XWiki Pro! The GDPR Cookie Consent can be purchased individually only via online order (credit card payment), following the “How to Buy” procedure described below. The application is part of the XWiki Pro package, which can be purchased through online order for up to 1000 users, or through manual order (bank transfer payment) by contacting sales@xwiki.com.

Benefits

What do you get when you purchase an XWiki extension?

1/3 years license

By purchasing an XWiki extension license, you'll benefit from it during one or three years, depending on the chosen engagement period.

Free updates

You benefit from all the extension updates during one year. You are always up to date.

Support included

If you are facing an issue, you can reach the XWiki support. Our team is always available to help.

How to Buy

To buy, install this extension from inside your XWiki instance and follow the instructions.

Release notes

Extension details

Information

This information is only displayed to Administrators. Your users can't see this tab.

License

  • GNU Lesser General Public License 2.1

Sources

Issues

Type

  • xar

Developed by

Compatibility

  • Requires XWiki 15.10 or above.
Success

Installable with the Extension Manager

Dependencies

  • org.xwiki.platform:xwiki-platform-sheet-ui 15.10
  • org.xwiki.platform:xwiki-platform-administration-ui 15.10