Keyword Trends in Google Analytics With Greasemonkey

Note: We've updated the script to work on Firefox 3 as well as Firefox 2.

After the warm reception for the first version of our Enhanced Google Analytics, we decided to add some new functionality. (Nothing like a few kinds words to keep us in the giving mood.) The first script created a couple new tables in the Google Analytics interface that highlight recent changes in referral visits. It uses Greasemonkey, an add-on for Firefox that allows a user to insert javascript directly into a webpage.

Our update gives you even more ability to understand the data in Google Analytics:

  • At the suggestion of Avinash Kaushik, the new script works for keyword data, helping you see how organic search traffic is changing. An increase in a keyword may indicate a general change in user interests and/or improved performance on search results.
  • My coworker Pete Skomoroch also suggested that I add the ability to see declines in referrals and new keyword searches.
  • With the help of Paul Irish, the script is now better able to interface with the date widget on the Google Analytics site.

(Click the above button for a simulation.)

Keyword Growth Keyword Decline

When you click the button, your browser will download some historical data behind the scenes, and display a nice summary of the best and worst performing keywords/referring domains.

Installation Instructions:
Firefox 2.0+
Greasemonkey
googleanalyticsdownloade.user.js

If you don't already have Firefox, install it. Install Greasemonkey, and do the required Firefox restart. You should see a handsome monkey peeking at you from the bottom right hand corner of your browser. Open the script file in your firefox browser, and Greasemonkey should give you an option to install the script.

Afterwards, log into Google Analytics, and navigate to your Referring Sources or Keywords Tab. Click the button.

Configuring the script:

We spent some time trying to find convenient default settings here at Juice Analytics, so the script should work straight out of the box. Some users, however, may find it convenient to alter some of these configurations. To do so, in Firefox, go to Tools=>Greasemonkey=>Manage User Scripts..., select Google Analytics Downloader, and then click Edit in the lower left corner of the window. This should open up the script file in a text editor. If your computer does not have a default text editor configured, you may have to choose one. 'c:\windows\notepad' is a good bet for Windows machines.

This is what you should see:

Code Blurb

The bracket labeled 'keywords?' controls defaults for the Keywords page, and correspondingly, 'referring_sources?' controls the Referring Sources page.

To change the settings, simply change the corresponding variable to your preferred default. Make sure to refresh your Google Analytics webpage, if you have it open, so the new settings are loaded.

Now for the nitty gritty configuration details:

  • display_limit: This controls the maximum entries that each table will contain. This may be useful for large, sprawling sites.
  • growth_tolerance: This is the percentage growth parameter. Changing it to .10, for example, will catch everything that has grown by 10%, as opposed to the default 50% and 20%, respectively.
  • minimum_number_elements: This is a significance benchmark that can be used to limit what is displayed upon the screen. By default, only keywords with at least 10 elements are displayed upon the screen. Referring Sites does not have a minimum by default, but one can be set if desired.
  • limit: Limit is more of an internal parameter that determines how many entries should be downloaded from Google in order to get the results that are visible here on the page. Lower the limit to increase speed. If the limit is set to a very high number, you will get the largest result set, but you will have to sit around for a while for the results to load. Since the results are downloaded ordered by volume, raising the limit from the default numbers will not actually give more significant results. You will simply get more of the smaller results, such as keywords with only 1 hit.
  • look_back: This is a very important parameter. The script uses the date displayed upon your Google Analytics page to determine the full range that you want to consider in your results, but 'look_back' determines how many of those days are used for the significance test. So, say the range you have displayed in Google is March 23 - April 22 and your look_back is 7 days. The script will compare the average referrals for a given keyword from April 16-22 to the average from March 23-April 15, and will return the keyword only if the recent average is 20% higher than the rest of the time period. Thus, if you want to increase the total range of the data, change the dates on the actual webpage. Change 'look_back' only if you want to change the period of significance.

Happy analyzing!

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. All source code is released under a BSD License unless otherwise specified.

9 comments | Show all comments only the last 5 are shown


May 12, 2008
Brian said:

Great work guys! This is killer!

New to the blog, but you've won a reader. ;)


June 20, 2008
Sascha said:

Thats perfect man!
Please more of this awesome features :)
Best Regards from germany


July 3, 2008
Tim said:

