data-onSuccess don't works

40 posts / 0 new
Last post
Leandro Daniel Sardi's picture
Joined: 2011-03-05
Mar 5, 2011
data-onSuccess don't works

http://developer.linkedin.com/docs/DOC-1224#comment-2100I am using the share button in the way described above but no matter what I try, I cannot get the callback function  to be executed. Can someone tell me if they've ever got the data-onSuccess parameter to do anything at all?

Iris Hoekstra - Roscam Abbing's picture
Joined: 2011-01-19
Mar 7, 2011

Same problem here.I'm doing this:<script type="IN/Share" data-url="http://www.werkenbijsdb.nl" data-counter="right" data-onSuccess="onLinkedInShare"></script>I've put just a simple alert in the onLinkedInShare function, for testing purposes. The function is clearly never called. Does data-OnSuccess actually do anything at all? Does anyone know?

Leandro Daniel Sardi's picture
Joined: 2011-03-05
Mar 8, 2011

And why no expert answers to our questions?

Kirsten Hunter's picture
Joined: 2011-06-30
Mar 9, 2011

Leandro,Please be patient.  Monitoring and answering questions in the forum is important to the Developer Relations team, but sometimes we need to hunt down the answers to questions and it takes some time.This code works:<script type="IN/Share" data-url="http://www.linkedin.com" data-success="test"></script> <script type="text/javascript">function test() {  alert('shared');}</script>

Joined: 2011-06-03
Jun 3, 2011

It's not working for me.  Here's what I have:In my <head> I have:<script type="text/javascript" src="http://platform.linkedin.com/in.js">  api_key: <i put my API key here>  authorize: true</script>In the <body> I have:<script type="IN/Share" data-url="http://www.sap-web.com" data-success="mysuccess"></script><script type="text/javascript">function mysuccess() {    alert('success');}function myerror() {    alert('error');}</script>This is just the latest version.  I've tried it with data-onsuccess as documented, but moved to data-success based on the previous post here.  I've also tried it with the data-onerror attribute set.  I've also tried it with the full URL of the page, instead of just the home page.  Nothing seems to work.  In Firebug I get:IN.Objects is undefined Line 927IN.Objects is undefined Line 927IN.Objects is undefined Line 927IN.Objects is undefined Line 927(Yes, the same message 4 times)  Help?

David Hughes's picture
Joined: 2011-07-05
Jul 5, 2011

Is there any update on a resolution for this?  I am seeing the same issue happening in multiple browsers where the callback is not fired.

Jose Llamas's picture
Joined: 2011-03-11
Jul 12, 2011

Hi Kirsten,I have tried your code:<script type="in/share" data-success="test" data-url="some-url-to-share"></script>                                    <script type="text/javascript">                                    function test() {                                      alert('linkedinshared');                                    }                                </script>When I made click on button, the sharing action was done succesfully, and it appeared on my linkedin wall as hoped, but "alert" didn't worked.. so seems that there is some problem with "data-success" event controller.No js error found.

Kirsten Hunter's picture
Joined: 2011-06-30
Jul 12, 2011

Yes, this is a known issue with the framework at this time, and we're working on a fix.

Tim Ware's picture
Joined: 2011-07-14
Jul 16, 2011

One impact this bug has is the inability to track LinkedIn Share with Google's new asynchronous Analytics. Hopefully, your team is actually working on this. Cheers. Tim

Adam Cox's picture
Joined: 2011-07-19
Jul 20, 2011

With Google Analytics new social tracking this callback is needed more than ever. The docs for this are also appalling, 3 different versions of the param in the same example and none of them work? And I thought FB docs were bad!

Tim Ware's picture
Joined: 2011-07-14
- (Reply to #8) Jul 27, 2011

Just curious :-)

Christophe Camart's picture
Joined: 2011-08-01
Aug 1, 2011

I +1 Adam's comment above. I was trying to implement social tracking for google analytics and was surprised my callback function never worked... now I understand why. I would need this fixed quickly actually... Any update on this would be greatly appreciated.
Thanks!

