Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 659
Bujji Avatar asked Sep 05 '11 15:09

Bujji


People also ask

Will Google Analytics work with an iframe?

Send Iframe Data to Google Analytics Now that everything you want to track is available in the Data Layer of your parent frame, you can send your iframe data to tools like Google Analytics.

Why is my Google Analytics not showing anything?

Verify that you're tracking the right property and view. If you have access to multiple Google Analytics accounts and properties, there's a chance that you might be using the Google Analytics tracking code from another property, or you may be looking at reports in the wrong account, or for the wrong property and view.

What is ADX Google Analytics?

Ad Exchange lets you earn money by using a Google display tool on your website to host third-party ads that are relevant to your audience.


1 Answers

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.

like image 113
Eduardo Avatar answered Nov 15 '22 09:11

Eduardo