Article Share API from LinkedIn Throwing error - linkedin

I'm trying to make a simple share button LinkedIn using the article share API. It's pretty straight foward, or so I thought.
When using the domain's href, it works:
https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fsp156.prefeitura.sp.gov.br/portal
I can even make it to another page:
https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fsp156.prefeitura.sp.gov.br/portal/servicos
However, if I try another page:
https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fsp156.prefeitura.sp.gov.br/portal/servicos/informacao?servico=3832
It brings up a error. Looking at the console doesn't really help that much, and at the network tab all the requests return 200.
I tried removing the query parameters, although the page doesn't work without them, and still, didn't worked
#edit:
Even the LinkedIn official inspector of pages can recognize the page, now I'm really confused:
https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fsp156.prefeitura.sp.gov.br%2Fportal%2Fservicos%2Finformacao%3Fservico=3832
Anyone has idea on what's happening? Thanks in advance.

The URL you are sharing contains a ? character. You need to escape that character using URL-encoding. So, this is what you should want...
https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fsp156.prefeitura.sp.gov.br%2Fportal%2Fservicos%2Finformacao%3Fservico%3D3832
Notice how the ? is rendered here as %3F. URL's should only have one ? at all, because that indicates that $_GET data is going to proceed that mark. With two of them, the server doesn't know and gets confused!
Looks good to me now!
In case you want to know more: Official LinkedIn Share Documentation

If you browse directly to the landing page of in debug mode you will see that it is returning the error 200 and not linked in.
https://sp156.prefeitura.sp.gov.br/portal/servicos/informacao?servico=3832
Ops, parece que este serviço não existe, busque um serviço na lista ao lado.
Which Google translate says is Oops, it looks like this service doesn't exist, look for a service in the list on the side.
LinkedIn has to redirect to a known good page, that is why the other two resolve.
I did notice that there is a login option on that page, is perhaps the page only accessible post login?

Related

Meta tags appear correct but Facebook sharing is empty (no title, description, or image)

