Google Plus sharing button. Invalid image displayed.

I want to add a google plus button. Thus, the user can share products using Google plus. But when I click the sharing button, then the product name, URL are all correct except for the product image. Product image is not displayed correctly. I am writing the code below to generate the Google Plus button code.

<a href="#" onclick="popUp=window.open('https://plus.google.com/share?url=my_product_url', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false">Share on Gogole+</a> 

I am also trying to add some meta tags to solve this problem, but nothing happens.

 <meta property="og:title" content="..."/> <meta property="og:image" content="..."/> <meta property="og:description" content="..."/> 

In sorting, I need to display the current product data and image on Google plus sharing.

Please help me as soon as possible.

+7
google-plus magento
source share
2 answers

It would be easier to say what was wrong if you provided an example URL, but it looks like you have markup for multiple objects on the product details page. When this happens, the fragment collector will take the image from the first object on the page.

Use this tool: http://www.google.com/webmasters/tools/richsnippets to check the fragment markup and determine the objects that the fragment recipient sees.

You should also take a look at: https://developers.google.com/+/web/snippet/ , which shows that we prefer to use the schema.org markup to describe the objects in your page.

+2
source share

Hi, add the code below on the product details page

 <?php $productName = $_helper->productAttribute($_product, $_product->getName(), 'name'); ?> <?php $productUrl = $_helper->productAttribute($_product, $_product->getProductUrl(), 'product_url'); ?> <?php $productImage = $_product->getImageUrl() ?> <a href="#" onclick="popUp=window.open('https://plus.google.com/share?url=<?php echo urlencode($productUrl); ?>', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false">Share on Gogole+</a> 

Hope this helps you ...

0
source share

All Articles