How to set TimeZone in Google DFP api on ReportQuery in RUBY

1,331 views
Skip to first unread message

dsn raghavendra

unread,
Jun 29, 2015, 7:32:44 AM6/29/15
to google-doubleclick...@googlegroups.com

Hi

I am working with Google DFP-api in ruby. how to set TimeZone when we are pulling daily reports from dfp_api on ReportQuery

Regards,
Raghu

Tesfamichael Hailegeorgis

unread,
Jun 29, 2015, 10:15:29 AM6/29/15
to google-doubleclick...@googlegroups.com
Hi Raghu,

You can set TimeZone using reportQuery object in reportService.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team

Jon Crowell

unread,
Mar 5, 2016, 11:57:43 PM3/5/16
to Google's DoubleClick for Publishers API Forum
I am using v201602 -- it appears that timezone support has been removed (it was already deprecated in the version you linked to).  However, I need to know the timezone.  What can I do?

Thanks,

Jon

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Mar 7, 2016, 10:03:36 AM3/7/16
to Google's DoubleClick for Publishers API Forum
Hi Jon,

The timeZone field is phased out/removed starting from v201602. What is your use case that requires the time zone in your reporting? You can use the Time_Zone table from the PQL service for the list of supported time zones.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team

xa...@triadretail.com

unread,
Apr 7, 2016, 4:11:35 AM4/7/16
to Google's DoubleClick for Publishers API Forum
Hello,

I have a similar issue.

Our DFP account is in local time zone and our AdX account seem to be only available in Los Angeles time zone. I need to match reports and changing our DFP account to Los Angeles time is not an option. So the only solution would be to export reports from DFP via the API in Los Angeles time zone. Could you please provide a dummy report Job that export a report in LA time zone for an account set on something else (like GMT)? E.g how would I modify the below statement?

report_job = {
'reportQuery': {
'dimensions': ['ORDER_ID', 'ORDER_NAME'],
'dimensionAttributes': ['ORDER_TRAFFICKER', 'ORDER_START_DATE_TIME',
'ORDER_END_DATE_TIME'],
'statement': filter_statement,
'columns': ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS',
'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE',
'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'],
'dateRangeType': 'CUSTOM_DATE',
'startDate': {'year': start_date.year,
'month': start_date.month,
'day': start_date.day},
'endDate': {'year': end_date.year,
'month': end_date.month,
'day': end_date.day}
}
}

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Apr 7, 2016, 11:57:11 AM4/7/16
to Google's DoubleClick for Publishers API Forum
Hi,

As mentioned on this thread, starting from v201602 the timeZone field has been deprecated/removed. So, you can't set/change the time zone on the reportQuery. The time zone for reporting defaults to your network's time zone setting.

What version of the API are you using? What is the network code where this is happening?

Thanks,
Tesfamichael Hailegeorgis, DFP API Team

xa...@triadretail.com

unread,
Apr 13, 2016, 3:57:22 AM4/13/16
to Google's DoubleClick for Publishers API Forum
Hi,

Thanks for your quick answer and sorry for the delay in mine. 

I am using v201602. I have read the documentation on reportQuery before asking here, but I cannot see any example on how to change the time zone on the reportQuery. Could you please show an example? 
My DFP account is in Australia/Sydney time and I would like my reports in Los Angeles time.

Thanks

xa...@triadretail.com

unread,
Apr 13, 2016, 10:20:34 AM4/13/16
to Google's DoubleClick for Publishers API Forum

So from the doc, it looks like 'startDate' and 'endDate' need to be of the type 'Date'. 



But Date does not have 'timeZone', only year, month and day

source: https://developers.google.com/doubleclick-publishers/docs/reference/v201602/ReportService.Date


On the other hand, the object 'Datetime' seem to support timezone:


So shall I use objects of the DateTime format rather than the 'Date' format for my 'startDate' and 'endDate'? And if yes, how do 'timeZoneID' look like?

Thanks

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Apr 13, 2016, 1:11:07 PM4/13/16
to Google's DoubleClick for Publishers API Forum
Hi,

Thanks for the confirmation.

As you have confirmed, you're using the v201602. So, the time zone is in your network's time (Australia/Sydney). Unfortunately, there is no way of modifying this via the API to Los Angeles or some other time zone. The startDate and endDate fields are in the network's time zone when you're using a dateRangeType of CUSTOM_DATE. The time zone setting is used to control what time zone the reports were run in(YESTERDAY as a different 24 hour span depending on your time zone). The purpose of having the timeZoneID field in the DateTime object for reporting v201602 is that the DateTime objects returned by the report service (like the dimension attribute line_item_start_date_time) still need to have a time zone. So, to recap you can't set/modify the timeZone as it is already removed/deprecated from the reportQuery starting from v201602.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team

xa...@triadretail.com

unread,
Apr 14, 2016, 1:50:19 AM4/14/16
to Google's DoubleClick for Publishers API Forum
Hi,

Thanks for the clarification.

So the feature was available and then deprecated ?
Is it on the road map to bring it back ? Time Zone was and is a very useful feature. 
It's unfortunate that Google makes robust reporting between its own platforms (DFP, AdX) extremely difficult by not offering a holistic approach to time zones.

xa...@triadretail.com

unread,
Apr 14, 2016, 4:22:22 AM4/14/16
to Google's DoubleClick for Publishers API Forum
Alternatively, is there a way to filter the time range down to the hour/minute/second, rather than just the day? This way I could create artificial time zone support. For example, to grab Yesterday's (April 13) number in Los Angeles time zone from my Austalia-set DFP account, I would grab:

startDate: {
year: 2016,
month: 04,
day: 13,
hour: 17,
minute: 0,
seconds: 0},
endDate:{
year: 2016,
month: 04,
day: 14,
hour: 16,
minute: 59,
seconds: 59}

Lakshmi P

unread,
Apr 14, 2016, 2:38:18 PM4/14/16
to Google's DoubleClick for Publishers API Forum
Hi,

This feature was removed from the DFP product. For more information, I would suggest contacting product forum. I believe they would be able to assist you better regarding product related questions.
Please check this link for the available fields that can be set on report Query.

Thanks,
Lakshmi, DFP API Team
Reply all
Reply to author
Forward
0 new messages