1

When selecting date ranges in Google Analytics, one is always missing for me:

Last 30 days + today

Is there a way to define this custom date range, or should I always define it manually?

3
  • 2
    I got frustrated with Google Analytics defaults so now I access my reporting through here: ostermiller.org/calc/ga.html I've built it in such a way that you can add your own report id and bookmark that to get all sorts of date links. However, I didn't include the +today link you are looking for. Seeing a partial day of data isn't very useful unless you are looking at the hourly reports as far as I'm concerned. Commented Aug 3, 2017 at 9:12
  • @StephenOstermiller Waw, cool! it would be nice to add a "include today" checkbox on that tool. Something else: once the URL is built with your tool, can I bookmark it, or does it included the dates hardcoded in the URL?
    – Basj
    Commented Aug 3, 2017 at 9:17
  • GA only allows hard coded dates in its URLs as far as I know. :-( I bookmark my tool with the report id. Every time you visit, the JS in the page puts the new dates into the links. Commented Aug 3, 2017 at 9:19

3 Answers 3

1

I'm pretty certain you will have to use the custom date range functionality always for that date range. The only other tip I have is that you can select a whole month by clicking on it enter image description here

1
  • Yes but then we have to select the range manually (start date, end date), that's what I would like to avoid.
    – Basj
    Commented Aug 3, 2017 at 9:15
1

Solution:

Create a PHP file on your own server, like example.com/myanalytics/index.php (don't worry, it will just create an URL shortcut to anlaytics, so nobody will be able to see it even if they visit this page):

<?php
$myid = 'aXXXXXXXwXXXXXXXXXpXXXXXXXXX';
$end = date('Ymd');     // this is today :)
$start = date('Ymd', time()-31*24*3600);
header('Location: https://www.google.com/analytics/web/#report/visitors-overview/' . $myid . '/%3F_u.date00%3D' . $start . '%26_u.date01%3D' . $end . '%26overview-graphOptions.selected%3Danalytics.nthDay/');    
?>
1

Not sure what your exact use case is, but I've run into this when I'm bookmarking GA views I use frequently (and want those views to incorporate the newest data).

If you replace the end date query string parameter with a date in the future, the view will incorporate data up through and including today.

_u.date00=20190829&_u.date01=20501230

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.