Tim Ware's picture
Joined: 2011-07-14
- (Reply to #12) Aug 3, 2011

Hey Christophe, I'm with you, but it appears the Linkedin developers don't pay much attention to the developer area. Pretty flakey. You would think this bug would get some priority and be squashed, but Linkedin appears to be pretty weak in the developer-support community. -Tim

Jeremy Johnstone's picture
Joined: 2011-04-17
- (Reply to #13) Aug 3, 2011

My apologies to you, but we have a policy of not committing publicly to timelines until a feature or bug fix is ready for rollout and has been tested. I can say it will be soon, but any more specific than that I can be.

Joined: 2011-08-17
Aug 17, 2011

<script type="IN/Share" data-url="http://www.ramddr3.com" data-success="linkedinSucess" data-onclick="linkedinSucess"></script>

I'm try this code but still no luck.

Tim Ware's picture
Joined: 2011-07-14
- (Reply to #14) Aug 17, 2011

Any explanation as to why the bug appeared to be squashed from July 21 to Aug 13, 2011, during which period my Google Analytics tracking of the LinkedIn Share button behaved normally? Now it's back to logging a Share on each page load.

This bug was reported in early March, over 5 months ago!

Jeremy Johnstone's picture
Joined: 2011-04-17
- (Reply to #16) Sep 15, 2011

Hi Tim,

I have no clue why you experienced that in that time window. The fix wasn't rolled out until just two weeks ago and our QA team is now actively investigating why it's not working for you and attempting to reproduce in a test environment.

As to your comment in the end, various bugs have different priorities. We have literally tens of thousands of developers who we support, and do so each and every day via various channels (which include these forums). One factor that weighs into the prioritization of bugs (but certainly not the only factor) is how many developers are impacted. Looking at this thread and comparing it to say the SSL issue with image sprite (just using as one example) you can obviously see a big difference just in the forums here in the number of partners impacted. I realize this is probably obvious to you and you are just venting your frustration to things not working for you, but I do want to make it clear we value each and every bug report, even if it takes a while to resolve it because of other bugs taking higher priority.

Jeremy Johnstone's picture
Joined: 2011-04-17
- (Reply to #15) Sep 15, 2011

That is because you are using the wrong parameter name...

<script type="IN/Share" data-url="http://www.ramddr3.com" data-success="linkedinSucess">

should be:

<script type="IN/Share" data-url="http://www.ramddr3.com" data-onsuccess="linkedinSucess">

Jeremy Johnstone's picture
Joined: 2011-04-17
Sep 15, 2011

For anyone stumbling onto this thread in the future, the fix has been rolled out as of September 2011 and extensively tested. If you experience issues, please be sure and confirm you aren't having the issue mentioned in reply #15/18. If you still have a problem after confirming that isn't the fix, feel free to post here and one of us will be happy to help.

Joined: 2011-09-01
Sep 23, 2011

It's not working for me:

1
2
3
4
5
6
7
var handleLinkedIn = function(param){
     return function(){
            return function(e){
                       [code]
             }
      }
}

And I create the script tag dynamically:

1
2
3
4
5
6
var renderLinkedInButton = function(container, linkedInCallback){
     var po = document.createElement('script');
     po.setAttribute('type', 'IN/share');
     po.setAttribute('data-onsuccess', linkedInCallback());
     container.appendChild(po);
}    
Jeremy Johnstone's picture
Joined: 2011-04-17
Sep 23, 2011

Hi Kevin,

The code you pasted isn't a working example and came through as mostly jibberish. Can you please fix your post so it's valid?

-Jeremy

Tim Ware's picture
Joined: 2011-07-14
Nov 28, 2011

Kevin: Are you *sure* it's supposed to be

<script type="IN/Share" data-url="SOME-URL" data-onsuccess="linkedinSucess">

and NOT:

<script type="IN/Share" data-url="SOME-URL" data-success="linkedinSucess">

as you state above?

For me, data-success was working fine right up till Oct 25, 2011 when I stopped getting LinkedIn Share data in Google Analytics, while still getting LinkedIn Shares on my pages, according to the counter.

Since Oct 25, I've gotten zero analytics.

I'm trying out your data-onsuccess approach and will update here.

Tim

Jeremy Johnstone's picture
Joined: 2011-04-17
Nov 29, 2011

Hi Tim,

Yes, it should be "data-onsuccess".

-Jeremy

Tim Ware's picture
Joined: 2011-07-14
Dec 10, 2011

This attempt to get Google Analytics working with LinkedIn Share button is driving me nuts!

In the <head> I have:

<script type="text/javascript">
function LinkedInShare() {
_gaq.push(['_trackSocial', 'LinkedIn', 'Share']);
}
</script>

and in the body of the page, I have:
<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-counter="right" data-onsuccess="LinkedInShare"></script><script type="text/javascript">LinkedInShare();</script>

I'm getting a recorded share in Google Analytics with each page load.

Is there something incorrect in my above code?

Thanks!

Jeremy Johnstone's picture
Joined: 2011-04-17
Dec 12, 2011

Hi Tim,

Having this line here:

<script type="text/javascript">LinkedInShare();</script>

Causes it to record a share for every page view. If you remove just that one line, you should then get the behavior you are looking for.

-Jeremy

Tim Ware's picture
Joined: 2011-07-14
Dec 12, 2011

Thanks Jeremy. Yes, I just figured that out earlier this morning but hadn't yet been able to check it in GA.

I notice above that people were referencing:

data-onsuccess="linkedinSucess" (with one "c")

But I've been using:

data-onsuccess="LinkedInShare"

Which should it be? Thanks again.

Tim

Jeremy Johnstone's picture
Joined: 2011-04-17
Dec 14, 2011

Hi Tim,

It should be whatever you name your function. The parameter inside the quotes is the name of the Javascript function you want to have invoked on success.

-Jeremy

Paul Boutin's picture
Joined: 2011-10-06
Dec 20, 2011

I have the data-onsuccess working... whats the proper parameter to use to report an un-success, cancel or error?

Jeremy Johnstone's picture
Joined: 2011-04-17
Jan 2, 2012

Hi Paul,

The proper parameter to use for that would be a data-onerror and would be a callback just like with data-onsuccess. That said, I don't believe we bubble up all errors, so if it's not working for you, can you let me know which error you are seeing and I will file a bug for the team to investigate?

Thanks!

-Jeremy

Henk Test's picture
Joined: 2013-08-02
Apr 7, 2014

Hi all,

I tested the code of Kirsten but the test function is never called. I can share the link properly but when I click the green close button nothing happens.

This is the script i'm testing:

<script type="IN/Share" data-url="http://www.linkedin.com" data-success="test"></script> <script type="text/javascript">function test() { alert('shared');}</script>

Any suggestions?

Thanks in advance,

-Theo

Henk Test's picture
Joined: 2013-08-02
Apr 7, 2014

Dear experts,

Please take a look at this url:
https://developer.linkedin.com/documents/tags-and-templates

In the last example example of the Share Button, data-succes is used instead of data-onsuccess
A bit confusing, which one is the right one?

Joined: 2014-03-28
Apr 8, 2014

Hello Guys

I am using data-onsuccess for track linkedin share,it work but today it is suddenly stops working and not any js error.

Please help me as soon as

Henk Test's picture
Joined: 2013-08-02
Apr 8, 2014

Same problem...

Lee Fu's picture
LinkedIn Employee
Joined: 2013-06-19
Apr 8, 2014

Hi guys,

This is a known issue and is in our backlog for a fix.

Sorry about the inconveniences.

Thanks,
-Lee

Jnanendra Pande's picture
Joined: 2014-03-12
Apr 10, 2014

Hi there, ,
I read LinkedIn blog titled "Register your OAuth 2 redirect URLs", 'by Shikha A.Sehgal, published on 13 March 2014. In the article, it is mentioned that anyone who use OAuth 2 to register your application's redirect URLs with us by April 11, 2014. our Redirect Url domain is force.com and there will be several redirect url subdomains. My question is do we need to register all the redirect URls with subdomain or we can just register the only the domain URL.

Thank you.

-Jnanendra

Lee Fu's picture
LinkedIn Employee
Joined: 2013-06-19
Apr 10, 2014

Hi Jnanendra,

Yes, you need to register each subdomain you will be using. In the future please post in a relevant thread.

Thanks,
-Lee

Joined: 2014-04-10
Apr 11, 2014

Hi Lee, did you solve callback problem from 8 april? I spend a lot of time today and tryed different reciepes to make callback working with no success.
How we can be informed?

Lee Fu's picture
LinkedIn Employee
Joined: 2013-06-19
Apr 11, 2014

Hi Artem,

This is currently in the backlog for a fix but without a specific release date. I am sorry about the inconveniences.

Thanks,
-Lee

Jean-Francois Ethier's picture
Joined: 2012-10-25
Apr 14, 2014

Hi Lee,

What's the best way to stay informed about this problem ?

Thanks

Lee Fu's picture
LinkedIn Employee
Joined: 2013-06-19
Apr 15, 2014

Hi Jean-Francois,

Sadly the "notify when comments are posted" is broken at the moment. I have no way of communicating this out other than posting on these forums.

Our apologies,
-Lee