digitalpoint
Well-known member
Google Analytics allows you to do some interesting things beyond just the default tracking, for example...
I'd be happy to write the code for XF for it all if developers wanted to use it (for the Facebook/Tweet tracking it's more or less just utilizing the callbacks available in their APIs).
http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html
This is the Twitter/Facebook tracking we use now (Google+ is automatically tracked already)...
As a side note, it wouldn't be a bad idea to incorporate the Google Analytics code into a static JS file, where you just pass the profile ID to it. Especially if we start tracking more stuff (no point in bloating pages with a bunch of static analytics tracking code, in my opinion).
- Site Speed
- Social Interaction
- Site Search tracking (what people are searching for ON your site)
I'd be happy to write the code for XF for it all if developers wanted to use it (for the Facebook/Tweet tracking it's more or less just utilizing the callbacks available in their APIs).
http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html
This is the Twitter/Facebook tracking we use now (Google+ is automatically tracked already)...
Code:
// Delay binding by 1 second (Twitter doesn't have twttr object yet).
setTimeout(function() {
try {
// Track Facebook Likes, Unlikes and Shares in Google Analytics
FB.Event.subscribe('edge.create', function(targetUrl) {
_gaq.push(['_trackSocial', 'Facebook', 'Like', targetUrl]);
});
FB.Event.subscribe('edge.remove', function(targetUrl) {
_gaq.push(['_trackSocial', 'Facebook', 'Unlike', targetUrl]);
});
/* Not using Send button
FB.Event.subscribe('message.send', function(targetUrl) {
_gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]);
});
*/
// Track Tweets in Google Analytics
twttr.events.bind('tweet', function(event) {
if (event) {
var targetUrl;
if (event.target && event.target.nodeName == 'IFRAME') {
targetUrl = extractParamFromUri(event.target.src, 'url');
}
_gaq.push(['_trackSocial', 'Twitter', 'Tweet', targetUrl]);
}
});
} catch(e) {}
}, 1000);
As a side note, it wouldn't be a bad idea to incorporate the Google Analytics code into a static JS file, where you just pass the profile ID to it. Especially if we start tracking more stuff (no point in bloating pages with a bunch of static analytics tracking code, in my opinion).
Upvote
28