getStatsFor date range is not working

47 views
Skip to first unread message

Alpha

unread,
Apr 9, 2015, 12:05:44 PM4/9/15
to adwords...@googlegroups.com
I have this line of code:
var stats = campaign.getStatsFor("20130101,20141231");

Yet it's returning this error: Date range 20130101,20141231 is invalid.

Can anyone help me with this?

Alexander Wang

unread,
Apr 9, 2015, 8:35:19 PM4/9/15
to adwords...@googlegroups.com
Hi there,

You need some extra quotation marks. I think you're trying to use this method:

But, you're specifying the date range as a single string, so it's using this method instead:
As you can see, the supported values for that method are things like "TODAY", "YESTERDAY", "LAST_7_DAYS", etc.

Try this instead:
var stats = campaign.getStatsFor("20130101", "20141231");

I think we could probably do a better job of explaining the issue, so I'll look into improving the error message.

Cheers,
Alex

Alpha

unread,
Apr 16, 2015, 3:01:25 PM4/16/15
to adwords...@googlegroups.com
Ahhh, perfect. Thank you!
Reply all
Reply to author
Forward
0 new messages