I’m using the twitter-ads gem to retrieve campaign data during a given time interval, but if specify the granularity as :day, I keep getting an error saying “Expect time to be midnight in the account’s local timezone for day granularity”.
Here’s an example line where that error happens:
TwitterAds::LineItem.stats(account, ids, metrics, {granularity: :day, start_time: start_date, end_time: end_date})
I’ve tried different flavours of start_date and end_date, including using .in_time_zone("GMT") and setting Time.zone and then using Time.zone.local, but to no avail.
I’ve seen some topics discussing this issue already, but none of them mentioned how to solve it when using the gem.
Is anyone else having the same issue?