In a previous post, we covered the basics of setting up @Anywhere on your website. Here, we will take things a step further and describe how to create a members only or VIP section. This will be a page or section of a page on your site that is only visible to certain people. These are Twitter users who have authorized your site to connect to their Twitter account via OAuth. This connection could later be used as part of a marketing funnel or leveraged using more advanced techniques.
First, we create a <span> element with an id of “authContent” (you could pick any name you like) which will be a place-holder for our content. What follows is an @anywhere block that does a couple of things:
- We check to see if the visitor has already logged into Twitter and authorized your site.
- If they have, we show them a personalized greeting that includes their Twitter username. This is the section where you would put some type of premium or VIP content.
- If they have not, we show a button that allows them to simultaneously connect to your site via OAuth and follow you on Twitter. Just be sure to change the “BlackWeb20″ part to your own Twitter username.
I kept this example dead simple so that it would be easy to grasp the basic concept, but this is definitely just the tip of the iceberg. All you’ve got here is a way to get people following you that might actually be interested in your brand or site, but you can take things much further. Here are a couple of examples that I’ll leave as exercises for the reader:
- Why should the visitor follow you on Twitter at all? It’s relatively simple to reorganize things so that you entice visitors to follow you in exchange for something. This could be a free download of some kind, for instance.
- Why not go viral? @Anywhere provides a Tweetbox feature that lets you set the default content. It’s somewhat tricky, but possible to offer something of value in exchange for a shout out on Twitter. Hint: You’ll need a way to differentiate these @mentions, maybe via a custom hashtag, phrase, or link that must be included.
As always, feel free to ask questions in the comments. What ideas can you think of for leveraging @Anywhere? Have you already implemented anything? Tell us about it.