google-cloud-platform - Google Data Studio - 刷新嵌入式网站上的数据

标签 google-cloud-platform looker-studio

我已在 html 页面上嵌入了 data studio 报告。我在一段时间后刷新 iframe,但报告没有更新。嵌入页面上的报告只能通过访问数据工作室网站上的报告并单击“刷新数据”图标来更新。

如何在不手动点击 Data Studio 网站上的“刷新数据”图标的情况下刷新 html 页面上的报告?

HTML 页面:

<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
</head>

<body>

    <div>    
        <iframe id="TODOcombined" width="800" height="600" src="https://datastudio.google.com/embed/reporting/1L5PqnHOl0kv3-bwMMVGcNgBi0cdaSMUN/page/Kj0j" frameborder="0" style="border:0" allowfullscreen></iframe>    
    </div>

    <div>    
        <iframe id="TODOmultipage" width="800" height="600" src="https://datastudio.google.com/embed/reporting/19ErM9ElRIHD18oBKo0gGTdrmU5ayXn3H/page/Kj0j" frameborder="0" style="border:0" allowfullscreen></iframe>    
    </div>

    <script>
        function refreshFrames() {
            console.log("Refreshing frames at:" + new Date);
            document.getElementById('TODOcombined').src = document.getElementById('TODOcombined').src;
            document.getElementById('TODOmultipage').src = document.getElementById('TODOmultipage').src;
        }
        setInterval(refreshFrames, 20000);
    </script>

</body>

</html>

最佳答案

当您创建 datastudio 报告时,您可以控制是否使用缓存(在报告设置级别)以及您希望数据的新鲜程度(在连接级别,选项范围为 1、4 和 12 小时)。

仅刷新页面不会覆盖这些内容,因此您需要更改它们以满足您的需求。

参见Manage Data Studio data freshness了解详情。

关于google-cloud-platform - Google Data Studio - 刷新嵌入式网站上的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55164686/

相关文章:

postgresql - Google Data Studio + Postgresql 中的动态日期

java - Stackdriver Logback 附加程序停止应用程序

google-cloud-platform - 在 Google 工作流程 YAML 中创建时间戳

google-app-engine - 旧版本文件仍然出现在谷歌应用引擎中

json - 在Google Data Studio中提取json字符串字段

looker-studio - 如何在 Google Data Studio 中划分两个参数?

python - 如何使用 Apache Beam 中的运行时值提供程序写入 Big Query?

go - 如何在 Google Cloud Platform 中保存计算引擎 VM 实例设置?

javascript - 为什么所有字段在 Data Studio 中都显示为维度?

javascript - 如何动态地将Google Data Studio的一个模板用于多个帐户?