Answer the question
In order to leave comments, you need to log in
Tracking social activities in Google Analytics for My World by mail.ru?
Good day to all, friends!
It's no secret that Google Analytics does a great job with a lot of interesting tasks. Among the latest innovations is the tracking of social actions ( code.google.com/intl/ru-RU/apis/analytics/docs/tra... ). For Google +1 it works out of the box, as they say.
Tracking Facebook and Twitter takes a bit of fiddling, but Google has prepared live examples ( analytics-api-samples.googlecode.com/svn/trunk/src... ).
If you stretch your brain a little more, then you can make tracking for Vkontakte ( habrahabr.ru/company/icontext/blog/129333/ ).
But for the full picture, the remaining social networks are not enough - My World and Odnoklassniki. Of course, I understand that they are not so popular and in demand, but still, I want to “finish off” them too!
So, Mailru gives out buttons - api.mail.ru/sites/plugins/share/
They have their own API - api.mail.ru/docs/reference/js/
There is a usage guide - api.mail.ru/docs/guides /jsapi/
List of functions - api.mail.ru/docs/reference/js/ Usage
example - 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 track the events.like event, which can be liked, disliked in the Google Analytics counter.
Who has practice setting tracking?
PS I've been fooling around with this for two days, today I finally managed to load js asynchronously and it even worked. But so far, the test results have not appeared in GA. But I decided to ask those who know, just in case.
Many thanks in advance for your help and your answers!
Answer the question
In order to leave comments, you need to log in
Нашел вот такой код:
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();
In head, you need to add the script loading cdn.connect.mail.ru/js/loader.js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question