📜 ⬆️ ⬇️

Authorization of users through Mail.Ru API: big effect of a small button

Hi, with you again Platform@Mail.Ru team!

In the previous post, we talked about various social plug-ins of My World, and also compared their effectiveness using the example of our own portal projects.

It is time to talk about other features of the Mail.Ru API , the possibilities of closer integration of sites with a social network. And, of course, business will not do again without cases - already cases of independent projects with real indicators of efficiency.

Registration of Mail.Ru users in two clicks

If you need to authorize or register a visitor on your site and he has an account on Mail.Ru (and an absolute majority of those on the Runet), you can make life much easier for yourself and him. Enough to implement the ability to register and authorize users through Mail.Ru API .

Instead of offering the user to fill out a long registration form on your resource for the 125th time, ask the user to log in "2 clicks" using the API. This will drastically reduce the “entry threshold” to your resource, as well as increase the loyalty of an existing audience. As soon as the user has agreed to authorize, you get access to his personal information from the profile on Mail.Ru: email, first name, last name, photo, gender, age, city, and so on.

Use this information for background automatic user registration. You also have the opportunity to offer the user personalized content and services, for example, switch to the site version for a particular city or show only male or female content.

Here's how it is all implemented on the website of one of our many partners - darberry.ru :

After clicking on the "Login" button, the user sees a window where he is invited to establish a link to the site, providing access to his profile:

If the user clicks the "Connect" button, then the full information about him is returned to you via the javascript API, and you can automatically register the user.

By the way, you can ask a person if he has not previously been registered on your site, and “link” his profiles into one. Here's what it looks like on the Bigbuzzy project. It is also a great example of automatically filling in fields in a profile based on information from a person’s Mail.Ru account:

By the way, the ability to quickly authorize Mail.Ru users on your site can be used not only in the registration / authorization form, but also, for example, in the form of commenting on news or articles on the resource.

The technical side of the integration

It is quite simple to connect authorization via Mail.Ru API to your website. To do this, you need to register your site and write a few lines of javascript code.

Below is an example of a page with minimal integration:

< html >
< head >
// ,
< script type ="text/javascript" src ="http://cdn.connect.mail.ru/js/loader.js" >
</ script >
<script type= "text/javascript" >
// ,
// ; API callback'
mailru.loader.require( 'api' , function () {
// app_id private_key
mailru.connect.init(__app_id__, __private_key__);
// ,
mailru.events.listen(mailru.connect.events.login, function (session){
mailru.events.listen(mailru.connect.events.logout, function (){
// , result callback'a
// (. )
mailru.connect.getLoginStatus( function (result) {
if (result.is_app_user != 1) {
// ,

// ( jquery)
$( '<a class="mrc__connectButton">@mail.ru</a>' ).appendTo( 'body' );
// Mail.Ru
} else {
// ,

mailru.common.users.getInfo( function (result){console.log(result[0].uid)});
</ script >
</ body >
</ html >

For more information on how to connect the authorization and other API features you will find on the pages of official documentation .

What effect can be obtained

Finally, numbers - for example, Darberry. All figures were received in the summer, before a large-scale advertising campaign on Mail.Ru.

Another example is altergeo.ru , a complex tech start-up with a predominantly “geek” audience. Their experience integrating the Mail.Ru API:

More interesting and convincing facts:

So integration of authorization through Mail.Ru API can be a significant improvement for your project.

It is clear that the convenient authorization features of the Mail.Ru API are by no means exhausted. In the next post we will tell even more!

The project team Platforma@Mail.Ru

PS As always, Anton Melnikov, Platform manager.Ru promotion manager, is ready to answer all your questions on deep integration. If you have not added it to your contacts yet - add: a.melnikov@corp.mail.ru
Of course, he reads the comments again and responds immediately.
Have a nice day!

Source: https://habr.com/ru/post/107097/

All Articles