Posts Tagged ‘google analytics’
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.
A Powerful Way To Visualize Your Blog’s Keywords
Your assignment: Report back on how people are finding their way to your blog via Web searches. Take that information and make a change based on that finding.
You could dig into your blog’s built-in stats feature (if it has one) and find one or two interesting tidbits about keyword searches. Or, if you’re a masochist, you could try to access your raw log files and parse out referrer search strings. Lastly, you could walk into your sophisticated analytics program and start running massive reports and get deluged with data.
But, there is a simpler way. Enter Wordle.net. Wordle.net is a word art site that works by analyzing text. Paste in a set of words and it returns a beautiful word cloud. Simple.
I created this first word visualization by pointing Wordle.net to my jesseluna.com blog URL. This won’t tell me about visitors to the blog, but it will give me a quick look at what the blog is really offering up in terms of content. The larger the word, the more times it is being used throughout the blog site.
Now that you know what you’re serving up to search engines, you can see what web searchers are really looking for based on keyword data.
These are the steps I took:
- Log into Google Analytics account.
- Navigate to the site you want to analyze.
- You’ll be on the Dashboard. Go to Traffic Sources > Keywords
- You’ll see a list of keyword phrases under the “Site Usage” tab on the main part of the page.
If you’re using Google Analytics or any other stats tracking system, you should become very familiar with this keyword information. These are the words and phrases that people are searching over to get to your Web site.
Go to the bottom of that data table and select “500″ from the “Show Rows” drop down menu. The page will refresh and you’ll see the top 500 sets of keyword phrases. - Export that view by going to the top of the page and clicking on the “Export” drop down and selecting .CSV or .XLS. Download it or just open up the file.
- In the Excel file, scroll down until you get to the Keyword data and copy all the keyword phrases in that column.
- Go to Wordle.net’s “Create” tab then paste those keywords phrases into the “Paste in a bunch of text:” text area.
- Click on the Go button and in a few seconds your word art will appear.
- Use the tool bar to filter for language, change the color scheme, layout, and color and explore.
- You can now save the image to the Public Wordle gallery, take a screen shot of it and save it on your computer, or if you have Adobe Acrobat installed, you can print to Adobe Acrobat and save it as a high resolution image in PDF format.
This is the resulting keyword visualization.
From this visualization, I can tell which of my blog posts have driven the most traffic to the blog. I can see words related to my How To Add A Facebook Fan Badge To Your Blog post which included “Facebook”, “Tumblr”, and “Badge” keywords. When I compare the first visualization at the top of this blog to the one just above, I see that there are a lot of matches between what I’m writing and how visitors are reaching the blog. That’s what Search Engine Optimization (SEO) is all about.
Take Action
If you do try out Wordle.net and analyze your site’s keywords, don’t just sit on any new insights, take action. For example, I rarely write about Tumblr because I primarily focus on writing and teaching about WordPress blogs. But now, I’m going to schedule a couple of Facebook + Tumblr blog posts this month. I’m always looking for good tutorial topics.
Review
In this blog post we learned how to create a word visualization of your site’s content using Wordle.net. We also learned how to create a visualization using actual keyword search data from an analytics program. Lastly, we learned that we have to take action on our insights.
I hope this blog post was useful. If you created a visualization, feel free to comment below or post your Wordle.net art to the JesseLuna.com blog Facebook Fan Page.
Image Credit: Wordle.net




