diff --git a/composer.json b/composer.json index 3b157a39..e0eb4be4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tagginggroup/gtm", - "version": "1.5.8", + "version": "1.6.0", "license": "OSL-3.0", "type": "magento2-module", "description": "AdPage tagging integration for Magento 2", diff --git a/view/frontend/templates/hyva/script-pusher.phtml b/view/frontend/templates/hyva/script-pusher.phtml index ae59c24d..aceb3c4e 100644 --- a/view/frontend/templates/hyva/script-pusher.phtml +++ b/view/frontend/templates/hyva/script-pusher.phtml @@ -45,7 +45,7 @@ declare(strict_types=1); if (eventData.marketing) { const expires = new Date(); expires.setTime(expires.getTime() + 7 * 24 * 60 * 60 * 1000); - document.cookie = `trytagging_user_data=${btoa(JSON.stringify(eventData.marketing))};expires=${expires.toUTCString()};path=/`; + document.cookie = `trytagging_user_data=${btoa(String.fromCharCode(...new TextEncoder().encode(JSON.stringify(eventData.marketing))))};expires=${expires.toUTCString()};path=/`; } googleTagManager2Logger(message, eventData); diff --git a/view/frontend/web/js/push.js b/view/frontend/web/js/push.js index 658e5190..9e461a3c 100644 --- a/view/frontend/web/js/push.js +++ b/view/frontend/web/js/push.js @@ -56,7 +56,7 @@ define(["googleTagManagerLogger"], function (logger) { const expires = new Date(); expires.setTime(expires.getTime() + 7 * 24 * 60 * 60 * 1000); document.cookie = `trytagging_user_data=${btoa( - JSON.stringify(cleanEventData.marketing) + String.fromCharCode(...new TextEncoder().encode(JSON.stringify(cleanEventData.marketing))) )};expires=${expires.toUTCString()};path=/`; }