我已经实施了一些 Trustpilot Trustboxes,以便在我的网站上获取用于 SEO 的 Rich Snippets。本指南已使用。问题是 Google-bot 和Google 结构化数据测试工具无法识别应包含在标头中的标记。
我的测试:
- 我在网站上创建了一个“空白”页面,只加载必要的 Trustpilot 内容。测试工具没有识别标记,也没有检测到结构化数据。
- 我通过结构化数据测试工具上的自定义代码测试了标记,方法是直接在标题中添加获取的标记。测试工具检测到结构化数据。
- 浏览网站时,在浏览器(例如 Chrome、Firefox 等)中检查网站时,可以在 html-header 中看到标记(谷歌机器人或结构化数据测试工具无法看到)。
我对测试的结论:问题不是由加载速度慢或标记错误引起的。目前我最好的猜测是,用于网站的框架或配置中的某些内容会阻止谷歌识别/获取来自 Trustpilot 的标记。当然,这只是我的结论。我可能完全错了。
Heroku 和 Play 框架用于托管/作为网站的框架。难道是我错过了在 Play 或 Heroku 中启用某些允许谷歌识别/获取 Trustpilot 标记的选项?是否应该将某些内容添加到内容安全策略(与 schema.org 相关的内容)?
注意:我可能在这个问题中错误地使用了术语。
[更新]
下面的代码用于测试应用程序:
<!DOCTYPE html>
<head>
<script type="text/javascript" src="//widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js"></script>
</head>
<body>
<div>
<div class="trustpilot-widget"
data-locale="en-US"
data-template-id="54ad5defc6454f065c28af8b"
data-businessunit-id="54e497ed0000ff00057d80c7"
data-style-height="220px"
data-style-width="100%"
data-theme="light"
data-tags="SelectedReview"
data-schema-type="Organization">
<a href="https://en.trustpilot.com/review/www.lendino.dk" target="_blank">Trustpilot</a>
</div>
</div>
</body>