woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

[Analytics accuracy] Timezone differences #9887

Open atorresveiga opened 1 year ago

atorresveiga commented 1 year ago

It is very common among merchants to have different timezone settings in their stores vs. their devices. This issue could lead to inaccurate stats when analyzing different periods because the data from the app will display different information than the web if they use different timezones. This task is about fixing this issue and using a single truth source.

pe5pgL-3HL-p2

shiki commented 1 year ago

@atorresveiga Thanks for creating this issue.

shiki commented 1 year ago

@atorresveiga Another message. ๐Ÿ˜

jaclync commented 12 months ago

Just wanted to confirm the expected changes for this task: we're going to use the store time zone instead of the device time zone for the analytics because of data we've observed in Tracks. I plan to work on this tomorrow.

It's also interesting that iOS has a lot more unique events than Android.

atorresveiga commented 12 months ago

we're going to use the store time zone instead of the device time zone for the analytics because of data we've observed in Tracks. I plan to work on this tomorrow.

Yes Jaclyn, we should use the store time zone instead of the device and follow the same behavior as the web.

jaclync commented 11 months ago

Hi @atorresveiga ๐Ÿ‘‹ Sharing what I've tested in iOS: I tested stores in different time zones, one UTC, one in a different city, and one in the same time zone, and the stats are already showing in the store time zone. The start/end date parameters in the stats API requests don't have a time zone, so the data follow the store time zone. The obvious issue I noticed was pe5pgL-49w-p2 which makes more sense to update on the API side.

I also tried looking at the analytics feedback as in pe5pgL-3HL-p2#increase-the-accuracy-of-analytics, but all the feedback was on Android ๐Ÿค” Maybe we didn't launch the survey in iOS for analytics, I couldn't find any relevant survey URLs in iOS.

atorresveiga commented 11 months ago

Hi @atorresveiga ๐Ÿ‘‹ Sharing what I've tested in iOS: I tested stores in different time zones, one UTC, one in a different city, and one in the same time zone, and the stats are already showing in the store time zone.

Here is the test I'm using to reproduce the inconsistency: My store is in the US, and I set the device timezone to Australia. Every day, I create a new order and check the stats. Because in the middle of my day, it is already 1 am in Australia (the next day), when I check stats like Today, Yesterday, This Week (Week to Date), etc, the values differ. The Today selection on my device shows the information for Dec 15, for example, while looking at the same stats on the web displays the data for Dec 14.

Maybe we didn't launch the survey in iOS for analytics

I believe this is the case โ˜๏ธ I created the survey for Android during a Hack Week, but I don't remember if there was an iOS counterpart; I believe not.

jaclync commented 11 months ago

Here is the test I'm using to reproduce the inconsistency: My store is in the US, and I set the device timezone to Australia. Every day, I create a new order and check the stats. Because in the middle of my day, it is already 1 am in Australia (the next day), when I check stats like Today, Yesterday, This Week (Week to Date), etc, the values differ. The Today selection on my device shows the information for Dec 15, for example, while looking at the same stats on the web displays the data for Dec 14.

I see what you meant for this issue now! Opened a discussion in pe5pgL-4bG-p2.

toupper commented 7 months ago

@atorresveiga I see we have merged two PRs for this, do we need to do something else, or can we close it? In case there're still pending tasks, what are these? Thanks in advance for your answers!

atorresveiga commented 7 months ago

In case there are still pending tasks, what are these? In case there are still pending tasks, what are these? Thanks in advance for your answers!

@toupper This refactor was thought to be done progressively until we used the site timezone for every date in the app. Creating issues for every date we use in the app could be overkill, so we decided to take this slow and create issues whenever we identify an inconsistency of a date with another screen (for example, stats and order list). So far, some dates in the order details screen still need to use this site's timezone approach (if I recall correctly, order notes and reviews).

Ecarrion commented 2 months ago

@atorresveiga is this still in the plan or should we close it / remove it from our backlog?

atorresveiga commented 2 months ago

@Ecarrion I believe some areas still need to be improved, like filters, for example. WDYT @toupper?

toupper commented 2 months ago

@Ecarrion I believe some areas still need to be improved, like filters, for example. WDYT @toupper?

Yes, let's leave it in Inbox ๐Ÿ‘

atorresveiga commented 2 months ago

The app documentation also mentioned the expected behavior: https://woocommerce.com/document/how-timezones-work-in-the-woo-mobile-app/

For both Android and iOS, the Woo Mobile app uses the timezone set on your siteโ€™s dashboard (WP-Admin ๐Ÿ‘‰ Settings ๐Ÿ‘‰ General ๐Ÿ‘‰ Timezone) when itโ€™s available, and if itโ€™s not, it will default to the deviceโ€™s timezone.

cc. @toupper