有没有办法将Google趋势(相关主题)的默认视图设置为“上升”而不是“热门”?

问题描述 投票:0回答:1

Google 趋势为您提供的相关主题查询的代码导出默认为“热门”结果。有没有办法将“Rising”结果加载为默认值?这是我正在查看的代码:

<script type="text/javascript">
  trends.embed.renderExploreWidget(
    "RELATED_TOPICS",
    {
      comparisonItem: [{ keyword: "cats", geo: "US", time: "now 7-d" }],
      category: 0,
      property: ""
    },
    {
      exploreQuery: "date=now%207-d&geo=US&q=cats",
      guestPath: "https://trends.google.com:443/trends/embed/"
    }
  );
</script>

这是沙箱的链接:https://codesandbox.io/s/google-trends-rmt87?file=/index.html:396-803

javascript html
1个回答
0
投票

要在 Google Trends Explore Widget 代码中加载“Rising”结果作为默认值,请修改 exploreQuery 参数以包含值设置为“rising”的比较选项

<script type="text/javascript">
  trends.embed.renderExploreWidget(
    "RELATED_TOPICS",
    {
      comparisonItem: [{ keyword: "cats", geo: "US", time: "now 7-d" }],
      category: 0,
      property: ""
    },
    {
      exploreQuery: "date=now%207-d&geo=US&q=cats&compare=rising",
      guestPath: "https://trends.google.com:443/trends/embed/"
    }
  );
</script>
© www.soinside.com 2019 - 2024. All rights reserved.