Great tool! But sadly it doesnt work anymore in FF 3. Do you have an update?

Regards, Tim


July 7, 2008
spudart said:

Yes, I love this tool. Unfortunately ever since Firefox automatically updated itself from 2.0.0.14 to 2.0.0.15, it doesn't work anymore in 2.0.0.15. An update would make my day.


July 7, 2008
Sal Uryasev said:

Silly Firefox. Thanks for pointing it out!

The script should work if you reinstall it now.

Your name

Email (optional, will not be shared)

Type the word "juice" (required to confuse the spammers)

Your comment


Add a comment





Enhancing Google Analytics Using Greasemonkey

There is a new post with updates to the script. Find it here.

My boss Zach has a problem. Every four hours the craving strikes him. No matter where he is, he pulls out his shiny Macbook Pro and navigates to Juice's Google Analytics site. He pulls up the list of referrers to our site and meticulously searches for new domains. He has an freakish ability to pick out IP addresses that have never linked to us before. Even so, there had to be a better way.

I wondered whether Greasemonkey might be able to help. Greasemonkey is an extension for Firefox that allows users to install custom javascript when you visit a specific website. These scripts can add a delete button for Gmail, automatically display lyrics to your YouTube music video, or do pretty much anything else you would want to enhance the functionality of a website.

After poking around the subtleties of the Google Analytics interface, I came up with a little script that can identify the new referrals that Zach so desperately craves. When navigating to the "Referring Sites" section of Google Analytics, the script add the following button to the interface.

Google Analytics Button

Pushing the button downloads all the referrer data for the date displayed in the Google Analytics range, as well as a similar set of data for the range up to, but not including, the last three days. The difference between the two data sources is used to calculate all of the results. The specific number of days can be changed by editing the first line of the script. Greasemonkey then displays the results in two tables above the original Referrer table. (Greasemonkey works entirely within your browser shell, so your data should be quite secure.)

Google Analytics Data

The first table shows any sites that have displayed more than a 50% increase in visits over the last 3 days as compared to the rest of the time range. The second shows all new recent sites that do not appear at all more than 3 days ago. This can be quite useful to anyone, who, like Zach, absolutely needs to know about any new and exciting inbound links.

Installation Instructions:
Firefox 2.0+
Greasemonkey
googleanalyticsdownloade.user.js

If you don't already have Firefox, install it. Install Greasemonkey, and do the required Firefox restart. You should see a handsome monkey peeking at you from the bottom right hand corner of your browser. Open the script file in your firefox browser, and Greasemonkey should give you an option to install the script.

Afterwards, log into Google Analytics, and navigate to your Referring Sources Tab. Click the button.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. All source code is released under a BSD License unless otherwise specified.

19 comments | Show all comments only the last 5 are shown


April 23, 2008
Sal Uryasev said:

Matthew/Dave: The new post (linked at the top of the page) should have the details you need.
Tim: It sounds as if you did everything correctly. Is the script visible if you go to Tools=>Greasemonkey=>Manage User Scripts?
Neerav: There really is no great way to subscribe to just this script. I will link in the relevant places if anything changes though.


April 23, 2008
Neerav said:

Hi Sal

Enabling the "subscribe to comments" plugin could help. That way you can post a comment saying there's a new version and everyone who commented gets that comment as an email


May 1, 2008
Tim said:

Hi Sal,
thank you so much - I just reinstalled it and now it works! This is really fantastic!
Thanks,
Tim


May 7, 2008
Nate Sidmore said:

Awesome tool Sal, (thanks to Avinash for the tip).

I did run into a problem with the Firefox pop-up message "Warning: Unresponsive script". However that problem can be solved by lengthening the time allowed for scripts to run. For more details go to http://lifehacker.com/software/firefox/put-off-firefox-15s-unresponsive-script-dialogue-162574.php

However I was bummed when after setting the time allowance to 10 minutes, and clicking the "Who Sent Me Unusual Traffic" button in GA, the script ran for 9 min 38 sec before returning results. Any tips on getting quicker returns?


May 7, 2008
Chris Gemignani said:

Nate:

Thanks for the encouragement. If you check our "Keyword Trends" Greasemonkey script (linked at the start of this post), we write about how to change the parameters in the script to make things run faster.

Your name

Email (optional, will not be shared)

