---
title: "Don't Trust Client Data"
description: "When your analytics code runs on tens of millions of phones, strange things can happen."
canonical: "https://amplitude.com/en-us/blog/dont-trust-client-data"
---

# Don't Trust Client Data

When your analytics code runs on tens of millions of phones, strange things can happen.

Source: https://amplitude.com/en-us/blog/dont-trust-client-data

---

[Spenser Skates](/blog/author/spenser-skates)

[CEO and Co-founder, Amplitude](/blog/author/spenser-skates)

[](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Famplitude.com%2Fblog%2F%2Fblog%2Fdont-trust-client-data)[](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Famplitude.com%2Fblog%2F%2Fblog%2Fdont-trust-client-data)[](https://twitter.com/intent/tweet?url=https%3A%2F%2Famplitude.com%2Fblog%2F%2Fblog%2Fdont-trust-client-data\&text=Don%E2%80%99t%20trust%20client%20data)[](mailto:?subject=Checkout%20this%20Amplitude%20Article\&body=Check%20this%20out%3A%20https%3A%2F%2Famplitude.com%2Fblog%2F%2Fblog%2Fdont-trust-client-data)

*Analytics and the inaccuracy of phone-reported timestamps*

When your analytics code runs on tens of millions of phones, strange things can happen.

One of the biggest issues is with [timestamps](https://amplitude.com/docs#timestamps). Phones are often offline, so an analytics SDK needs to cache data locally before uploading. Once a phone receives internet connectivity it can then upload event data to the server. This upload can happen anytime from immediately after an event has been logged to days later. As you can imagine, a number of potential problems can arise throughout the event logging and uploading process.

### What happens if the phone’s clock is incorrect?

For example, here’s the number of events per day of a [mobile app that first included analytics instrumentation](https://amplitude.com/mobile-analytics) on April 25th: There are a non-zero number of events being logged in the days leading up to April 24th. In other words, according to this graph, data has been logged by the phone *before* instrumentation was put in place. Going back further in time for the same app, here’s a graph logging events from January 1970 up to 1 month before instrumentation: From the examples above, it’s clear that some people’s clocks are significantly off, in some cases by years. It’s not possible that clients were logging data before they instrumented Amplitude! So how do we get around this problem? We could timestamp all events to the time when our servers receive the event (the server upload time), but this would be inaccurate as well — around 5% of data is uploaded at least 24 hours after the event actually happened.

### What if we tracked the phone’s timestamp when it uploaded the data?

For each event, let’s compare the difference between the phone *event* timestamp and the server upload time versus the difference between the phone *upload* timestamp and the server upload time: Difficult to read! Let’s put both axes on a log scale: There are virtually no data points above the y=x line. This makes sense, since the time the event is logged on the phone shouldn’t be later than the time the event is uploaded to our servers. This suggests a very straightforward solution to our timestamp problem: for each event timestamp, subtract the difference between the phone’s upload time and the server’s upload time, and then adjust the phone’s event timestamp accordingly. This should account for how much the phone’s clock was off when the event was first saved. So there you have it — [our simple solution](https://amplitude.com/docs#timestamps) for keeping track of when your events happened. Hope this helps you get more accurate timestamp data from all those phones!

---

**A few caveats (for those interested):** Of course, this doesn’t account for latency between when the upload was sent and when it reached our server. However, in practice this latency period ends up being much smaller than the amount that a phone’s clock is off-target. Additionally, this solution assumes the phone’s clock is off by a constant amount. It’s possible for the phone’s clock to change between when an event was logged and when it was uploaded. If this happens, the correction could actually make the timestamp less accurate. Unfortunately, there’s no easy way to tell if a phone’s clock has changed. We’ve found that setting a cutoff window where an event is discarded if its adjusted time is greater than 60 days is a reasonable compromise. We’ve also found that using the current server time for all timestamps from the “future” is a reasonable guess.

About the author

Spenser Skates

CEO and Co-founder, Amplitude

[More from Spenser](/blog/author/spenser-skates)

Spenser is the CEO and Co-founder of Amplitude. He experienced the need for a better product analytics solution firsthand while developing Sonalight, a text-to-voice app. Out of that need, Spenser created Amplitude so that everyone can learn from user behavior to build better products.

[More from Spenser](/blog/author/spenser-skates)

Topics

#### Recommended Reading

[Read ](/blog/lessons-from-consolidating-our-mcp-server)

[Insights](/blog/lessons-from-consolidating-our-mcp-server)

###### [Lessons from consolidating our MCP server](/blog/lessons-from-consolidating-our-mcp-server)

[Oct 6, 2026](/blog/lessons-from-consolidating-our-mcp-server)

[10 min read](/blog/lessons-from-consolidating-our-mcp-server)

[Read ](/blog/what-ai-engineers-do)

[Insights](/blog/what-ai-engineers-do)

###### [What AI engineers do in the age of agentic code](/blog/what-ai-engineers-do)

[Oct 1, 2026](/blog/what-ai-engineers-do)

[14 min read](/blog/what-ai-engineers-do)

[Read ](/blog/jev-analysis)

[Insights](/blog/jev-analysis)

###### [An analysis of Jev: Faster and cheaper, but watch the accuracy](/blog/jev-analysis)

[Sep 28, 2026](/blog/jev-analysis)

[13 min read](/blog/jev-analysis)

[Read ](/blog/ai-context-configuration)

[Product](/blog/ai-context-configuration)

###### [Your agent isn’t broken. It’s guessing.](/blog/ai-context-configuration)

[Sep 23, 2026](/blog/ai-context-configuration)

[6 min read](/blog/ai-context-configuration)

#### Explore Related Content

[101](/compare/top-feature-flag-solutions-for-product-teams)

###### [9 Top Feature Flag Solutions for Modern Product Teams in 2026](/compare/top-feature-flag-solutions-for-product-teams)

[Jan 27, 2026](/compare/top-feature-flag-solutions-for-product-teams)

[Integration](/blog/amplitude-hubspot-behavioral-analytics)

###### [Using behavioral analytics for growth with the Amplitude app on HubSpot](/blog/amplitude-hubspot-behavioral-analytics)

[Jun 17, 2024](/blog/amplitude-hubspot-behavioral-analytics)

[10 min read](/blog/amplitude-hubspot-behavioral-analytics)

[Personalization](/blog/identity-resolution-insights)

###### [Identity resolution: The secret to a 360-degree customer view](/blog/identity-resolution-insights)

[Feb 16, 2024](/blog/identity-resolution-insights)

[10 min read](/blog/identity-resolution-insights)

[Product](/blog/warehouse-native-technical-deep-dive)

###### [Inside warehouse-native Amplitude: A technical deep dive](/blog/warehouse-native-technical-deep-dive)

[Jun 27, 2023](/blog/warehouse-native-technical-deep-dive)

[15 min read](/blog/warehouse-native-technical-deep-dive)

[Guide](/resources/boost-customer-engagement)

###### [5 Proven Strategies to Boost Customer Engagement](/resources/boost-customer-engagement)

[Jul 12, 2023](/resources/boost-customer-engagement)

[Video](/designing-high-impact-experiments)

###### [Designing High-Impact Experiments](/designing-high-impact-experiments)

[May 13, 2024](/designing-high-impact-experiments)

[Startup](/blog/direct-to-consumer-marketing-tactics)

###### [9 direct-to-consumer marketing tactics to accelerate ecommerce growth](/blog/direct-to-consumer-marketing-tactics)

[Feb 20, 2024](/blog/direct-to-consumer-marketing-tactics)

[10 min read](/blog/direct-to-consumer-marketing-tactics)

[Growth](/blog/analytics-product-market-fit)

###### [Leveraging analytics to achieve product-market fit](/blog/analytics-product-market-fit)

[Jul 20, 2023](/blog/analytics-product-market-fit)

[10 min read](/blog/analytics-product-market-fit)
