Google Plus button not working in magento
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 开发者_JS百科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
The +1 button will only work with public URLs. From https://developers.google.com/+/plugins/+1button/#target-url:
The +1 is a public action and must be performed on a public URL. If you attempt to +1 a URL that is not public, an error will occur.
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 ``
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/
精彩评论