This problem exists for all pages on this site. The meta tags appear correct but whether you use the share link on the site, or try to share direct on FB, the image, title and description are not used.
There must be a legitimate issue as the Sharing Debugger also shows an empty/plain sharing dialog. But the Facebook share debugger isn’t given me any helpful info. It sometimes shows a 302, which I don’t understand as there is no redirect on the site. Refreshing the scrape sometimes shows an error Unknown Image Error, which also doesn’t seem to be a legitimate issue.
Almost always the Facebook share debugger shows a 302 the first time and then follows with other unhelpful errors.
Maybe a DNS issue, weird that it would be site wide.
Example Links:
[http://pikespeakharleyownersgroup.com/group-riding-pphog-405/][1]
[http://pikespeakharleyownersgroup.com/tell-tires-toast/][2]
[http://pikespeakharleyownersgroup.com/30th-annual-high-country-toy-run/][1]
Any and all help is very appreciated.
Try debugging your page URL on below link:
https://developers.facebook.com/tools/debug/
Once you scan your URL, on the link I provided, you will see "Warnings That Should Be Fixed" section. Try resolving warnings mentioned in that section.
Hope this will help you!

Facebook shares not using og:url when clicked in Facebook?

One of the purposes of og:url -- I thought -- was that it was a way you could make sure sessions variables, or any other personal information that might find its way into a URL, would not be passed along by sharing in places like Facebook. According to the best practices on Facebook's developer pages: "URL
A URL with no session id or extraneous parameters. All shares on Facebook will use this as the identifying URL for this article."
(under good examples: developers.facebook.com/docs/sharing/best-practices)
This does NOT appear to be working, and I am puzzled as to either -- how I misunderstood, and/or what I have wrong in my code. Here's an example:
https://vault.sierraclub.org/fb/test.html?name=adrian
When I drop things into the debugger, it seems to be working fine...
https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fvault.sierraclub.org%2Ffb%2Ftest.html%3Fname%3Dadrian
og:url reads as expected (without name=adrian).
But if I share this on facebook -- and then click the link. The URL goes to the one with name=adrian in it, not the og:url.
Am I doing something incorrectly here, or have I misunderstood? If the latter, how does one keep things like sessions variables out of shares?
Thanks for any insight.
UPDATE
Facebook replied to a bug report on this, and I learned that I indeed was reading the documentation incorrectly
developers.facebook.com/bugs/178234669405574/
The question then remains -- is there any other method to keeping sessions variables/authentication tokens out of shares?

Wordpress code causing 404 errors

I am receiving 404 errors (showing on Google search console)that somehow relate to Facebook.
eg http://www.beerandcroissants.com/staying-in-mykonos-myconian-k-hotel/room-at-myconian-k-hotel-mykonos/%22https:/www.facebook.com/pages/Beer-and-croissants/1423705111261254
What it seems to be doing is taking one link (eg part of the whole link above) which relates to a photo on my blog and then appending the facebook page url. So, if I take the first part of the link above
(before the facebook part starts) I get a perfectly good link through to my site. If I take the second part (where the facebook link starts) then it takes me to my FB page. Again fine.
Why are these two linking together like this as it is this that seems to be causing the 404. Is it something in my settings. It's only just started happening.
Going to facebook directly and clicking on my post links takes me to the correct part of my blog.
I am not sure how to fix this. There are no broken links attached in google for me to view either. They keep happening every day. I now have 295 crawl errors and growing.
Would appreciate any help that can be given to lead me in the right direction.
I've had this as a suggestion....but don't know where to look for this code....
I'd say it may be coming from the following code on :staying-in-mykonos-myconian-k-hotel/room-at-myconian-k-hotel-mykonos/
It's also likely this is carried through the entire site.
https://www.facebook.com/pages/Beer-and-croissants/1423705111261254">
Note the " in the URL before https://www.facebook
I suggest you go through your code looking for similar issues.
Could someone please assist me if they are able.
Greatly appreciated.
thanks
Kerri

Linkedin sharing page keeps spinning

I’m trying to use the shareArticle API on a website for a client, whatever parameters I’m giving the share page keeps spinning, it seems to be a parsing issue but I’m not able to figure it out.I’ve also tried to use the share button API but it’s not better.
This is the URL I’m trying to share (but every URL from the site seems to be having the same issue) : http://www.urbanem.fr/formation-gestion-conflits-mediation-2/
Any idea what might be wrong?
Here’s the source code to generate the share button:
$postURLLinkedin = urlencode(home_url() . "?p=" . get_the_ID());
$linkedin_share = '<li><a class="sb-linkedin" href="http://www.linkedin.com/shareArticle?mini=true&url='.$postURLLinkedin.'&title='.urlencode($postTitle).'&source='.urlencode(home_url()).'&summary='.urlencode($postSummary).'" onclick="javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" title="Partager sur Linkedin"><i class="fa fa-linkedin"></i></a></li>';
If you load the url in your linkedin profile and then make sharing works again. It's not the right thing to do but I is saving me yet.
We need a fix for this, as I pass me the same. The link you want to share are created dynamic. The share is loaded and never get to share. With all browsers I have the same problem.
I just checked and its working fine. Though I didnt share it, but I was at the last step of sharing.

LinkedIn button shows up intermitent

I am using the code to place a linkedIn Follow button (generated here https://developer.linkedin.com/plugins/follow-company) on this page, http://new.janeirodigital.com (view Client Testimonials section). However, the buttons sometimes show up and sometimes don't.
I have read a little bit of cross domains issues that may cause this, but I am not able to find a workaround to fix this. If you visit that page in Chrome and see the errors console, you'll see a couple of errors like regarding the linked in button, like:
Unsafe Javascript attempt to access frame with URL mysite.com from frame with URL http://platform.linkedin.com/js/....Domains, protocols and ports must match.
Has anybody experienced this problem before?
Any help appreciated
Daniel
The messages you are seeing in the developer console in Chrome are unrelated to your problem. They are an artifact of the cross-domain communication and as you'll notice, you see them for Facebook and Twitter as well on the same page.
That said, viewing your page I am also seeing intermittent 403s for some of the backend calls that the FollowCompany plugin is making. I have alerted our NOC to the issue and they should be investigating now.
Reviewing your page, it seems you have done everything necessary and are set, so once we fix the operational issue you should be good to go.
My apologies for any inconvenience!
-Jeremy
I just found that this is happening when there are more than one follow button on the page, if you delete the first one and the second shows without problems but the others have the same problem...
Hope this could help your team Jeremy!!

Resources