Google Plus 按钮在 magento 中不起作用
我正在尝试在云托管的网站上添加 google plus 按钮。云的 URL 为 http://145.56.183.76 /magento/
此 URL 是公开可用的。
我在页面的 div 标签内添加了以下代码来呈现 google plus 按钮。
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<g:plusone annotation="inline"></g:plusone>
当我运行时,我能够看到 google plus 按钮。我可以登录并添加 1+。之后,google plus 按钮变成红色感叹号框...
当我在 firefox 中尝试时,我可以看到 POST:https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ 抛出 404 错误
'[
{
"error": {
"code": 400,
"message": "Invalid Value",
"data": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
]
},
"id": "pos.plusones.insert"
}
]'
如果我没记错的话,当我们单击按钮时,它实际上会将 URL 粘贴到 google 搜索中,如果找到它,则更新它在谷歌+。
我找到了一个有用的链接,其中讨论了添加 google plus magento 扩展。我已按照步骤操作,但无法查看 google plus 按钮。
http://inchoo.net/ecommerce/magento/howto- google-1-extension-for-magento/
我知道问题出在网站网址上。有人可以帮我解决此问题吗? 它仅适用于公共域吗?如果是,是否有其他方法可以使其与上述 URL 一起使用 谢谢
I am trying to add google plus button on a site hosted on cloud.The URL of the cloud is http://145.56.183.76/magento/
This URL is publicy available.
I added the following code inside div tag in my page to render google plus button.
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<g:plusone annotation="inline"></g:plusone>
I am able to see the google plus button when I run.I can login and add 1+.After this the google plus button turn into red exclaimation box...
When I tried it in firefox I could see in
POST:https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ there was 404 error thrown
'[
{
"error": {
"code": 400,
"message": "Invalid Value",
"data": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
]
},
"id": "pos.plusones.insert"
}
]'
If I am not wrong when we click on the button it actually pastes the URL in the google search and if its found it then updates it in google+.
I found a usefull link which talked about adding google plus magento extension.I have followed the steps but I am not able to view the google plus button.
http://inchoo.net/ecommerce/magento/howto-google-1-extension-for-magento/
I know the problem is with the site url.Can some one help me in troubleshooting this issue.
Does it work only for public domains??If so is there an alternative to get it working with the above URL
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
+1 按钮仅适用于公共 URL。来自 https://developers.google.com/+/plugins/+1button /#目标网址:
The +1 button will only work with public URLs. From https://developers.google.com/+/plugins/+1button/#target-url:
我强烈建议您将 Google API 分开并使用 AddThis API
您不仅可以访问 Google+,还可以访问 200 多项其他服务,包括 Facebook 发送和Facebook 点赞
看看 AddThis 中的简单代码如何在我的测试页上工作:http://balexandre.com/addthis/
免费注册,并获取您的代码来使用,然后,只需添加您想要的按钮或使用``
I would strongly recommend that you put Google API apart and use AddThis API
It does not only give you access to Google+ but as well more than 200 other services including Facebook Send and Facebook Like
see how the simple code from AddThis works on my test page: http://balexandre.com/addthis/
SignUp for free, and get your code to use, then, just add the buttons you want or use ``
如果您想在 magento 网站上添加 google plus 徽章,请尝试此扩展
http://www.kdtips.co.nz/blog/2012/11/magento-google-plus-badge/
Try this extension if you want to add a google plus badge on your magento website
http://www.kdtips.co.nz/blog/2012/11/magento-google-plus-badge/