Topic-icon Several Open Graph Images in my Page

Active Subscriptions:

None
7 years 7 months ago #59334 by altitudes
Hello

If you have a look at this page www.altitudes.asso.fr/infos/reductions on my site, you will see that it has 3 tags. The reason is that:
1- I have a {SCOpenGraph image=...} tag in my article
2- I have an Open Graph Object defined to use first article image
3- I have a default image defined in Open Graph configuration

In such cases, JFBConnect should only use the first image found (following order 1-2-3). This is what is suggested here:
File Attachment:


But it does not seem to work ;)
The topic has been locked.
Support Specialist
7 years 7 months ago #59338 by mel
However, multiple og:image tags are allowed on a page. This is why we don't limit the amount of og:image tags put onto a page.

Open Graph specs state that the images on the page should in placed in order on the page, with priority given to the order on the page:

If a tag can have multiple values, just put multiple versions of the same <meta> tag on your page. The first tag (from top to bottom) is given preference during conflicts.


They should be in the order of relevance and the social network *should* take that as a preference. However, we've found that Facebook may take image based on size. Because we work with multiple social networks, we go by the Open Graph protocol. Hence, we should be placing them on the page in the order of 1-2-3.

-Melissa
The topic has been locked.
Active Subscriptions:

None
7 years 7 months ago #59339 by altitudes
I see. Not sure it really makes sense for JFBConnect users. When you use the {SCOpenGraph image=...} tag in an article, it is really because you want a given image to be used, so I don't see the point of putting other images... and taking the risk that Facebook chooses the wrong image, since as you said Facebook has its own logic.

If you choose not to modify that, maybe you could add a note to the following sentence saying that it has a different behavior for image tag...
"Default tags to be used on page *if* more specific tags are not created by Open Graph plugins or {SCOpenGraph ..} tags."

Thanks
The topic has been locked.
Support Specialist
7 years 7 months ago #59351 by alzander
Just to clarify a bit further as to why we allow multiple images. All of the images uses should hopefully be relevant to the page. We leave them all in because there are various ways that Facebook can use multiple images. When you Like a page, usually the default image is chosen. If someone Shares the page or if they post a link to the URL in a feed post, the multiple images give the user the choice to select which one they want to show. So, for a feed post, the user may be commenting about something specific that one image may make more sense for or just like one image over the other.

We understand how it can be confusing, but hopefully the above helps explain the reasoning. If you have any other feedback, please let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
7 years 7 months ago - 7 years 7 months ago #59356 by altitudes
Thank you for this clarification.

I will do with it, in particular make sure that all my images roughly have the same size, so that Facebook is more likely to use by default the image I expected, which is not the case now ;)
Last edit: 7 years 7 months ago by altitudes.
The topic has been locked.
7 years 7 months ago #59447 by chramb1
I'm having the same problem (and just posted about it).

The issue is that the user is NOT always given a choice of image. Using the "share" button, the image is chosen by Facebook (in this case, the WRONG image) and the user is NOT given a choice to change it.

Why not a configuration switch in JFBConnect that says, "Enable Multiple Images for Facebook" that you default to on, so as to maintain existing functionality. I would then gladly turn that option off. In that case, the logic is to use the {SCOpenGraph} if present. If not, use any plugins. If there are none, use the default image. But in all cases, use only one image.

I'll send beer as a bribe for this :-)
The topic has been locked.
Support Specialist
7 years 7 months ago #59451 by mel
If you'd like a quick workaround, could you try this untested code to force only one image on the page:

In /libraries/sourcecoast/openGraph.php around line 320, replace:
$this->allowsMultiple = ($name == 'og:image') ||
            (strpos($name, 'og:') === false && strpos($name, 'fb:') === false);
with
$this->allowsMultiple = (strpos($name, 'og:') === false && strpos($name, 'fb:') === false);

I can add an issue to the tracker as you're not the only user concerned by this, but this should help in the meantime.

-Melissa
The topic has been locked.