I'm just getting started looking at the Google Analytics API which should allow me to embed some Analytics data into a page. I have found two pages containing almost identical demo code, both created by Google themselves:
- https://ga-dev-tools.appspot.com/embed-api/basic-dashboard/
- https://developers.google.com/analytics/devguides/reporting/embed/v1/devguide
and neither of them works. Nothing loads, and the error message in the Console is:
Refused to display 'https://accounts.google.com/o/oauth2/auth?client_id=MY_CLIENT_ID&origin=MY_URL&state=1729197785%7C0.713338618&authuser=0' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Can anyone explain why this would be? The Client ID isn't the problem, I've double-checked, and there are no restrictions on referrers. This happens when the code is place in a live public web page, not locally on an intranet or localhost page.