Linkedin recommend product button - takes users to linkedin website

313 views Asked by At

I dont know if this is something I'm missing - but when I add a linked recommend product/service button on my website - when users click on it - it simply takes them to the linkedin product page - where they again have to click on the "Recommend" button.

I dont see the point of this. Why do I need to add a script - simple to redirect users to the linkedin page.

Ideally I was expecting it to work as the Facebook "Like" button - when you click on it - you are not sent to facebook to like the page - it gets done on my website itself.

So this is the code I got from linkedin

<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/RecommendProduct" data-company="xyz" data-product="12345"></script>

If all this is doing is redirecting - I can accomplish that by

<a href="http://www.linkedin.com/company/xyz/qwerty-12345/product?prdId=12345">
<img src="linkedin_Reccomend.png/>
</a>

I feel I'm missing something. I'll appreciate if you guys let me know if this is how it is supposed to work or is there a work for users to recommend the product on my website itself without leaving

Thanks

2

There are 2 answers

0
Dennis Guse On

As long as you wan't to stick with the original generated script, it won't work. It basically generates , which does not seem to be handled by Javascript (at least not while debugging in Chromium). You can even disable Javascript execution and it still works.

But I must admit that this looks like an error. In addition to in.js a second js-File is included and in line 1993 a function is defined to create the button including event handlers for mouse events (also counting clicks).

IMHO it looks as if there is a problem during creating of the inner link (and handling of the click).

I see only one option: send the request directly to: http://www.linkedin.com/company/%7BCOMPANY_ID%7D/product?prdId={PRODUCT_ID} and hope that CORS is enabled (I didn't saw it; so go for a CORS-enabled proxy) and probably hope that the user is logged...

0
Amit On

It's actually working as intended, it's pretty pitiful, but that's how they've designed it; https://www.linkedin.com/cws/share?url=http%3A%2F%2Fwikipedia.org.