Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtmFunctionOverwrite does not output the raw string #90

Open
zzzAlexz opened this issue Jun 15, 2023 · 0 comments
Open

gtmFunctionOverwrite does not output the raw string #90

zzzAlexz opened this issue Jun 15, 2023 · 0 comments

Comments

@zzzAlexz
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant