datastudio.google.com拒绝连接

问题描述

我正在尝试将Google Data Studio报告嵌入我的网站。直到一分钟前它一直在工作,但现在我不断收到:“ datastudio.google.com拒绝连接。”

这是代码

import React,{ Fragment,useContext } from 'react'
import { Context } from '../../../context/Context'

export function ScheduleAndReport() {
  const { userObject } = useContext(Context)
  const reportURL = userObject.reportURL
  const scheduleURL = userObject.scheduleURL

  return (
    <Fragment>
      {scheduleURL && (
        <iframe
          width="100%"
          height="1200"
          src={scheduleURL}
          frameBorder="0"
          allowFullScreen>
        </iframe>
      )}
      {reportURL && (
        <iframe
          width="100%"
          height="1200"
          src={reportURL}
          frameBorder="0"
          allowFullScreen>
        </iframe>
      )}
    </Fragment>
  )
}

解决方法

看起来你不能在 IFRAME 中嵌入 datastudio .. 在 FF 上有同样的问题

为了保护您的安全,datastudio.google.com 将不允许 Firefox 在其他站点嵌入该页面的情况下显示该页面。要查看此页面,您需要在新窗口中打开它。

正确的做法如下:

https://support.google.com/datastudio/answer/7450249?hl=en