gtmFunctionOverwrite does not output the raw string
Opened this issue · 0 comments
zzzAlexz commented
PHP Version
8.1
Shopware Version
6.4.17.2
Expected behaviour
Setting the "Overwrite GTM function" gtmFunctionOverwrite
should output the exact same string in the frontend.
Solution:
The output should be raw:
src/Resources/views/storefront/layout/meta.html.twig:31
var googleTag = {% endverbatim %}{{ wbmTagManagerConfig.gtmFunctionOverwrite|raw }}{% verbatim %}
Actual behaviour
Output string is escaped, example
var googleTag = function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
How to reproduce in a demoshop
Config a custom script in plugin config wbmTagManagerConfig.gtmFunctionOverwrite
see the result in the frontend.