I figured it out: If you want to pass your custom data to share with Facebook and LinkedIn this is what you need:
create your own server (in my case php) with custom data that looks something like this:
<?php if(isset($_GET['YOUR_PARAMETER'])) $par = $_GET['YOUR_PARAMETER']; ?> <meta charset="utf-8"> <title>SITE TITLE</title> <meta property="og:title" content="SITE TITLE" /> <meta property="og:type" content="website" /> <meta property="og:url" content="YOUR_URL?YOUR_PARAMETER=<?php echo $par ?>" /> <meta property="og:image" content="YOUR_IMG_URL_CAN_USE_PARAMETERS_ALSO" /> <meta property="og:description" content="You can use your parameter that will be shown as description when sharing to facebook like this: This is my parameter! <?php if($par) echo $par; ?>!" />
(put all this in head tag of course; you can leave body empty… )
use this link in your html when you want to share to Fb/Linkedin (this example is with AngularJS, but you could pass the variable for instance in php with echo as well)
<a ng-href="http://www.facebook.com/sharer.php?u=YOUR_URL?YOUR_PARAM={{PARAM_VALUE}}" target="_blank"> <div class="text">Share via Facebook</div> </a>
So to sum up:
Use
http://www.facebook.com/sharer.php?u=YOUR_URL?YOUR_PARAM=PARAM_VALUE
to share to Facebook (this sharer is supposed to be deprecated but it works)
Use
https://www.linkedin.com/cws/share?url=YOUR_URL?YOUR_PARAMETER=PARAM_VALUE
to share to Linkedin.
But beware: Facebook takes parameters only from
<meta property="og:url"
where LinkedIn takes them from the url that your customised server resides on.
You can use Facebook debugger tool to see what your customised server returns.