Type the word "juice" (required to confuse the spammers)

Your comment


Add a comment





S. Few Renounces Dual-Axis Graphs; Juice Ups Ante

After deep introspection, Stephen Few has determined that graphs with dual-scaled axes are fundamentally flawed. Rather than risk the potential for confusion, he believes that there are superior graphing approaches for situations where related data series have different units or magnitudes. His measured and thorough analysis concludes:

“It is inappropriate to use more than one quantitative scale on a single axis, because, to some degree, this encourages people to compare magnitudes of values between them, but this is meaningless.”

I commend Stephen for the courage to start down this path, but he hasn’t gone far enough. Here at Juice, we must often take controversial positions. You may remember that we were among the first to criticize Microsoft’s “databars”, the first to take on the powerful Dashboard Gauge lobby, and the first to challenge the applicability of Tom Davenport’s “Competing on Analytics” sales machine.

While it is true that the second axis can be deceptive, let’s not let the first axis off without asking some tough questions. It is the confusion—nay, the collusion—of the two that causes trouble—who is to say which is the bad seed? We must ask ourselves, do not axes belong in the “Axis of Evil”?

The problem is broader than Stephen suggests: axes are just the tip of the iceberg when it comes to graphic bling that potentially distract or confuse readers:

Take data labels, for example. They encourage users to consider specific values rather than focusing on relative sizes or placement of graph lines or bars.

Legends draw the reader’s eye away from the central storyline of a graphic.

Gridlines… please don’t waste my time with these flat faux-series. One wouldn’t put pinstripping on a Ferrari.

Place your graph in proper context and titles become redundant.

Minimalism is in. Extraneous graph decoration is out. Look no further than Tufte’s sparkline: no excessive graph decoration there.

sparkline

The world cries out for a new charting aesthetic. One that champions elegance and casts down gaudiness. Let us evoke the pure visual essence of the data. Let us find a pure form to evoke the emotion and hidden meaning of the data. Now is the time for Naked graphs—stripped to the essentials (TM).

Our argument is simple: the visualization of information is the message. The data is but an intermediary form of that visualization. Therefore, any residue from the raw data should be scrubbed from your final graph. Only when you achieve this unadulterated state will the meaning of the graphic burn its way into your consciousness.

Here’s an example of an analysis that casts light on both the relationship of the Fed to hedge funds while simultaneously answering your question about what happened with last month’s sales in the Newark division.

naked analysis

Truly here we see the words of Mark 9:43 made real:

If your hand causes you to stumble, cut it off; it is better for you to enter life crippled, than, having your two hands, to go into hell, into the unquenchable fire.

Gaze in awe, viewers, and find wisdom on this very foolish day.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. All source code is released under a BSD License unless otherwise specified.

8 comments | Show all comments only the last 5 are shown


April 12, 2008
Jeff said:

A S. Few article reference, the ever gratuitous Tufte mention AND a verse from the bible - all in one article, talk about data density...


April 12, 2008
dave said:

I generally agree with your philosophy of minimizing "chart junk" but I think you may be going to the extreme here.

Most consumers of chart information are not analytics professionals and need help to interpret.

- Data labels: my users demand them. They want to know the value. I don’t think they have a negative impact on “… than focusing on relative sizes or placement of graph lines or bars”

- Legends: are you kidding? Really?

- Gridlines: absolutely necessary for bar charts. I won’t speak for you, but gridlines help my brain orient the chart information.

- Titles: Chart titles and axis labels are necessary and not at all distracting.

Is there not a comfy middle ground here?

| ^
| ^
| ^
| ^
| ^
| ^
| ^^
| ^ ^
| ^
_____________________________________

Dave


April 12, 2008
derek said:

Dave, check the date that article was posted :-)


April 13, 2008
dave said:

I'm a moron...

thanks derek!


April 18, 2008
tao said:

The root of the problem with visualization is that you are using an organ that is simply not meant to understand so much. The only solution to fully understanding data is to not visualize at all but use a direct neural implant into the brain that allows you to quickly grasp all aspects of the data. All this visualization and introspection about visualization is just trying to improve the horse buggy when the automobiles are coming.

Your name

Email (optional, will not be shared)

Type the word "juice" (required to confuse the spammers)

Your comment


Add a comment