Issues with sharing via LinkedIn API, response ok, but posts not showing - linkedin

We use LinkedIn API for past year to share on LinkedIn profiles and pages using API endpoints
https://api.linkedin.com/v1/people/~/shares
and
https://api.linkedin.com/v1/companies/{company-id}/shares
Response is always returned as:
{
"updateKey": "UPDATE-xxxxx-xxxxxxx…",
"updateUrl": "https://www.linkedin.com/updates?discuss=…&scope=…"
}
But for past week when sharing some message with link included, posts/comments are not always showing, both on pages or on profiles, no matter response from API is OK with combination of updateKey and updateUrl.
Is this bug on LinkedIn API, or is there some restriction rule for API calls, where API accepts message with link included, and returns positive response with updateKey, but LinkedIn won't show up in feed?

We had a similar experience this week. Our users were posting links through our app of links to youtube, and Linkedin would tell us everything is fine with a response like the one you posted. We would mark it as successful in our system, but post would never show up.
Linkedin seemed to be scrubbing all of our links to videos (youtube, vimeo, etc). Once we started adding a share image as well the links started showing up correctly.
Our solution was to always include an image when posting to Linkedin.
{ 'submitted-url' => <link user shared>, 'submitted-image-url' => <image of some kind> }
What we do is try to pull meta image from the link before publishing and use that. If we can't find one we just pushed a 1px by 1px image. Linkedin is now consistently sharing our posts.
If your issue is not with video urls I would look at if your links are maybe missing the correct meta tags for images. As a fallback you could always try posting an invisible image like we did.

Related

Had all relavant opengraph social meta (created by AIOS) but facebook debug failed to recognize

