dbushell/Socialite — Issue #7: Google Analytics social tracking
Author: alesma
Created: 2012-02-01 11:30:50+00:00
State: open

Hi David,

thanks for your awesome work!
I'm trying to call google analytics function to track tweets and likes.

I have no problem with facebook like thanks to window.fbAsyncInit that is called when all.js is loaded so i can do this wherever I want:

```
window.fbAsyncInit = function() {
_ga.trackFacebook();
};

```

with twitter i should call _ga.trackTwitter after widget.js is loaded, usually i call it with the async js code like this:

```
!function(d,s,id){
var js, fjs=d.getElementsByTagName(s)[0];
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src="http://platform.twitter.com/widgets.js";
js.onload=_ga.trackTwitter;
fjs.parentNode.insertBefore(js,fjs);
}
}(document,"script","twitter-wjs");
```

but i don't know how get the same results when using socialite.js

Can you help me?

Thanks.