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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745388600a4625554.html
评论列表(0条)