简体   繁体   English

X-Frame-Options标头和Google Analytics(分析)“页内分析”

[英]X-Frame-Options header and Google Analytics “In-page analytics”

At present we cannot use Google Analytics "In-page analytics" (it uses an iframe). 目前,我们无法使用Google Analytics(分析)“页内分析”(它使用iframe)。 This is due to the fact that we have set the X-Frame-Options header within our application to “same-origin”, is there any way we can allow Google Analytics to load the website in an iFrame but not allow any other websites? 这是由于我们已将应用程序中的X-Frame-Options标头设置为“ same-origin”,是否有任何方法可以允许Google Analytics(分析)将网站加载到iFrame中,但不允许任何其他网站?

Thanks in advance, 提前致谢,

Adam 亚当

Yes, but not in Chrome as there is no support for ALLOW-FROM in X-Frame-Options. 是的,但在Chrome中不行,因为X-Frame-Options中不支持ALLOW-FROM

Anyway, there is an newer alternative that is cross-browser compatible and that you should research more: 无论如何,有一个跨浏览器兼容的更新替代品,您应该研究更多:

Content-Security-Policy: frame-ancestors domain.com 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM