Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Plus Open Graph bug: G+ doesn't recognize open graph image when UTM or other query string appended to URL

Google Plus is pretty good at pulling images specified by Open Graph meta tags when standard URLs are shared like:

http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048

See:

Google Plus share image with standard URL

But things start to get screwy when you start appending query strings, such as is done in this URL:

http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048?utm_source=google-plus&utm_medium=social&utm_campaign=stackoverflow-general-promotion

Google Plus share image with URL query strings

And for certain URLs + query strings the default image seems to make no sense at all:

http://skeptics.stackexchange.com/questions/4508/can-every-grain-of-sand-be-addressed-in-ipv6?xyz_12312313

Google Plus share image with URL query strings

The image featured in the above screengrab is the user pic of the guy who last left an answer to the shared question.

Is there any way to force Google Plus to fall back on images defined by og:image tags even when query strings are appended?

like image 459
samthebrand Avatar asked Jul 25 '14 19:07

samthebrand


2 Answers

No, there is no way to fallback with Google+.

This behaviour is possible with Facebook scraper because it supports checking for og:url which Google+ does not support (Why???). These are the items Google+ supports

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

Normally when query parameters are added if og:url is defined

Their recommended format is Schema as described at https://developers.google.com/+/web/snippet/

The order in which Google+ checks

  1. Schema
  2. Open Graph
  3. Title and meta description tags
  4. Guess???

Seeing that multiple Schema are defined on the pages you linked, according to the https://developers.google.com/+/web/snippet/ documentation, it should take the information from the itemscope defined nearest to the top

<body class="question-page new-topbar" itemscope itemtype="http://schema.org/QAPage">

which is a little funny/weird since their tool doesn't pick this up http://www.google.com/webmasters/tools/richsnippets?q=stackoverflow.com%2Fquestions%2F22342854%2Fwhat-is-the-optimal-algorithm-for-the-game-2048%3Futm_source%3Dgoogle-plus%26utm_medium%3Dsocial%26utm_campaign%3Dstackoverflow-general-promotion

So, then this brings us back to looking at your second image

The title is different

The title is different as well, so og:title isn't being detected either. <title> is being scraped instead

What does this all mean?

Google plus sucks with markup for sharing.

You will need to adjust your top most Schema.org microdata and hope Google+ makes sense of it when adding params to the canonical url.

<body itemscope itemtype="http://schema.org/QAPage">
  <h1 itemprop="name">Shiny Trinket</h1>
  <img itemprop="image" src="{image-url}" />
  <p itemprop="description">Shiny trinkets are shiny.</p>
</body>
like image 164
phwd Avatar answered Oct 08 '22 07:10

phwd


Read this in the FAQ section for OpenGraph in Google+ :

Why isn't my +Snippet image appearing? Images that are too small or not square enough are not included in the +Snippet, even if the images are explicitly referenced by schema.org microdata or Open Graph markup. Specifically, the height must be at least 120px, and if the width is less than 100px, then the aspect ratio must be no greater than 3.0.

like image 40
RazorCallahan24 Avatar answered Oct 08 '22 08:10

RazorCallahan24