Pop-up implementation

This article covers all you need to know about the basic pop-up script implementation

Piotr avatar
Written by Piotr
Updated over a week ago

Pop-up script

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.

For general implementation, use this script:

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

If you would like to utilize the Consent Mode v2, use the following script:

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

If your consent solution was created after 12th of February 2024, your default consent pop-up template and implementation script include Consent mode v2. See how to revert the changes back here.

Finding the pop-up script

Navigating to the platform and into your consent solution, you should find the installation tab on the menu on the left-hand side. In the code box near the top of the page, there will be a script that you will need to copy and insert as high in the website's <head> tag, in the HTML code, as possible.

*the screenshot above visualizes the default uc.js script, if you would like to utilize the Consent mode v2, please refer to this script

Selecting language

The 'data-culture= "EN"' attribute controls the language that the pop-up will appear in on the site: in this case, it will be displayed in the English language. To change the language, set the data-culture attribute to a different language code using the table below.
Please also make sure that the selected languages are enabled in the "Settings" tab under the specific consent solution in the platform as well.

Set up the language in your CMS.

When using either the pop-up script or policy script, you define which language to pull from the consent solution by entering a two-letter ISO language code in the data-culture attribute on the scripts. Using server-side code, like PHP or asp .NET, you can store dynamic language code. This code can be pulled from the CMS or language plugin of your choice and applied as a variable 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

Data-culture

Language

Data-culture

Language

AR

Arabic

LT

Lithuanian

BG

Bulgarian

LV

Latvian

CA

Catalan, Valencian

MS

Malay

CS

Czech

NB

Norwegian Bokmål

DA

Danish

NN

Norwegian Nynorsk

DE

German

NO

Norwegian

EL

Modern Greek

NL

Dutch, Flemish

EN

English

PL

Polish

ES

Spanish, Castilian

PT

Portuguese

ET

Estonian

RO

Romanian

FI

Finnish

RU

Russian

FR

French

SK

Slovak

HE

Modern Hebrew

SL

Slovene

HI

Hindi

SQ

Albanian

HR

Croatian

SR

Serbian

HU

Hungarian

SV

Swedish

ID

Indonesian

TH

Thai

IS

Icelandic

TR

Turkish

IT

Italian

TW

Taiwanese

JA

Japanese

UK

Ukrainian

KO

Korean

VI

Vietnamese

KL

Greenlandic

ZH

Chinese

Related articles:

Did this answer your question?