Change default date range in Google Analytics
I don’t know the reason why Google chose to set the default date range to the last 30 days excluding the current date (maybe I’m the only one interested in today’s stats), but it’s definitely annoying not having the option to change that default.
There used to be a bookmarklet to overcome the issue, but I’ve not been able to find an update for that after Google’s changed how URLs are managed in Analytics.
So, here’s the update :)
The “easiest” way I found to make a bookmarklet works like this:
- Log in to your Google Analytics account
- Look at the URL, it should be something like
- Copy the last portion of the URL, in the example it’s
- Open a text editor, copy & paste this code on a new file you can call
a12345678w12345678p12345678in the file with the code you copied at step 3
- Save the file and open it with your browser (tested with Chrome, Firefox and Safari on Mac OSX)
- Drag the link to your bookmarks bar
Don’t delete/move/rename the HTML file if you’re using Chrome or Firefox, for some reason they need it even after you’ve added the bookmarklet.
b is used, you’d need to create a new
Date and set it at the end of the URL). Also, it takes you to the visitors overview page, you can change that by looking at the other pages’ URLs.
Steps 2, 3 and 5 are not technically needed, in that if you leave the bogus URL I put in the code, Analytics is going to tell you that something’s wrong with your credentials, but will set the date anyway (and update that part of the URL). I guess that’s your session ID, so I’m not sure if it’s better to use an existing one or just leave the dummy and let Analytics generate a new one every time. It’s probably hackish to use an old session ID, but it gets rid of the warning dialog and it works!
Ok, this was to create a bookmarklet, but what I actually did was create a Chrome Extension that does the same thing, but has an icon and most of all is listed on the new tab page. If anybody is interested in that, let me know in the comments and I’ll add a new post to explain how it’s done :).
[Edit - June 27]: so here’s the promised extension