admin管理员组文章数量:1426048
I'm using WP 5.2.2 and trying to configure a cookie notice banner. I'm using the popular Cookie Notice plugin (v1.2.46).
My problem comes that when I configure the Google Analytics script (the one to be inserted when the user accepts the use of cookies), when saving changes the code is changed from
<script async src=""></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)};gtag('js',new Date());gtag('config','UA-XXXXXXXX-X');</script>
to
<a href="">;/a>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)};gtag('js',new Date());gtag('config','UA-XXXXXXXX-X');</script>
Obviously it makes my site not being tracked by GA.
I've being looking around for a solution and I haven't been able to find one. Any ideas?
I'm using WP 5.2.2 and trying to configure a cookie notice banner. I'm using the popular Cookie Notice plugin (v1.2.46).
My problem comes that when I configure the Google Analytics script (the one to be inserted when the user accepts the use of cookies), when saving changes the code is changed from
<script async src="https://www.googletagmanager/gtag/js?id=UA-XXXXXXXX-X"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)};gtag('js',new Date());gtag('config','UA-XXXXXXXX-X');</script>
to
<a href="https://www.googletagmanager/gtag/js?id=UA-XXXXXXXX-X">https://www.googletagmanager/gtag/js?id=UA-XXXXXXXX-X</a>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)};gtag('js',new Date());gtag('config','UA-XXXXXXXX-X');</script>
Obviously it makes my site not being tracked by GA.
I've being looking around for a solution and I haven't been able to find one. Any ideas?
Share Improve this question asked Jun 19, 2019 at 16:01 cbuchartcbuchart 1718 bronze badges1 Answer
Reset to default 0I tried to replicate the problem into a local server in order to debug the plugin and it worked flawlessly. When looking at the difference between both installations I noticed this one, related to JetPack (v7.4.1), in JP / Writing / Composing:
Compose using shortcodes to embed media from popular sites
Disabling such option the Cookie Notice plugin started to save the snippet correctly.
本文标签: plugins39ltscriptgt39 tag is changed to 39ltagt39 when configuring Cookie Notice
版权声明:本文标题:plugins - '<script>' tag is changed to '<a>' when configuring Cookie 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745388600a2656490.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论