I have been helping out with some sales reporting lately which has meant I have been using the order and transaction CSV downloads Google Checkout offers.
I found one feature of Google Checkout strangely lacking on the usability front. The payout and transaction download only allows you to specify a single day rather than a date range, so if you wanted a month of data you would have to run the report 30 times and aggregate the data in your own spreadsheet: no thanks Google!
Selecting start and end dates for a report, especially a financial one, is essential, so it was both frustrating and strange that this was not possible. Digging into the page code a little, I noticed something quite odd. Whoever developed this functionality at Google obviously agreed with me on the importance of a report taking start and end date as parameters, and even exposed the end date as a hidden variable called endDay in the form.
The form sets the end date via javascript right before submission – odd because that would be easier and safer to be done server side. I’m going to assume some kind hearted engineer did this for people like me who needed to save time – thanks!
Tinkering with the page dynamically using firebug (the best firefox plugin ever) I was able to modify the form to:
- No longer set the end date on submit
- Take a given value for end date.
I have taken the liberty of reproducing that form on this page to fix the dud usability. That means that you can use firebug to edit the page and paste the form I have provided into it. Then fill in the numbers you want and submit the form.
The code is as follows:
<form action="https://checkout.google.com/sell/btReconReport" method="post"> <input id="startDate" name="startDay" type="text" value="2008-12-23" /> <input id="endDate" name="endDay" type="text" value="2008-12-30" /> <input name="daily" type="submit" value="Download" /> </form> |
Paste it in so it looks like this:
With the new form right above the old one (or anywhere) like so:
I hope it saves others some time too, if you’re Google, please just provide this functionality, it’ll take your engineer about 2 minutes to unhide that variable!
NB: 10 points if you can tell me why it errors when I try to submit the form from my own html page (instead of editing theirs in firebug). Does Google do some sort of fancy server side referer check on form submission? Or am I missing something obvious with same-domain browser security…
I just did something similar… I tried pasting your code, but wasn’t successful. They appear to have updated since with From and To select boxes. However, I could only select back 90 days. It was as opening firebug and changing the value=”” on the that was selected, though, and I got all of 2008 in one file. I’ll have to pay those taxes now 🙂
Uncanny timing! I just about 15 minutes ago sent this email to a reader who asked about my technique:
Still works – they have changed their code a little though.
There are two hidden fields that the form actually uses. The values
from UI elements are copied over ‘onclick’ of the submit button. You
can use firebug to remove the javascript onclick, and the onchange of
the startdate UI field. Then just put value=”d:2008-01-01″ (or the
date you want) attributes into the hidden fields and you’ll be set!
I’ll do a quick blog update for this later on tonight.
Thanks for the tip! I downloaded firebug, played around for a bit following your post, and finally got the >60 day report that I needed.
Still works for tax year 2010. Thanks for the tip!
Open up FireBug. Change startDay value=”d:2009-01-01″. Change endDay value=”d:2009-12-31″. Remove onclick=”assignDates()”. Click on Download.
Thanks for the update – isn’t it mental that still after all this time Google haven’t just made selecting start and end dates default functionality? Oh Google engineers, please just make this very minor client side change for us?
thank you very, very much – it worked – wasn’t easy – i swear google just doesn’t care about customer service.