0
votes

I am faced with a LinkedIn sharing issue. This issue probably reproducible from March 1st 2019.

I share some url e.g. https://www.linkedin.com/sharing/share-offsite/?url=SHARE_URL#HASH Worked before: link in post(href) - SHARE_URL#HASH Works now: link in post(href) - value of og:url meta tag from SHARE_URL#HASH page

So we lose request parameters in SHARE_URL and #HASH

How we can pass link for LinkedIn post into request?

1
Do u want to share on linked in or Via linked in ? - Mubeen Khan
I want share article via button. - VzrivPaket
I want share some query parameters too. This query parameters is analytics for my site. For example SHARE_URL?user_from=twitter, SHARE_URL?user_from=facebook, SHARE_URL?user_from=lenkedin. Facebook and twitter works correctly. But linkedin sharing does not use link directly for href post, it uses og:url could be. - VzrivPaket

1 Answers

1
votes

You need to do URL-encoding with parameters you are feeding to another URL. So, this is what you should want...

https://www.linkedin.com/sharing/share-offsite/?url=SHARE_URL%23HASH

Remember, URL's use things like ? and # to indicate a special argument occurring after this character. So, for instance, example.com/share.php?title=thisistitleright?&..., how would the browser know that the first ? indicates the GET param and the second ? is a part of the title argument? Easy: URL encoding.

In case you want to know more: Official LinkedIn Share Documentation