Tracking social actions in Google Analytics for My World from mail.ru?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
29 views
Good afternoon, friends!


For anybody not a secret that Google Analytics does an excellent job with many interesting challenges. Among the latest innovations — tracking of social action ( code.google.com/intl/ru-RU/apis/analytics/docs/tra... ). For Google +1 it works, as they say, out of the box.

To track Facebook and Twitter need to pocalypse, but Google made live examples ( analytics-api-samples.googlecode.com/svn/trunk/src... ).

If a little more straining your brains, you can do tracking and VK ( habrahabr.ru/company/icontext/blog/129333/ ).


But for the full picture lacks the rest of the social networks My World and Classmates. Of course, I understand that they are not as popular, but still, I want to "finish" them!


So, Mailru gives buttons api.mail.ru/sites/plugins/share/

They have their own API api.mail.ru/docs/reference/js/

There is a guide to use — api.mail.ru/docs/guides/jsapi/

List of functions api.mail.ru/docs/reference/js/

Example of use api.mail.ru/docs/guides/sites/

And the most valuable event events.like — api.mail.ru/docs/reference/js/events-like/

So, the goal is to capture the event events.like that can be liked, unliked in the Google Analytics counter.

Anyone have practice set up?



PS Procolophonia this thing for two days, today finally managed asynchronously load js and it even worked. But while the test results did not appear in GA. But I decided to ask the knowledgeable, svaki case.

Many thanks in advance for your help and your answers!
by | 29 views

1 Answer

0 like 0 dislike
I found this code:
\r
mailru.loader.require('api', function() { mailru.connect.init('siteid', 'privatecode'); });
_ga.trackmymail=function(opt_pageUrl, opt_trackerName){
try {
if (mailru && mailru.events && mailru.events.listen) {
mailru.events.listen(mailru.plugin.events.liked, function(event, params) {
var button_type = _ga.extractParamFromQuery_(params, "type") || 'mymail';
if (button_type) {
_gaq.push(["_trackSocial", button_type, 'like', opt_targetUrl, opt_pageUrl]);
}
});
mailru.events.listen(mailru.plugin.events.unliked, function(event) {
_gaq.push(["_trackSocial", 'mymail', 'unlike', opt_targetUrl, opt_pageUrl]);
});
}
} catch (e) {}
}
_ga.trackmymail();
\r
In head it is necessary to add the download script cdn.connect.mail.ru/js/loader.js
by
110,608 questions
257,187 answers
0 comments
40,251 users