Conset Mode V2
Před ukončením podpory cookies 3. stran nás čeká ještě jedna výzva, a to je Consent mode V2. Už od 1. března 2024 ho musíte mít implementovaný na vašich webových stránkách. Pokud to neuděláte, přestanou se v Google Ads sbírat remarketingová publika a přiřazovat správně konverze k daným uživatelům.
Parametr ad_user_data se vyjadřuje k tomu, jestli mohou být neanonymizovaná data použita v reklamních systémech (např. poslána do Google Ads). Parametrem ad_personalization se dává souhlas k zařazení do publik pro remarketing.
https://matomo.org/faq/new-to-piwik/how-do-i-use-matomo-analytics-without-consent-or-cookie-banner/
https://matomo.org/faq/new-to-piwik/how-can-i-still-track-a-visitor-without-cookies-even-if-they-decline-the-cookie-consent/
https://www.youtube.com/watch?v=mvMyEVr_kMg
https://developers.google.com/tag-platform/devguides/consent#tag-manager
https://www.simoahava.com/analytics/consent-settings-google-tag-manager/
Nastavení cookie lišty:
1. zkopirovat composer.json z nemoricany.cz
2. provest composer update
3. zkopirovat z nemoricany /vendor/dmstr a /vendor/npm-aset
4. zkopírovat /messages/cs/cookie-nonsent.php
5. do config - components přidat
'cookieConsentHelper' => [
'class' => dmstr\cookieconsent\components\CookieConsentHelper::class
],
do y18n přidat
'cookie-consent*' => [
'class' => 'yii\i18n\PhpMessageSource',
],
6. do main.php přidat
<?php echo dmstr\cookieconsent\widgets\CookieConsent::widget([
'name' => 'cookie_consent_status',
'path' => '/',
'domain' => '',
'expiryDays' => 365,
'message' => \Yii::t('cookie-consent', 'We use cookies to ensure the proper functioning of our website. For an improved visit experience we use analysis products. These are used when you agree with "Statistics".'),
'save' => \Yii::t('cookie-consent', 'Save'),
'acceptAll' => \Yii::t('cookie-consent', 'Accept all'),
'controlsOpen' => \Yii::t('cookie-consent', 'Change'),
'detailsOpen' => \Yii::t('cookie-consent', 'Cookie Details'),
'learnMore' => \Yii::t('cookie-consent', 'Privacy statement'),
'moreInfo' => \Yii::t('cookie-consent', 'Detailed information can be found on the page'),
'visibleControls' => false,
'visibleDetails' => false,
'link' => '/prohlaseni-o-vyuziti-cookies',
'consent' => [
'necessary' => [
'label' => Yii::t('cookie-consent', 'Necessary'),
'checked' => true,
'disabled' => true
],
'statistics' => [
'label' => Yii::t('cookie-consent', 'Statistics'),
'cookies' => [
['name' => '_ga'],
['name' => '_gat', 'domain' => '', 'path' => '/'],
['name' => '_gid', 'domain' => '', 'path' => '/']
],
'details' => [
[
'title' => Yii::t('cookie-consent', 'Google Analytics'),
'description' => Yii::t('cookie-consent', 'Create statistics data')
],
[
'title' => Yii::t('cookie-consent', 'Goal'),
'description' => Yii::t('cookie-consent', '_ga, _gat, _gid, _gali')
]
]
],
'marketing' => [
'label' => Yii::t('cookie-consent', 'Marketing'),
'cookies' => [
['name' => '_ga'],
['name' => '_gat', 'domain' => '', 'path' => '/'],
['name' => '_gid', 'domain' => '', 'path' => '/']
],
'details' => [
[
'title' => Yii::t('cookie-consent', 'Google Analytics'),
'description' => Yii::t('cookie-consent', 'Create statistics data')
],
[
'title' => Yii::t('cookie-consent', 'Goal'),
'description' => Yii::t('cookie-consent', '_ga, _gat, _gid, _gali')
]
]
]
]
]); ?>
Do css přidat
.cookie-consent-popup {
animation-name: show;
animation-duration: 1s;
animation-timing-function: ease;
display: none;
/* position: fixed;
bottom: 0;
left: 0;
width: 100%;*/
z-index: 999999;
}
.cookie-consent-popup.open {
display: block;
opacity: 1;
animation-name: show;
animation-duration: 1s;
animation-timing-function: ease;
}
.cookie-consent-controls {
max-height: 0;
overflow: hidden;
-webkit-transition: max-height 0.5s ease-out;
-moz-transition: max-height 0.5s ease-out;
transition: max-height 0.5s ease-out;
}
.cookie-consent-controls.open {
max-height: 600px;
}
.cookie-consent-details {
max-height: 0;
overflow: hidden;
-webkit-transition: max-height 0.5s ease-out;
-moz-transition: max-height 0.5s ease-out;
transition: max-height 0.5s ease-out;
}
.cookie-consent-details.open {
max-height: 600px;
}
@keyframes show {
from {opacity: 0;}
to {opacity: 1;}
}
@keyframes hide {
from {opacity: 1;}
to {opacity: 0;}
}
.cookie-consent-popup{
width: 420px;
height: auto;
background-color: #fff;
position: fixed;
bottom: 88px;
border-radius: 10px;
right: 5%;
padding: 10px 20px;
border: 1px solid #3d3728;
}
.cookie-consent-popup label{
font-weight: normal;
}
@media screen and (max-width: 420px) {
.cookie-consent-popup{
width: 90%;
left:5%;
bottom: 22px;
}
}