Bujji
Bujji

Reputation: 1727

Why won't Google Analytics reporting display in an iframe?

I logged into my google analytics on one tab (I tried on Firefox 3.6 and Chrome ) and on the other tab I opened this simple HTML code that is on desktop ( or on my wamp server)

<iframe height="100%" frameborder="0" width="100%" src="https://www.google.com/analytics/reporting/dashboard" allowtransparency="true"></iframe>

I expected it to display Google Analytics data in an iframe. But it just show a blank screen (I tried for Gmail and that one also displayed blank )

Am I missing any thing for it to display in iframe?

I can use Google Analytic API to get the results and that is totally different. My case is showing already logged in google account in Iframe

Upvotes: 5

Views: 1979

Answers (1)

Eduardo
Eduardo

Reputation: 22824

Several Google products implement the x-frame-options:SAMEORIGIN HTTP header so it won't allow it to be displayed inside an iframe, unless that iframe is placed on a google.com page. This is setup like this for security reasons. To avoid clickjacking attacks.

Upvotes: 9

Related Questions