Tuesday, June 28, 2011

How to Use the Google +1 Button Callback Parameter to Unlock Exclusive Content

Google +1 Button Callback Parameter

Since the release of the Google +1 button for websites in early June, many webmasters have been trying to figure out the best ways to implement it across their sites. In its most basic form, the +1 button is relatively easy to add to a webpage. You can grab two line of code, add them to your webpage, and be on your way. That said, Google has provided several parameters you can use with the +1 button that control how the button looks, what is displays, which URL should receive the +1, and which function you want to call when someone clicks the +1 button. Wait, did you catch that last part? Google added a mechanism for webmasters to trigger a JavaScript function when someone clicks a +1 button. The mechanism I’m referring to is the “callback” parameter of the +1 button, and it opens up a world of opportunity for webmasters. Let’s explore the parameter in greater detail, including what it is, how to use it, and how to avoid problems down the line.

What is the Callback Parameter?

As I mentioned earlier, you can implement the basic +1 button on your site with just a few lines of code. You need to include a JavaScript tag and then the +1 button tag. It’s essentially two lines of code and you’ll have a +1 button on a webpage. But, if you review the Google Code page for the +1 button, you’ll notice several other parameters. You have count, size, and href, which control the display of the +1 button, as well as identifying the URL that should receive the +1. Then you have the callback parameter, which takes the name of a JavaScript function as the value of the parameter. The JavaScript function you trigger can do anything you want (ok, not anything), and I’ll cover more about this soon.

Here is what the google +1 button code would look like when using the callback parameter:

  1. <g:plusone callback="helloWorld"></g:plusone>

When you include the callback parameter in the +1 tag, you provide the name of a JavaScript function that will be triggered when someone clicks the +1 button. In this example, the function called “helloWorld” will be triggered. Note, helloWorld() needs to be part of the global namespace, meaning it needs to be included in the page or referenced in the html file via a script tag. The function will receive a JSON object, which includes both an “href” value and a “state” value. “href” will include the URL that received the +1 and “state” is either on or off (where on represents a +1 and off means someone removed a +1). That information is good to know and you can handle each situation separately. More about this soon.

Example: A Simple JavaScript Function

Below, I have included a very basic JavaScript function that’s called when someone clicks a +1 button. It simply throws an alert displaying the state of the button when clicked. Note, this function could either reside in the page itself or it could reside in an external JavaScript file that’s referenced in your html page (via a script tag).

  1. function helloWorld(plusone) {
  2. window.alert('+1 Triggered, State=' + plusone.state);
  3. }

How the Callback Parameter Can Be Used

Based on adding the callback parameter to the +1 button, Google is enabling webmasters to creatively use the functionality to interact with users. For example, you could reward users that +1 a page on your site. There are some rules, though. Remember, +1’s impact rankings, so you don’t want to “buy” rankings. I attended a Google webinar last week that covered best ways to implement the +1 button and Google made it very clear that you should not pay for +1’s. That means you shouldn’t incentivize users with money, product, or services based on those users clicking a +1 button on your site. Here is the actual language from Google’s policy page:

“Publishers should not promote prizes, monies, or monetary equivalents in exchange for +1 Button clicks.”

The reason Google doesn’t want publishers incentivizing users with prizes or money is simple. +1’s impact rankings, rankings should not be manipulated in any way, and paying for +1’s is like paying for links. Don’t do it.

Unlocking Content is OK

Although you can’t provide products or services, Google explains that you can unlock exclusive content. Here is the language in Google’s policy regarding enabling content and functionality:

“Publishers can direct users to the +1 Button to enable content and functionality for users and their social connections.”

If someone +1’s your new blog post, you could unlock exclusive content for that user (and you can use this approach creatively, depending on your specific industry, business, etc.) For example, you could provide a study that goes deeper into a topic, you could provide additional tutorials on the subject matter, provide additional news about a topic, etc. Just make sure you wouldn’t ordinarily charge for that content. Yes, this seems like a slippery slope, since exclusive content might already have a price tag associated with it. As a webmaster (or marketer), you might need to build new content that could be part of your +1 program.

An Alternative Approach – Catching +1 Removals

Earlier in this post, I mentioned the “state” value that gets passed to your JavaScript function in the JSON object. That value will tell you whether someone +1’d a page or removed a +1. Knowing that someone just removed a +1 is important information, and you can act on it using the callback parameter of the +1 button. For example, maybe you can ask the person why they removed the +1, ask them to reconsider their +1 removal, or redirect them to a page that provides a more creative approach to catching +1 removals. Now, you don’t want to go overboard here. If someone just removed a +1, they obviously had a reason. You don’t want to add fuel to the fire and push the limits of getting that +1 back. That said, the right messaging could act as a legitimate confirmation that a user will be removing a +1, which could potentially save some of those votes. It would be interesting to test this out to see how many +1’s you can gain back by using the callback parameter.

Unlock Content, Get More +1’s?

As you can see, the callback parameter can be a helpful addition to the +1 button code. Depending on the “state”, you can either reward users with exclusive content, or you can address the removal of a +1. Remember, +1’s impact search rankings, so they can be extremely valuable to your organic search traffic. Just be careful about what you’re giving away to users that +1 content on your website. Make sure you aren’t giving away prizes, money, or services. The last thing you want is for a creative use of +1 to get you penalized. And if history has proven anything, you can bet that some webmasters are going to try and manipulate the system to gain more +1’s. As I said earlier, don’t go down this path. It’s not worth it. Play by the rules, be creative, and gain more +1’s the right way.

By the way, have you +1’d this post yet? :)

No comments:

Post a Comment

Disqus for ully's online marketing

Disqus for ully's online marketing