StartDate timezone in campaign performance report

48 views
Skip to first unread message

Ondra

unread,
Feb 14, 2020, 6:47:01 AM2/14/20
to Google Ads Scripts Forum
Hi,

can anyone help me, what is timezone of StartDate in Campaign Performance Report?

The problem is when I download Campaign Performance Report via AdsApp.report() the StartDate is sometimes one day before actual start day that i can see in UI. So I guess there must be some problem with timezones (mine is CET UTC+1).

Does anyone have the same issue? Any suggestions, how i can get StartDate from reports in my timezone?

Thank you,
Ondra.

Google Ads Scripts Forum Advisor

unread,
Feb 14, 2020, 2:49:17 PM2/14/20
to adwords-scripts+apn2wqdhukid6mbk...@googlegroups.com, adwords-scripts+apn2wqdhukid6mbk...@googlegroups.co, adwords...@googlegroups.com
Hi Ondra,

The timezone should be aligned with your account's timezone setting. Regarding your statement:

"the StartDate is sometimes one day before actual start day"
 
Can you confirm that the behavior is inconsistent, and that sometimes the date aligns with the account timezone, and sometimes does not?

If you could provide your CID, and possibly an example of two campaigns showing this inconsistent behavior, that would be helpful.

Thanks,
Matt 
Google Ads Scripts Team


ref:_00D1U1174p._5001UV0nuN:ref

Yoann Berthome

unread,
Feb 24, 2020, 11:23:51 PM2/24/20
to Google Ads Scripts Forum
The start date of a campaign is always the timezone of the account you run it from

I have those 2 pieces of script that help me to set the reporting start date

the "datestring" variable is as following "yyyy-mm-dd" e.g. today is 2020-02-25 (Timzone BKK)

so to use it 
var startDate = formatTime(toDate("2020-02-25"),"yyyymmdd"); //this will return the correct format at the correct timezone;


function toDate(dateString) {
var date = new Date(dateString.substr(0, 4),parseInt(dateString.substr(6, 2))-1,dateString.substr(8, 2))
return date
}

function formatTime(value,format) {
var timeZone = AdsApp.currentAccount().getTimeZone();
return Utilities.formatDate(value, timeZone, format);
}

Google Ads Scripts Forum Advisor

unread,
Feb 25, 2020, 1:34:49 PM2/25/20
to adwords-scripts+apn2wqczxyxhcjoq...@googlegroups.com, adwords...@googlegroups.com
Hello,

All dates and times in scripts are treated as if they're in time zone "America/Los_Angeles", which is why you're seeing this discrepancy. We have no plans to fix this for current reports; however, we are working on some improvements that should offer a workaround to this feature in the future.

Regards,
Mike, Google Ads Scripts Team

ref:_00D1U1174p._5001UV0nuN:ref

Yoann Berthome

unread,
Feb 25, 2020, 9:34:29 PM2/25/20
to Google Ads Scripts Forum
Yes..

the workaround would be to use my script. so you set the "Today" date or convert the "Start Date" to your timezone using the Utilities Class and get Timezone of the account.
Reply all
Reply to author
Forward
0 new messages