How to Track Twitter Referrals from a WordPress Blog

Here at OurChurch.Com we use Google Analytics extensively to track what is trackable. Everything from referral traffic sources to click through rate information on specific keywords can be tracked and easily interpreted in graphical format once Google Analytics is fully integrated into your site

One trackable element that seemed to escape our tracking data was when our links are shared using our Tweet button and capturing event tracking data from those user actions. Questions such as whether or not visitors are sharing links from our blog homepage or the individual post, where to properly place the tweet button to get the most clicks, how much traffic is our site receiving from our posts being shared on Twitter, etc. were yet to be answered.

To solve this problem, we implemented Nicolas Gallagher’s WordPress modification “Custom Tweet Button for WordPress“. The Custom Tweet Button modification consists of adding two php files to your WordPress configuration and making several edits to your theme’s functions.php and styles.css files. The Tweet Button created by this add on is simple HTML and the webmaster has full control over the exact call sent to the Twitter service. Since the webmaster has full control over the call, it is possible to easily embed Google Analytics campaign tracking information.

You will need a bit.ly API key to use the modification. When we signed up, bit.ly API key generation was a manual process and took a few days to complete. Once you have your full API key you have everything you need to implement this custom modification to your own WordPress setup.

After you have made the appropriate file modifications and uploaded the files included in the modification package, adding the tweet button is a simple matter of calling the function tweet_button in your desired template file (for an individual post, you will call the function in your single.php file).

Adding your own custom tweet button gives you full control over the HTML/CSS of your Tweet button, saves all of your click/referrer data to your bit.ly account, speeds up your page loads since there’s no need for javascript or iframes and makes it simple to add in Google Analytics for even more data.

Do you have your own blog? Do you use WordPress? Are you currently tracking your Twitter data in anyway? Share your data tracking experiences in the comments.

Richard Ward is a Sr. Web Applications Developer for OurChurch.Com. Richard's professional background is in LAMP style web development. Richard is also a technology enthusiast with a strong interest in emerging technologies. You can reach him at richard@ourchurch.com or on Twitter at @OCCRichard.

4 Responses to “How to Track Twitter Referrals from a WordPress Blog”

  1. How to Track Twitter Referrals from a WordPress Blog | Christian Web Trends Blog I was suggested this blog by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are amazing! Thanks! your article about How to Track Twitter Referrals from a WordPress Blog | Christian Web Trends BlogBest Regards Craig

Trackbacks/Pingbacks

  1. Tweets that mention How to Track Twitter Referrals from a Wordpress Blog | Christian Web Trends Blog -- Topsy.com - Jan 27, 2011

    [...] This post was mentioned on Twitter by Paul Steinbrueck, Allan Roberts. Allan Roberts said: How to Track Twitter Referrals from a WordPress Blog: Here at OurChurch.Com we use Google Analytics extensively … http://bit.ly/eROy93 [...]

  2. How to Track Twitter Referrals from a Wordpress Blog | Christian … - Jan 27, 2011

    [...] See the rest here: How to Track Twitter Referrals from a WordPress Blog | Christian … [...]

  3. Pro Blogger News - Feb 15, 2011

    How To Track Twitter Referrals From A WordPress Blog Christian Web Trends Blog…