Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Analytics
English French
English French

Why do I have data discrepancies between Piano and Google Analytics?

Piano Analytics and Google Analytics 4 count visits, attribute sources, and filter reports differently, so the two tools will never return identical figures. Most of the gap can be explained, and this article covers the causes in the order they usually matter.

Note: This article covers Google Analytics 4. Universal Analytics stopped processing data on July 1, 2023 for standard properties, and Google removed access to Universal Analytics data from July 1, 2024. Several differences that applied to Universal Analytics no longer exist in GA4.

Visit and session duration

Both tools close a visit or a session after 30 minutes of inactivity by default, and both lose the thread when the visitor's identifier is deleted. Two differences remain.

Midnight. Piano always ends a visit at midnight, so browsing that runs from late evening into the next day is split into two visits. Google defines the end of a GA4 session by inactivity alone and documents no equivalent day boundary. Expect Piano to report more visits than GA4 reports sessions on traffic that spans midnight.

Timeout length. In GA4 the session timeout is configurable up to 7 hours and 55 minutes. If your property no longer uses the 30-minute default, GA4 groups into one session what Piano splits into several visits.

Visitor recognition

Piano stores the visitor identifier for 13 months by default. In GA4, the _ga cookie defaults to 2 years and can be set anywhere from immediately to 25 months.

A visitor returning after 15 months is a new visitor in Piano and a returning user in GA4, which shifts any new-versus-returning comparison.

Data retention

Retention is a separate limit from visitor recognition: it decides how far back you can query at all. A long-range comparison can fail simply because one tool no longer holds the period.

Piano Analytics applies a 25-month rolling retention period by default, for all properties and metrics.

Google Analytics 4 splits its data retention setting in two:

  • User-level data and key events: 2 or 14 months.

  • All other event data: 2 or 14 months, extended to 26, 38, or 50 months on 360 properties.

A property left on the shorter setting stops returning user-scoped data long before Piano's 25-month window closes. Before investigating a discrepancy on an older period, confirm that both tools still hold it.

Session counting

Piano returns the collected data. Check that eco mode is disabled when you compare, since it limits what a report returns.

GA4 does not count sessions, it estimates them. Google calculates the number of sessions "by estimating the number of unique session IDs", using the HyperLogLog++ algorithm, as explained here. Expect a small difference on this metric even when everything else matches.

Source attribution

One source per visit or session, in both tools. Piano defines the source once, at the start of the visit. Google states that "a new session is not started when Google Analytics encounters a new campaign or traffic source", and, comparing the two generations of its own product, that "In Universal Analytics, a new campaign will start a new session regardless of activity. In Google Analytics 4, a new campaign does not begin a new session" (campaigns and traffic sources, UA to GA4 comparison).

A campaign arriving mid-visit. In Piano, a visitor who returns from a marketing source during an open visit generates a click.campaign.offsite event. The visit is not split and the marketing source is not credited. In GA4 the campaign is likewise not applied to the running session, and is kept for event-based attribution instead.

Scope is what makes GA4 figures differ from each other. A single GA4 property exposes the same campaign at three scopes, and picking the wrong one is a common cause of confusion when comparing with Piano:

  • User scope (firstUserSource, firstUserMedium): the source that first acquired the visitor, which can be months old.

  • Session scope (sessionSource, sessionMedium): the source of that session. This is the scope to compare against Piano's visit source.

  • Event scope (source, medium): the source carried by an individual event, including a campaign encountered mid-session.

GA4 also applies a campaign key event lookback window, configurable at property level.

GA4 reporting limits

Three GA4 mechanisms reduce or hide data before you see it. Piano has no equivalent to any of them, so each one shows up as a shortfall on the Google side.

Consent, exemption, and modeled users

Piano Analytics can be configured with the ePrivacy exemption, so events are collected even when the visitor refuses the CMP, although marketing sources are not supposed to be collected in exempt mode. If your exempt tagging does collect marketing sources, that alone can explain a higher marketing volume in Piano.

GA4 handles refused consent differently. With consent mode, and where the property qualifies, Google applies behavioral modeling: it estimates the behavior of users who declined analytics cookies from the behavior of users who accepted. Google's stated prerequisites include consent mode on all pages, at least 1,000 daily events with analytics_storage='denied' over 7 days, and at least 1,000 daily users with analytics_storage='granted' on 7 of the previous 28 days.

The consequence matters more than the mechanism: a GA4 figure can include modeled users who were never collected, while a Piano exempt figure contains collected events only. The two are not the same kind of number, and closing the gap between them is not a realistic goal.

Check your tagging

Differences in implementation usually outweigh everything above.

  • Are the events triggered at the same moment in both tools?

  • Are all pages tagged with both tools? Pages tagged with only one make any comparison unreliable.

  • Are the two tools subject to the CMP in the same way?

UTM parameters

Piano SDKs interpret Google's UTMs, as described in the developer documentation, but the processing chain needs utm_medium and utm_campaign at minimum to credit the marketing source of a visit. A link carrying only utm_source will not value the source in Piano. Please see Can we retrieve information from our UTM Campaigns for the full implementation.

gclid and other Google parameters

A gclid is a string Google generates for itself, so Piano cannot decode it. Google populates its own traffic-source dimensions from it through Google Ads auto-tagging, and gives auto-tagged values priority

Summary

Behavior

Piano Analytics

Google Analytics 4

Visit or session ends at midnight

Yes

Google defines session end by inactivity

Default inactivity timeout

30 minutes

30 minutes, configurable up to 7h55

Visitor identifier lifetime

13 months by default

_ga cookie 2 years by default, up to 25 months

Data retention

25-month rolling by default

2 or 14 months user-level, up to 50 months event data on 360

Session count

Collected data

Estimated (HyperLogLog++)

Source per visit or session

One, set at the start

One, set at the start

Campaign arriving mid-visit

Recorded as click.campaign.offsite, source not credited

Does not begin a new session, kept at event scope

Sampling

No, but check eco mode

Above 10 million events (up to 1 billion on 360)

Rows withheld for privacy

No

Demographics and search query data

High-cardinality rows grouped

No

Collapsed into "(other)"

Users who refused consent

Collected under ePrivacy exemption

Estimated by behavioral modeling, where eligible

gclid

Not decoded, matching table required

Resolved through Google Ads auto-tagging







Last updated: