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.

<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>

Sample implementation

Consent_Pop-up_Sample_implementation.png

Selecting language

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);?>
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="<?php echo $languageCode ?>" type="text/javascript"></script>

Example from Joomla:

<?php $lang = JFactory::getLanguage(); $languages = JLanguageHelper::getLanguages('lang_code'); $languageCode = $languages[$lang->getTag()]->sef;?>
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="<?php echo $languageCode ?>" type="text/javascript"></script>

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.

Language Codes

List of language codes

Implement with WordPress

For easy integration, download our WordPress Plugin here

  1. 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.
  2. The plugin til 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
  3. 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.
Picture1.png
  • 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.
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>

Example:

Picture3.png

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:

<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="<?php echo ICL_LANGUAGE_CODE; ?>" type="text/javascript"></script>

Implement With Joomla

For easy integration, download our Joomla Plugin here

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
001.jpg
  • 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 mete-tags and before the closing </head> tag as shown below.
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>

Remember to set the data-culture to the language of the consent solution

  • Save the change by pressing “Save & Close” at the top of the page.
002.jpg

Implement with Wix

  1. Going to Settings - Tracking Tool & Analytics
  2. Choose: Custom </>
  3. Then insert the Consent Pop-up script in the code-field and Set the code to be placed in the HEAD of the code.
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>

Implement with Squarespace

Go to Settings - Advanced - Code injection

squarespace-menu.jpg

Place the script in the text area for the HEAD section like illustrated below:

<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>
mceclip1.png


Did this answer your question?