Skip to content

Instantly share code, notes, and snippets.

@vjsingh
Forked from anonymous/gist:375760
Created March 8, 2012 19:52
Show Gist options
  • Save vjsingh/2002990 to your computer and use it in GitHub Desktop.
Save vjsingh/2002990 to your computer and use it in GitHub Desktop.
void((
function(){
var t = new Date(), y = t.getFullYear(), month = t.getMonth(), month_plus = month + 1;
var parsed_day = function() { return (t.getDate() < 10 ? '0' : '') + t.getDate()};
var parsed_month = function() { return (month_plus < 10 ? '0' : '') + month_plus };
window.location.href="#report/visitors-overview/a28499152w54277021p55201311/?_.date00="+y+parsed_month()+parsed_day()+"&_.date01="+y+parsed_month()+parsed_day();}
)()
)
void function(){var a=new Date,b=a.getFullYear(),c=a.getMonth(),d=c+1;var e=function(){return(a.getDate()<10?"0":"")+a.getDate()};var f=function(){return(d<10?"0":"")+d};window.location.href="#report/visitors-overview/a28499152w54277021p55201311/?_.date00="+b+f()+e()+"&_.date01="+b+f()+e()}()
@vjsingh
Copy link
Author

vjsingh commented Mar 8, 2012

Shows current day in Google Analytics. Copy 'javascript:' and then the minified version into a bookmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment