简体   繁体   English

Google Places API评论小工具

[英]Google Places API Reviews Widget

I'm trying to embed Google's "write a review" widget into my website. 我正在尝试将Google的“撰写评论”小部件嵌入到我的网站中。 Much like what Podium.com does. 就像Podium.com的做法一样。

They host a page and load an iframe with the src: 他们托管一个页面并使用src加载iframe:

https://www.google.com/maps/api/js/ReviewsService.LoadWriteWidget?key=THEIR_API_KEY&pb=!2m1!1sChIJ6VFjYpqa9YgREIJTX-XLyoE!3shttps%3A%2F%2Ftheir-url.com!5sen&cb=37369878

This renders the widget like so: 这样渲染小部件就像这样: 写评论小工具

I dug into their html source and it appears they're using the Google Places Reviews Widget. 我挖掘了他们的html源代码,看起来他们正在使用Google Places Reviews Widget。 I searched Google and Google Developers for "Google Places Reviews Widget" which returns results: 我在GoogleGoogle Developers上搜索了“Google Places Reviews Widget”,它会返回结果:

搜索结果列表

However, the links go to a 404 page: 但是,链接转到404页面:

I've replicated what Podium is doing on my own page using my API key. 我使用API​​密钥复制了Podium在我自己的页面上所做的事情。 However, the widget doesn't display. 但是,窗口小部件不会显示。 I don't get any errors, the iframe loads some scripts and some hidden html elements, but doesn't render the full widget. 我没有得到任何错误,iframe加载一些脚本和一些隐藏的html元素,但不呈现完整的小部件。

Is this an API or feature that I'm unable to access? 这是我无法访问的API或功能吗? Has anyone implemented something similar? 有没有人实现类似的东西?

I also had the exact same experience and reached out to Google about it. 我也有完全相同的经历,并与Google联系。

Here's their preliminary reply on Sept 4, 2018 这是他们在2018年9月4日的初步答复

Apologies for the delay on this. 对此延迟道歉。

May I ask if you followed the steps here: https://developers.google.com/places/reviews/#api-key 我可以问你是否按照这里的步骤操作: https//developers.google.com/places/reviews/#api-key

It says there that, "Before you begin coding, notify your Google contact person that you intend to create a project to use the Google Places API Reviews Widget. Indicate the email address of the Google account you intend to use to manage the project. Google will use this email address to allow you to activate the API for your project. 它说,“在开始编码之前,请通知您的Google联系人,您打算创建一个项目以使用Google商家信息API评估小工具。请指明您打算用来管理项目的Google帐户的电子邮件地址。将使用此电子邮件地址来激活项目的API。

After your Google contact person has confirmed that your email address can activate the Google Places API Reviews Widget, you can follow the instructions here: https://developers.google.com/places/reviews/#api-key to activate the API and create your key. 在您的Google联系人确认您的电子邮件地址可以激活Google商家信息API评估小工具后,您可以按照以下说明操作: https//developers.google.com/places/reviews/#api-key以激活API和创造你的钥匙。

May I ask if you have a contact person? 请问您是否有联系人? If you don't have one, apologies but the Review's Widget is not generally available, because it needs some special authorization before it can be used. 如果您没有,请道歉但是Review's Widget通常不可用,因为它需要一些特殊的授权才能使用。 Please note that we are investigating to see if you can get access to that Widget. 请注意,我们正在调查您是否可以访问该Widget。

If you do have a contact person, please let me know. 如果您有联系人,请告诉我。

Moving forward, may I ask what kind of places would you like to use the Reviews Widget for? 展望未来,我想问一下你想用什么样的地方来使用评论小工具?

Then this: 然后这个:

With regards to your intention in using the Review Widget, I would like you to know that unfortunately, the Review Widget is not available at the moment yet. 关于您使用Review Widget的意图,我希望您知道,目前尚未提供Review Widget。 We don have a date for expected general availability for this product but I can get back to you and inform you once the Review widget is already available publicly. 我们没有关于此产品的预期一般可用性的日期,但我可以回复您,并在审核小部件已公开发布后通知您。 Once again, apologies for this inconvenience. 再一次,对此造成的不便表示歉意。

And finally: 最后:

The Reviews Widget is only actually limited to trusted partners as of the moment. 评论窗口小部件目前仅限于受信任的合作伙伴。 Moreover, the Review Widget team isn't looking for new testers at the moment: 此外,Review Widget团队目前还没有寻找新的测试人员:

With that said, the public documentation on the Reviews Widget has already been set into private. 话虽如此,Review Widget上的公共文档已经被设置为私有。 As mentioned, the Reviews Widget is not yet available for the general public. 如上所述,评论窗口小部件尚未面向普通大众。

Sorry to be the bearer of bad news... 很抱歉成为坏消息的承担者......

check this out... I dunno if this helps. 看看这个...我不知道如果这有帮助。 i've been trying to figure this out too. 我一直试图解决这个问题。 A company called BirdEye has this Review Portal that opens the post-review widget on the page. 一家名为BirdEye的公司拥有此评论门户,可在页面上打开评论后小组件。 I inspected the code and found that there are 2 JS scripts calling on Google's Places API (image attached). 我检查了代码,发现有2个JS脚本调用Google的Places API(附图像)。 The button code I'm assuming hitting these scripts is just below. 我假设点击这些脚本的按钮代码就在下面。 Does this make sense to anyone? 这对任何人都有意义吗? I'm not able to get into the actual JS file though. 但我无法进入实际的JS文件。

<button class="btnReviewSite2" data-source-url="https://www.google.com/search?q=Innovative+Roofing&amp;ludocid=8385655751686277266&amp;gws_rd=cr&amp;fpstate=lie&amp;lrd=0x87938c4de368e6b3:0x745fd57a1ff8c892,2#trex=m_t:lcl_akp,rc_f:nav,rc_ludocids:8385655751686277266" data-place-id="ChIJs-Zo402Mk4cRksj4H3rVX3Q" data-google-embedded="1" data-source-url_9="" data-source-id="2">
<span class="aggr-source-wrapper">
<span class="rev-site-2 presenceIcon aggr-source-2 aggr-dummy-source-g">
</span>
</span>
<span title="Review us on Google">
</span>
</button>

Google Places API JS Script Google Places API JS脚本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM