Skip to content

Instantly share code, notes, and snippets.

Created April 22, 2010 20:18
Show Gist options
  • Save anonymous/375760 to your computer and use it in GitHub Desktop.
Save anonymous/375760 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="https://www.google.com/analytics/reporting/dashboard?dashboard=1&id="+window.location.href.match(/[^(id=)]*id=([^&]*)/i)[1]+"&pdr="+y+parsed_month()+parsed_day()+"-"+y+parsed_month()+parsed_day();}
)()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment