Social media metrics remain one of the many moving targets in online marketing. How does getting someone to "like" your page or "retweet" your link correlate to more sales or better brand loyalty? By tracking those on-site social actions, we'll get a little closer to uncovering social media return on investment (ROI).
Tracking Google +1′s
Google released the Plus One button this month and has seen pretty strong adoption so far. If you're using this social plugin, it's a good idea to track it in whatever analytics platform you're using. Here's a quick walkthrough of how to do that:
1. Add the Plus One API script
Take this script and simply add it to the head section of your page:
2. Get your button
Create your Plus One widget using Google's button creation tool to get code that looks something like this:
3. Add your tracking script
Using Google's API, we can "listen" for any time someone clicks on the Plus One button and alert our analytics platform when it happens:
You can put any event-based tracking script in there and customize it to your heart's content. If you're using Performable, your code will look something like this:
And that's it! However, if you're using Google's Plus One, you're probably already up on Facebook's Like Button, a widget that needs no introduction. Here is a quick walkthrough of how to set that up.
Tracking Facebook Likes
Keep in mind that this only works with the XFBML version of the Facebook Like button. If you're currently using the iframe version, you can generate a new version of the code by visiting the Facebook Developer page.
1. Add your button code
Your Facebook button code should look something like this:
2. Add your tracking script
Just like the Google Plus One button, Facebook uses an API to listen for when someone likes/dislikes your page. To track that, toss this little snippet of Javascript at the bottom of any page that uses the Facebook Like button:
If you're a Performable customer, your script will look something like this:
If you want to track "dislikes" too, simply duplicate that block of code and change "edge.create" to "edge.remove" instead. And that's it! Congrats, you're now tracking social media engagement on your website!