I know this is an old topic but I've digged dozens of related questions and solutions but neither of them works.
Some of questions I've read:
Can't fix: 'og:image' property should be explicitly provided, even if a value can be inferred from other tags
Wordpress All In One SEO plugin not sharing to Facebook wall
My test url for facebook debug:
https://trangthietbiytehcm.com
Also, I debuged via Facebook sharing debug and Facebook Object debug
Here is Facebook Object debug:
Here is Facebook Sharing debug:
here is the post's head tab:
I also add that sometimes this post could be displayed well (including image thumbnail) on my facebook page but most of time it did not.
I've cleared my wordpress caches.
Absolutely, I can read the social opengraph tab on my post but facebook failed to read them. I do not know the reason behind this problem. Please help me to be clear! thanks
EDIT:
This is a capture of the fact that sometimes Facebook receives my blog post well. And the post link is: https://trangthietbiytehcm.com/uncategorized/san-pham-test-lan-2/
And I wnat to add that the above test link (https://trangthietbiytehcm.com/uncategorized/bai-viet-mau/) also has the same fact as this
EDIT (UPDATE):
After months of be frustrated with this problem, I even tested on another new web on new host server. I've finally found that the reason of this problem is the page cache function of the W3 total cache
We've found this issue to be related to W3 Total Cache, too. Specifically, it's the Wordpress Dashboard > Performance > Minify > Eliminate render-blocking CSS by moving it to HTTP body feature. What this does is shove all the CSS right after the tag, moving all the other header tags down.
And it seems Facebook (and Twitter?) only parse a fixed amount of the page before deciding to try and render... and if your CSS is long, well, it never sees your og:image tag (or any others, like Title, etc).
We have yet to find a good fix which still allows this feature to be used.

Message preview is different depending on LinkedIn profile

My company uses LinkedIn Share API to publish messages on LinkedIn profiles sharing content from WordPress posts.
One thing that is driving me crazy right now is that when I share the same URL and content to two different profiles, the preview cards that result from that are different. On one profile I got a full image preview like the following:
But the same content (same API params to share) produce this different preview:
I'm trying everything I can to get a consistent behavior. I'd like to have all previews being full size previews like the one shown in the first screenshot. API documentation doesn't help much here.
Any help or clue would be appreciated.
It's a random behaviour from LinkedIn. From time to time a significant percentage of accounts reached via the post API return a small thumbnail as well as a different content link (if you use redirected links like bit.ly). It happened for a week in February and since last Friday, including a number of Internal Server Errors. It looks like LinkedIn runs different code on different parts of its infrastructure.
So there is nothing you can do programmatically on your end I'm afraid.

Linkedin share api not picking up open-graph meta tags

I am sharing an url "https://timesofindia.indiatimes.com/trend-tracking/jaitley-promises-robust-tax-regime-for-investors/articleshow/62741496.cms?utm_source=linkedin.com&utm_medium=social&utm_campaign=TEST-LINKEDIN" via share api, but no image is picked up from the og:image tag (i.e. meta property="og:image" content="https://example.com" ).
But when i am trying to share the same url from linkedin admin page, it is picking up the image. This means that the image follows all the size-standards and other things required by linkedin.
Then why is the share api not picking up image url from the open graph tag.
If you think your share is properly formatted, but it's not working, first thing I would do is head on over to the LinkedIn Post Inspector, which will examine your URL and look for problems.
But, your URL does look right! Are you sharing like this, with proper URL encoding?
https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Ftimesofindia.indiatimes.com%2Ftrend-tracking%2Fjaitley-promises-robust-tax-regime-for-investors%2Farticleshow%2F62741496.cms%3Futm_source%3Dlinkedin.com%26utm_medium%3Dsocial%26utm_campaign%3DTEST-LINKEDIN
Because this link works for me! Take a look:
Sometimes you just need another pair of eyes on the same problem! Hope this helps!

Thumbnails not showing up on LinkedIn share posts

We've set up a new mini-site with extensive social sharing, including LinkedIn. Lots of OpenGraph tagging, the works. We have chosen specific images to be shown when sharing by using the og:image meta property.
The images work fine on Facebook and Pinterest, but are not working properly on LinkedIn. Here's the OG image tagging:
<meta property="og:image" content="https://img.mshanken.com/d/wso/Articles/2016/ST_TheBreakers070516_1600.jpg">
But if you click the LinkedIn icon we have set up at the bottom of our page, you end up on a share page that looks like this, which does NOT show the image:
Weirder still, if you inspect that share preview, the image IS in the source code:
<div class="image-thumbs-container">
<img src="https://media.licdn.com/media-proxy/ext?w=180&h=110&f=c&hash=q0uvWygJS2HJrhZZ2qZGdYu2Tig%3D&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R6jnhxUzw8p4aCKqEH-50hKCoaTFXP-RFTovozTPCKqZsXfeLS-xzl5HHRU4kZnLrT9AnPhFZO5KoyAfNpxi4m_ZMc" width="130" alt="Preview of the share image" data-orig-url="https://img.mshanken.com/d/wso/Articles/2016/ST_TheBreakers070516_1600.jpg" data-width="" data-height="" data-size="" data-position="1" class="active">
</div>
What do we need to do to get that image showing up on LinkedIn shares?
I was having the same issue last night. Spent hours researching solutions. Finally I contacted LinkedIn about this issue and they responded right away. Their development team has implemented a new tool called "Post Inspector", which allows you to optimize content sharing. Literally, in just minutes this worked.
All you have to do is type in your URL and they do all the busy work i.e. verifying correct code of properties such as image, author, title, description, publication date etc. Not only do they verify, they also tell you what to include and what is missing.
Here is the website to use Post Inspector:
https://www.linkedin.com/post-inspector/
Couple of things it could be:
The dimensions 1600x900 and size of 220kb are within LinkedIn's requirements. However, your aspect is 16:9 instead of 4:1 / 1:4.
Max file size: 1 MB
Minimum image dimensions: 80 x 150 pixels
Recommended aspect ratio: 4:1 or 1:4
Making Your Website Shareable on LinkedIn
Your image URI is https, it could be they are unable to retrieve your image. Have you tried with an http image?
Note: If the image meets the requirements, but it still does not
appear in updates on LinkedIn, your website may be blocking us from
pulling the image or the image may be located on a protected directory
or website.
Making Your Website Shareable on LinkedIn
Was the image change from the first time LinkedIn crawled your page for the image? They do cache for ~7 days.
The first time that LinkedIn's crawlers visit a webpage when asked to
share content via a URL, the data it finds (Open Graph values or our
own analysis) will be cached for a period of approximately 7 days.
This means that if you subsequently change the article's description,
upload a new image, fix a typo in the title, etc., you will not see
the change represented during any subsequent attempts to share the
page until the cache has expired and the crawler is forced to revisit
the page to retrieve fresh content.
Shared Content Caching
Chiming in from the future - I faced this issue today as our site update wasn't displaying the proper image. In my case the solution was simple: try posting the link like so: https://url.com/?jhskjsh and it forced linked in to fetch the meta tags again which then displayed my image, as opposed to the grey square it previously had.

URL for sharing a LinkedIn post

What is the URL structure for directly linking to a LinkedIn post. On the site itself there is no option to link to a post directly, only to share one of Twitter or Facebook. I've tried sharing a post on Twitter and copying the link from the Tweet, but that link always goes to whatever link was in the original LinkedIn post rather than to the post itself (which makes sense).
I've also tried the following link structure, which seemed to work before, but is not working anymore. Whenever I click a link like this, I get an error message saying the post doesn't exist, even though it clearly does.
https://www.linkedin.com/nhome/updates?topic=POST_ID
There is nothing in the API docs about linking to a specific post, which suggests that either the feature doesn't exist, or is not widely supported.
After digging through the object returned by the Linkedin gem when posting a share to a company page, I found the url structure. It was buried pretty deep, but it does exist.
https://www.linkedin.com/company/COMPANY_ID/comments?topic=SHARE_ID&type=U&scope=COMPANY_ID&stype=C&a=PBfw
COMPANY_ID is the id of the company page (not the name).
SHARE_ID is the id of the share/post.
Using the LinkedIn gem, you can get this link by calling JSON.parse(post.body)['updateUrl']. To get just the post id you can call JSON.parse(post.to_json)['location'][0].split('/')[-1].
I hope this helps someone out because I spent way too much time struggling with this problem.

Resources