Posts Tagged ‘tracking’
How To Track Tweet Button Clicks In Google Analytics

I use Google Analytics to track activity to and from my blog. Unfortunately, there are a lot of holes in that process, especially related to Twitter clickthroughs.
- First, some users bookmark the page, then revisit the site. These visitors are great because they found value in the site and are coming back for more. However, there is no way to tell if someone actually bookmarked the page or if something else happened.
- Other visitors arrive here by clicking on a link from a mobile Twitter application. Several of these applications remove the “referrer” information which causes another question mark when I go to check stats.
- If a visitor is using Internet Explorer and clicks through on a link from a site that uses a JavaScript popup, then the referrer information is lost. This sounds like a minor case but if you’re doing hardcore tracking to drill down on a marketing campaign’s ROI, this factor can be maddening.
- Lastly, if a visitor clicks on the Tweet Button and posts a link to Twitter, the URL is “automagically” shortened via Twitter’s link service (http://t.co). If a user clicks on a tweeted out link, you’ll know that the visitor came from Twitter but you won’t know where the link originated. Did a user get there from clicking on a Tweet Button link? Did someone cut and paste the blog post’s URL from the Web browser into a tweet? Inquiring minds want to know.
The Benefits
Before I started using this Google Analytics tracking technique, 16.8% of my traffic was showing up as “Direct Traffic.” After I started tracking Tweet Button clicks and Feedburner subscription clicks, that number went down to 13.45% and a new “Other” figure emerged.

This is awesome because now I can examine the behavior of visitors who click on the Tweet Button. Do Tweet Button visitors stay longer, visit more pages, or take key actions? Now I can answer some of these questions when before it was a mystery.

Because a good chunk of my blog’s traffic comes from Twitter interactions, you can see that the TweetButton clicks are in the site’s top 10 Traffic Sources. I can also see individual stats related to these visitors such as Bounce Rates, Time On Site, Goal Conversions and more.
The Hack
We’re going to address the last case with this next hack. In order for this to work, you won’t be able to use the standard Tweet Button plugin. We’ll have to add the button by hand.
- Go to the Google URL Builder Tool page.

- Enter your site’s URL.
- Enter the Campaign Source, Medium, and Campaign Name. I used “Twitter”, “TweetButton”, and “Blogpost” respectively.
- Click on the “Generate URL” button. This will build a link just below the button.
- Copy the link. We’re mostly concerned with the end of the link, starting with the “?” mark.
- Paste this code into your theme’s Header or Footer template files. I placed the code just before the < /head > tag in the Header.
[php]<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>[/php] - Configure your Tweet Button HTML code as in this example (for WordPress.org blogs): [php]<!–Twitter tweet button–>
<a href="http://twitter.com/share"
data-url="<?php the_permalink(); ?>?utm_source=twitter&utm_medium=tweetbutton&utm_campaign=blogpost"
data-via="jesseluna"
data-text="<?php the_title(); ?>"
data-related="niceblog:My Blogging Lab"
data-count="vertical">Tweet</a><!–/Twitter tweet button–>[/php]
The main “hack” comes from the data-url parameter value where we add the Google Analytics formatted tracking parameters, just after the Permalink. This way, when Twitter shortens the link into it’s t.co format, the link value will contain the tracking information.
In the above example, “data-via” is the Twitter user name that will appear on the tweet as “via .” “Data-text” is the text I want to display with the link. In this case I’m displaying the post’s title. “Data-related” is an optional related account that can be displayed. In this case I’m showing my blogging Lab account, @niceblog. The “data-count” value indicates how you want the button to appear on the screen. I chose a vertical format. You can see all the options on the Twitter Tweet Button blog page.
- For WordPress.org blogs, paste the edited code into the Page, Single Post, and Main Index template files. I added the button just before the blog post content, after the title and date/author section of the templates. This will vary based on your preference and on other tweaks you’ve made to your theme.
I tried hacking Posterous and Tumblr blogs but the built in URL template tags kept blowing away the parameters once the Tweet Button was called. If you figure out how to do this please drop a comment and I’ll update this post.
Review
We just learned how to tack on a Google Analytics parameter to Tweet Button clicks on a WordPress.org blog. This will help you connect the dots on your online marketing and analysis activities.
If you find this useful, I’d be interested in how and why you would use it. Are you a marketing manager, a small business owner, or a code hacker? I’d love to find out.
5 Hot Tips For Serious News Hounds
Do you follow over 100 news sources? Are you the first to retweet earthquake tweets? Do you send late night DM’s to major new sources then see them show up on the news a few minutes later? If so, then you’re definitely a news hound.
Here are five tips to keep you at the top of the news food chain.
1) Follow a lot of news sources via Twitter.
News agencies are changing the way they present news information online. Before they used to only post full news stories. Now many are employing the “first to break” strategy. In that strategy, news agencies will start with a tweet on Twitter then move on to a very brief post on their site. If you follow a lot of news sites then you can use some of the other techniques below to stay ahead of the story.
Actress and activist Alyssa Milano (@Alyssa_Milano) is great at posting hot news. If you look at who she’s following on Twitter, you’ll see a ton of news sources. By finding then retweeting news items, Alyssa is able to provide a valuable resource to her followers. Hot news also makes for great retweet material.
2) Follow a lot of people on Twitter.
If you are really on the hunt for news, you need to follow a lot of people. Breaking news happens all the time, in all parts of the world. Reading tweets from many followers helps build a picture of what’s going on without having to cobble information based on Trending Topics.
Rich Sanchez from CNN (@ricksanchezcnn) follows over 47,000 people and feeds on Twitter. This helps him track stories and connect with potential news sources.
If following many people puts a crimp in your social media plan, then rely on method number one and follow top breaking news sources.
3) Use Twitter’s advanced search.
With Twitter’s advanced search you can track down stories based on 18 different filters. One of the most powerful measures is searching by Place. For example, if you know there is a strong earthquake in a particular location, you can enter that location in the “near this location” textbox then set the distance from that location. This will show tweets from people that are actually in the area.
Also, if you enter “Twitpic” in the Words section, you can retrieve tweets with links to pictures.

4) User Twitter lists.
My process for tracking natural disaster news is to spot the news items from my timeline then do an advanced Twitter search and identify people who are in the region. The next step is to add those Twitterers to a new Twitter List. I used that news tracking process during the Fort Hood shootings.
Tracking people near the news site during an emergency or natural disaster helps give a three-dimensional view of what’s happening. The tweets are also likely to be less “filtered” then that coming from official news sources.
5) Search emergency live feeds.
When you are on the news hunt for information on an emergency or natural disaster, do a Web search over [cityname] + “fire department live feeds.” Fire trucks are often the first on the scene of an emergency and you can usually find a live feed online. I used fire department scanners to track the plane crash in Denver in 2008.
6) BONUS: Search Web Cams.
You’ve been very patient up to now so I’m throwing in a 6th Hot Tip. If you do a Web search over [cityname] + “live cam” or “web cam” you will usually be able to get video of the area. I used this technique during the last tsunami watch in Hawaii and off the California coast.
Assignment
The next time emergency news breaks, use techniques 3-6 above and get a rich 3D view of the news story.
Do you have any other resources or techniques that you use for tracking breaking news? I’d love to hear about them.



