Hi everybody I am using drupal 8.7.7 with 2 language installed (English and french).
I am using AddToAny to share content on social network.

I installed also metags module.

But when I share and article (node) on facebook the image is missing.

someone can help me to fix this?

thank you

Comments

soulsesa’s picture

debugger tell me that he can't examine the url

https://www.facebook.com/zoodomail

yelvington’s picture

When I use the sharing debugger to examine one of your story pages, here is what I see:
The provided 'og:image' properties are not yet available because new images are processed asynchronously. To ensure shares of new URLs include an image, specify the dimensions using 'og:image:width' and 'og:image:height' tags. Learn More

https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fwww.zoodomail.com%2Ffr%2Fsecurite%2Finsecurite-ouagadougou-un-reseau-de-malfrats-demante

Facebook's documentation says:
 

Pre-caching images

When content is shared for the first time, the Facebook crawler will scrape and cache the metadata from the URL shared. The crawler has to see an image at least once before it can be rendered. This means that the first person who shares a piece of content won't see a rendered image:

You can fix this for an individual item by using the debugger (which forces an image fetch) but of course that's not practical. 

Or you can add useog:image:width and og:image:height Open Graph tags.

I don't know whether Metatag + Token make dimension tokens available to you in Drupal 8, as I have not had to wrestle with this particular problem.

If they are not available, a workaround would be to set up an image style of known dimensions to be used for social sharing. To normalize size and shape you might need to composite the image onto a neutral background. Doing this will have a positive side effect: you won't get into a situation where Facebook mangles the cropping of a vertical photo.