Reputation: 1974
I'm trying to implement schema markup on my site using Custom HTML tags in Google Tag Manager. When I preview my changes, it works perfectly. However, when I push the tag live, it does not appear on my page.
I've had a similar issue with tags in preview appearing differently than in live. But when I tried looking into it, it I couldn't find an answer on why that would happen.
So I'm wondering if you have any insights into why this tag works in preview, but does not work live?
Upvotes: 0
Views: 1600
Reputation: 1974
I figured it out. We had an X-XSS-Protection
header set to 1;mode=block
which was limiting Google Analytics from injecting scripts that could be considered an XSS attack.
This could have also happened with an incorrectly configured Content-Security-Policy
.
The correct way to set up a Content-Security-Policy
that allows Google Analytics and Google Tag Manager to inject scripts is outlined in this Lunametrics article (take note of Simo Ahava's comment after the post).
Upvotes: 1