How can events with equal timestamps be ordered in GA4 BigQuery?

The Citead team, updated

In short. Order tied GA4 events with the documented user and batch fields.

Definition: In a GA4 BigQuery export, event_timestamp records when Google Analytics received an event, and several events can share that value. For page and event order, Google documents a tuple that uses the user identifiers and the batch fields batch_page_id, batch_ordering_id, and batch_event_index.

Key facts

  • Google's BigQuery Export schema defines event_timestamp in microseconds and says that several events can share a timestamp when they are sent in one request.
  • The schema defines batch_event_index as the sequential position of an event within a batch, based on its occurrence on the device.
  • Google Developers' pageview sequence query orders by user_pseudo_id, user_id, batch_page_id, batch_ordering_id, and batch_event_index.
  • batch_ordering_id increases for each network request from a page, while batch_page_id increases for each subsequent page in an engagement.
  • The schema also exposes event_previous_timestamp, event_bundle_sequence_id, and event_server_timestamp_offset for event timing and upload context.

Why is event_timestamp alone insufficient?

event_timestamp is the time in microseconds, UTC, when Google Analytics received an event. The schema explicitly allows several events to share a timestamp when they are sent in the same request. Sorting by that field alone therefore leaves the order inside a tied request unresolved.

event_previous_timestamp records when the previous event happened. It provides timing context for the event row, while the batch fields provide the documented keys for reconstructing the order of events sent together. Google defines event_bundle_sequence_id as the sequential ID of the bundle in which events were uploaded and event_server_timestamp_offset as the timestamp offset between collection and upload.

Which fields reconstruct page and event order?

Google defines batch_page_id as a sequential number assigned to a page that increases for each subsequent page within an engagement. batch_ordering_id is a monotonically increasing number that is incremented each time a network request is sent from a given page. batch_event_index supplies the sequential order of each event within a batch according to its occurrence on the device.

The Google Developers query begins with user_pseudo_id and user_id, then applies those three batch fields. The user identifiers establish the sequence being examined; the batch fields then move from page, to request, to event within that request. For a tied event_timestamp, this is the documented order key to use.

What query should a BigQuery reconstruction use?

The documented pageview example uses this ordering clause. Its selected fields also read page_location from event_params, so the same result can carry the page URL alongside the reconstructed sequence.

SELECT
  user_pseudo_id,
  user_id,
  batch_page_id,
  batch_ordering_id,
  batch_event_index,
  event_name,
  GetParamString(event_params, 'page_location') AS page_location
FROM `your_project.analytics_property_id.events_*`
ORDER BY
  user_pseudo_id,
  user_id,
  batch_page_id,
  batch_ordering_id,
  batch_event_index;

Google's example filters to page_view while demonstrating pageview order, then states that the same ORDER BY clause can order all events when the event-name filter is removed. The page also warns that its sample dataset lacks the three batch fields, so the FROM table must be replaced with a table whose schema contains them.

For rows that share every value in this tuple, the two Google pages leave the next tie breaker unspecified. Preserve the timestamp and the batch fields in the exported result so that such rows remain identifiable for review.

FAQ

Should I sort only by event_timestamp?

No. Use user_pseudo_id, user_id, batch_page_id, batch_ordering_id, and batch_event_index, which Google uses in its pageview sequence query.

What does batch_event_index tell me?

It identifies an event's sequential position within a batch, based on the order in which the events occurred on the device.

Can the sample query run against the public sample dataset?

The Google Developers page says that the sample dataset schema lacks batch_page_id, batch_ordering_id, and batch_event_index. Replace the table with a table that contains those fields.

Sources

  1. Google Analytics Help, "BigQuery Export schema", undated
  2. Google for Developers, "Basic queries for Google Analytics event data export", 15 June 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark