Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linkedin Share URL preview not showing correctly?

I need to share dynamically created URLs in website to Facebook and LinkedIn. I am sharing to Facebook properly and all needed og tags have been set. But for LinkedIn, it is not working.

This is my URL: https://www.fourthambit.com/blogs_fa/102048

It is properly parsed in Facebook and preview is shown correctly.

But the same link is not working in LinkedIn.

Am I missing anything else?

All needed meta tags are set:

<meta property="og:title" content="Indian Media: Then.... Now... and Later" />
<meta content="Sensationalism has become synonymous with the Indian Media, especially Television. In 2008 dur..." name="description" />
<meta property="og:description" content="Sensationalism has become synonymous with the Indian Media, especially Television. In 2008 dur..." />
<meta content="Academic network" name="keywords" />
<meta property="og:image" content="https://www.fourthambit.com/article/getarticlephoto/big/ZGNlZQD4/0/102/20150807050217-12217198186.jpg" />
<img src="https://www.fourthambit.com/article/getarticlephoto/big/ZGNlZQD4/0/102/20150807050217-12217198186.jpg" style="display: none !important;" />
<meta property="og:type" content="website" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />

This is the ajax call going while I try to view a preview in LinkedIn update status bar text-area.

https://www.linkedin.com/sharing/api/url-preview?url=https://www.fourthambit.com/blogs_fa/102048

like image 407
Wolverine Avatar asked Aug 24 '15 12:08

Wolverine


People also ask

Why can't I share a link on LinkedIn?

URLs with white spaces URLs with spaces in them can't be shared on LinkedIn and will result in an error. To make the URL shareable on LinkedIn, you can ask the website owner to encode the white space or remove the spaces from the URL.

How do I add a link to my LinkedIn preview?

Click Start a post. Paste the link or type the URL into the text field. Allow a few seconds for a preview image to display (image frame is a 1.91:1 ratio and 1200 (w) x 627 (h) pixels). If we're not able to retrieve a preview image, you can still share your update as a link.


3 Answers

The reason to this problem could be the following:

"Unfortunately LinkedIn caches the data it retrieves the first time the link is previewed and keeps it cached for a week!"

and the solution:

"The only way to “clear” the sharing preview cache for LinkedIn is to trick LinkedIn into thinking your page is a different (and new) page.

This is done by adding a made-up parameter to the link. It doesn’t affect your webpage, but it does force the metadata to be re-fetched.

Example:
Original link: http://beantin.se/consultant-resume
"New" link: http://beantin.se/consultant-resume?1

like image 78
IKBreier Avatar answered Sep 22 '22 15:09

IKBreier


It could be a caching issue, or it could be a misuse of the LinkedIn API.

If you think you have a caching problem, try...

  • Inspect your webpage at the LinkedIn Post Inspector.
  • Try sharing not just example.com, but, example.com/?someFake=Parameter. Since the URL is different, it shouldn't hit the cache.

So, if that's it, then why isn't og:description showing???

Because the LinkedIn API supports two levels:

  • Level 1: If you supplied an image, show image with title/domain.
  • Level 2: If you supplied a description, but no image, show description with title/domain.

Is it possible to display: title, image, description, url? No, it is not. I gleaned this over two weeks of struggling with the LinkedIn support team (oh the humanity).

like image 44
HoldOffHunger Avatar answered Sep 21 '22 15:09

HoldOffHunger


LinkedIn has launched Post Inspector. You can now do the following to clear LinkedIn Preview cache:

Step 1: Visit https://www.linkedin.com/post-inspector/inspect/

Step 2: Enter your url and click on Inspect, You will see the updated preview image

Step 3: Now try sharing your url on LinkedIn

like image 26
Won Jun Bae Avatar answered Sep 25 '22 15:09

Won Jun Bae