If you’re running a Joomla website that uses cookies or tracking scripts (like Google Analytics, Google Search Console, etc.), GDPR compliance is essential. With Consentise, you can add a privacy-compliant cookie banner easily, without needing third-party Joomla extensions.
This guide will walk you through the steps to integrate Consentise cookie scripts directly into your Joomla site.
Step 1: Generate Your Cookie Banner Scripts
- Visit the Consentise Generate Script page.
- Enter:
- Your website domain (e.g.,
www.example.com
) - Privacy Policy URL (e.g.,
https://www.example.com/privacy-policy
) - Default Language (e.g.,
en
,fr
,de
, etc.)
- Your website domain (e.g.,
- Click Generate Script to receive two code snippets:
- A Mandatory Script for the
<head>
section. - A Consent Banner Script for the
<body>
section.
- A Mandatory Script for the
Step 2: Add the Mandatory Script in the <head>
To ensure no cookies are set before consent, place this script in the head section of your Joomla site.
Edit Joomla Template Files
- In your Joomla Admin panel, go to:
System
→Site Template Styles
→ click your active template →Template Files
. - Open the
index.php
file of your template. - Locate the
<head>
tag and insert the Mandatory Script just before any analytics or tracking code, ideally before the closing</head>
tag:
<script>
// Define dataLayer and the gtag function.
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('set', 'url_passthrough', true);
gtag('set', 'ads_data_redaction', true);
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
// UET default settings
window.uetq = window.uetq || [];
window.uetq.push('consent', 'default', {
'ad_storage': 'denied'
});
</script>
Step 3: Add the Consent Banner Script in the <body>
- Still in the same index.php file, scroll down and locate the
</body>
tag. - Paste the Consent Banner Script just before the closing
</body>
tag:
<script src="https://www.consentise.com/v1.2/consent-min.js"
data-cookiedomain="www.website.com"
data-privacy-policy-url="https://www.website.com/privacy-policy"
data-preferred-color="#4fa5d3"
data-banner-position="bottom"
data-default-language="en"
defer>
</script>
Replace www.website.com and the policy URL with your actual site information.
Step 4: Save & Test the Banner
After saving changes:
-
Open your site in an incognito/private window.
-
Confirm:
- The cookie banner appears.
- No tracking scripts are triggered before the user gives consent.
- User choices are remembered on reload.
You can use browser developer tools or extensions like Tag Assistant to verify correct behavior.
Optional: Use a Custom Module (Alternative Method)
If you don’t want to modify template files:
- Go to Content → Site Modules → New.
- Choose Custom module.
- Set the Position to debug or footer.
- In the Editor, switch to Code view and paste the Consent Banner Script.
- Save and publish the module.
To insert the Mandatory Script, repeat the same steps but assign it to a position that loads in the <head>
, or use a plugin like “Head Tag”.
By following these steps, your Joomla website will be fully GDPR-compliant with Consentise handling cookie preferences and tracking consent.