Increasing conversions with Twitter’s OAuth authentication API

Login, simplified

login with twitter button Well, that’s a bit of a mouthful, isn’t it? What we’re basically discussing here is how to simplify your landing page form by supplying a simple “Login with Twitter” button so the user can convert much easier.

If you’re new to APIs or OAuth, let’s provide some background:

API is the acronym for Application Programming Interface. When you open a browser and request a URL from a distant server, the server responds and provides you with HTML, CSS, JavaScript and other media, and assembles the page for you to read. That’s a User Interface (UI). An API is a method for servers to do the same thing. Responses are in JSON or XML and are easily consumed by your server scripts. On the Internet, this allows applications across networks and languages to reliably communicate with one another.

Authentication is the process by which you log in to a server successfully. Typically, a username or email address and a password are looked up in a database and the program responds whether or not your password was correct for the given username.

OAuth is an open standard for authentication.

If you’ve ever used a service that asked you to log in with Twitter, Facebook, Google, LinkedIn or another platform, you’re actually authenticating through their server. The great thing about OAuth is that the third-party never has to capture your login credentials.

Why use OAuth for conversions?

Not surprisingly, studies have shown that the easier it is to complete a conversion, the greater the conversion rate. For a great resource, be sure to download Formstack’s 2015 Form Conversion Report. Conversion optimization focuses on reducing the steps needed to register or make a purchase on a site.

When users of social media sites like Twitter register for the service, they provide their name, email address and additional information. Typically, they also have to ensure the address used is valid.

If you’re looking to reduce the number of fields required for registration on a landing page, offering login through Twitter makes sense. That’s what OAuth allows you to do. Third-party social login providers like Janrain report that this can increase conversion rates by 50 percent!

Why implement OAuth?

Besides conversions, here are some reasons OAuth is a great process to implement:

  • OAuth requires tokens that the user can authorize or deauthorize — putting your users in charge of the data you can access. This means that the parent service, in this case Twitter, has to worry about maintaining security.
  • OAuth is a web standard that’s pretty easy for developers to implement. Virtually every major social platform supports OAuth and code samples are plentiful around the web.
  • Social platforms realize how critical mobile usage is and maintain a responsive interface for mobile for users to log in. So implementation works across any device at any size viewport! Logging in with Twitter can even work with mobile applications using Twitter’s Software Developer Kit (SDK).
  • Since you’re integrating with Twitter, you now have the opportunity for the person to share that event with their audience on Twitter.

Limitations to Twitter OAuth

A key limitation to Twitter’s OAuth for many years was that you could not extract the email address of the user who was logging in. This made Twitter less desirable for OAuth implementation. However, you can now request your application be whitelisted with Twitter. Once you are whitelisted, the “Request email addresses from users” checkbox will be available under your app permissions.

Use this form to request whitelisting.

Details on Twitter OAuth

For a complete description of Twitter’s OAuth methodologies, requests, responses and diagrams on how it works, be sure to check out Twitter’s developer documentation.

For quicker implementation, keep in mind you don’t have to recreate the wheel. Twitter has a huge list of available libraries to kickstart your project.

Steps for building your Twitter OAuth application

Example of contract for Twitter's oAuth authentication API

The basic steps to use Twitter OAuth authentication are to register the app, whitelist the app, and build the application.

1. Register the application.

2. Include your callback URL.

This is where the Twitter OAuth API will respond with the correct credentials for your application once the user signs in. It will receive a token that can be stored; this can be changed later.

3. Click submit.

Your application is now live! Keep in mind that you won’t be able to extract the email address until your application is whitelisted, though.

4. On the application page, click the Keys and Access Tokens tab.

Retrieving those tokens enables your application to access the OAuth API.

5. Test OAuth.

Just click on the Test OAuth button in the top right corner of the application page to see how it works.

6. Implement the necessary library to add the button to your login page.

7. Test!

If you’d like to bypass some of this effort, you can also utilize a third-party social login platform like Janrain, Gigya or Loginradius. Many of these services can be integrated with landing page and marketing automation landing page builders to integrate social logins much easier.

Image by: Jeremy Brooks via Flickr

Bryant Tutterow
Bryant brings over 18 years of business acumen to DK New Media focused on strategic marketing and e-commerce. He has more than a decade of P&L responsibility, leading in-house marketing organizations at Fortune 500 companies and building three separate marketing departments from the ground up into world-class teams of as many as 14 people. As the Chief Marketing Officer for DK New Media, he provides overall strategic direction for marketing and e-commerce while leading business development of all strategic advisory and measured marketing services.