Implement in the source code
To implement the Consent Pop-up in the source code, insert the script as high in the website's <head> tag in the HTML code as possible.
The data-culture="EN" is used to control the languages (in this case it is calling the English language). To change the language, set the data-culture attribute to a different language code using the table below. Please make sure that the selected languages are enabled in the “Languages and Settings” under the specific consent solution in the Cookie Information Platform.
Setting the language in your CMS
When using either the pop-up script or policy-script the way you define which language to pull from the Consent Solution is by entering a two-letter ISO language code in the data-culture attribute on the scripts. By using server-side code, like PHP or asp .NET you should be able to store a dynamic language code, pulled from the CMS or the language-plugin of your choice, in a variable to be used in the data-culture attribute.
Example from WordPress
<?php $languageCode = substr(get_locale()), 0, 2);?>
Example from Joomla:
<?php $lang = JFactory::getLanguage(); $languages = JLanguageHelper::getLanguages('lang_code'); $languageCode = $languages[$lang->getTag()]->sef;?>
The examples above are based on a PHP created CMS and will differ from other server-side frameworks. We suggest you consult with your agency or developer on how it would work on your CMS.
Implement with WordPress
- The plugin will automatically detect the language of your site, but it only works with one language. See more on multiple languages using WPML below.
- The plugin will automatically find and block Youtube and Pixel cookies, but the rest has to be blocked using our Cookie Control SDK as per usual. See more on that here
- ONLY enable TFC if you are also utilizing the TFC template in the pop-up section of the Consent solution. If you are NOT using the TFC template this will render the pop-up useless.
Implementing the consent pop-up in the code
- Open the dashboard on your WordPress website.
- Go to Appearance - Editor in the left-hand menu.
- Locate header.php. This can have various names depending on the template but will always be explained as (header.php) underneath.
- This is the HTML of your <head> on all your pages. The Consent Pop-up must be implemented here to be shown on all the pages.
- Insert the CookieConsent script between the opening and closing <head> tag.
- Set the data-culture to the language of the Consent pop-up.
- Save the change by pressing “Update File” at the bottom of the page.
A multi-language site using WPML
If you are using the plugin: WPML to change the language on your website, you need to grab the lang-code from the plugin to combine it without data-culture in the consent pop-up script. The script will then look like this:
Implement With Joomla
By using our Joomla plugin you also get an easier way to implement the other privacy widgets. Plus auto-blocking youtube videos and external js scripts.
Implementing the Consent Pop-up directly in the code
- Login to your Joomla administration panel and navigate to the template section in the top menu.
- Go to Extension - Templates - Templates
- Choose the active template where you want to insert the consent pop-up.
- Choose the index.php file from the side-navigation and insert the script just below the meta-tags and before the closing </head> tag as shown below.
- Save the change by pressing “Save & Close” at the top of the page.
Implement with Wix
- Go to Settings - Tracking Tool & Analytics
- Choose: Custom </>
- Then insert the Consent Pop-up script in the code-field and set the code to be placed in the HEAD.
Implement with Squarespace
Go to Settings - Advanced - Code injection
Place the script in the text area for the HEAD section like illustrated below: