Blog
·7 min read

Moving a Bubble App to Code: Keep GA4 Events Comparable

A Bubble rebuild can work correctly while making your growth dashboard misleading. A signup event that used to mean “account created” may start firing when someone clicks Submit. A single screen transition may generate two pageviews. A returning customer may acquire a new analytics identity.

The result can look like a product improvement or a drop in demand when only the measurement changed. Treat analytics continuity as part of the migration scope, with explicit definitions and a small set of repeatable journeys. This guide focuses on product and conversion measurement, using GA4 examples. It is not a guide to preserving search rankings or importing business records.

Start with the decision, not the tracking script

List the decisions your team makes from analytics: which acquisition channels produce signups, where onboarding stalls, or whether customers reach a paid activation milestone. Then identify the events and reports behind each decision.

For each important event, write a short measurement contract:

Meaning: the business fact the event represents, not just its name.

Trigger: the precise point in the workflow that establishes that fact.

Payload: required parameters, allowed values, types and units.

Identity: how anonymous and authenticated activity is associated, where applicable.

Ownership: which browser or server component sends it, including retry behavior.

Reporting: which funnel, audience or key-event setting depends on it.

A contract for “account created” should distinguish an attempted submission, a rejected request and a successfully persisted account. If the old implementation counted attempts as successes, decide whether to retain that definition temporarily or correct it. Record a measurement break rather than quietly rewriting the meaning of historical data.

Google distinguishes automatically collected, enhanced-measurement, recommended and custom events. Check the appropriate event type before creating a new name. Reusing a recommended name is useful only when the event and parameters actually represent its documented meaning.

Inventory what the Bubble app really sends

Inspect the app's current implementation, not just a list of desired events. Depending on the application, measurement may be introduced by a plugin, page header script, Tag Manager container, workflow action or server integration. Include marketing pages and the logged-in application if both participate in the funnel.

For a representative journey, capture the event sequence and the destination receiving it. Record the analytics property and stream, tag/container version, consent state, environment and test account. Do not put customer secrets or raw personal data into that evidence.

Check configuration outside the Bubble editor too: key-event markings, custom definitions, filters, audience rules and downstream advertising integrations can affect the result without changing an event payload. A deployed tag is only one part of the system.

Keep production and test traffic distinguishable using an agreed test destination or verified exclusion arrangement. Do not assume a development hostname is automatically excluded. Preserve access to historical reports; rebuilding the application does not itself move that history to a new analytics property.

Give pageviews one owner

Navigation is a common source of accidental measurement changes. A rebuilt app may move from full page loads to client-side routing, or represent a multi-step flow with different URLs. Decide which screen transitions count as views, then implement that decision once.

Google's single-page application guidance describes virtual pageviews based on browser-history changes or custom events. Test initial load, internal navigation, Back, Forward and direct entry into a deep link. Check the page location and referrer, not only the count.

Do not combine an automatic history-based pageview with a manual route event for the same transition. Google's pageview documentation also makes a subtle distinction: setting send_page_view to false suppresses the initial config-generated view, but does not by itself disable enhanced-measurement history events. Review both mechanisms when choosing manual tracking.

A tab change or modal opening is not automatically a new page. Define the intended behavior from the product journey. Otherwise a redesigned interface may inflate pageviews without anyone using the product more.

Preserve successful outcomes without double counting

A button click, a successful API response and a payment confirmation describe different stages. Use the stage required by the measurement contract. A conversion event should not announce a completed business outcome merely because the user reached a loading screen.

Choose one authoritative producer for each outcome. If both browser and server send it, define how duplicates are prevented or reconciled for that destination. Do not assume every analytics platform deduplicates arbitrary custom events because they share an identifier.

Consider an illustrative acceptance test for a booking app:

The user submits a valid request; the application creates one booking and sends one agreed completion event when collection is permitted and available.

The user clicks twice while waiting; the application still creates one booking, and the agreed completion event is not counted twice.

The request fails validation; there is no booking-completed event, although a separately defined failure event may be appropriate.

The confirmation page is refreshed; it does not announce a second new booking.

A delayed retry finishes the original request; it follows the same ownership and duplication rules.

These are expected outcomes to test, not results from a client project. Use application records to establish whether the booking exists. Use analytics to check whether the intended eligible event was collected. They answer different questions.

For integrations that also create real business actions, keep the API migration contract separate from the analytics event. Preventing a duplicate analytics hit does not prevent a duplicate payment or booking.

An analytics user identifier is not necessarily the database's primary key. If the rebuild changes account IDs, map the approved analytics identity deliberately rather than treating every migrated customer as new. Do not promise perfect continuity: browser storage, domain changes, consent choices and the measurement tool's identity model can affect it.

Test anonymous browsing, sign-in, sign-out and a different person signing in on the same browser. Google's User-ID guidance specifies clearing a previously signed-in user's ID on sign-out. Otherwise later activity can be associated with the wrong account.

Do not copy email addresses, names, free-form support text or sensitive record values into ordinary GA4 event parameters, page titles or URLs. Follow Google's guidance on avoiding personally identifiable information, and inspect the actual outgoing payload rather than trusting an event's harmless-sounding name.

Carry the approved consent implementation into the new app and test its relevant states. A migration is not permission to widen collection or bypass a refusal. Consent behavior and browser restrictions may create legitimate differences between business records and analytics totals; document those boundaries instead of forcing the counts to match.

Reconcile journeys before comparing dashboards

First test deterministic journeys in a controlled environment. For each journey, record the expected sequence, actual events, required parameters, identity transition and duplicate or missing events. Verify the destination and reporting configuration as well as the browser behavior.

Use Google's verification tools to inspect events and parameters. A successful DebugView check demonstrates that a test event reached that view; it does not prove a production funnel, audience or business outcome is correct.

After release, compare matched periods and segments rather than yesterday's total with today's. Record the exact deployment time, application version and any measurement-definition changes. Separate test traffic, consent states where observable, acquisition mix and changed navigation from genuine product behavior. Allow for the reporting delay of the destination being checked.

A useful discrepancy log has four entries: the observed difference, the likely mechanism, evidence that supports it, and the next check. For example, “pageviews rose, but successful bookings did not” is a reason to inspect route tracking, not proof of either a conversion improvement or a tracking bug.

Keep the analytics checkpoint in the broader cutover plan. If the application rolls back, know which tracking implementation becomes active. Replaying events to fill a gap without understanding the destination's rules can introduce another measurement problem.

Agree on what the handover must prove

Before accepting analytics continuity, ask for the event contract, old-to-new mapping, representative test evidence, known reporting breaks and an owner for post-release checks. Preserve the configuration and historical access needed to investigate later. Avoid simultaneous changes to event meaning, report logic and application behavior unless the break is intentional and documented.

Bubble to Code's migration approach starts with the workflows and integrations a product depends on, then rebuilds the relevant user journeys in maintainable code. Analytics requirements belong in that discussion when the business uses them to make decisions. They should be explicitly scoped, not assumed to be covered by moving a tracking snippet.

Sources

  1. 01automatically collected, enhanced-measurement, recommended and custom events · Google
  2. 02single-page application guidance · Google
  3. 03pageview documentation · Google
  4. 04User-ID guidance · Google
  5. 05guidance on avoiding personally identifiable information · Google
  6. 06Google's verification tools · Google

Keep reading

Bubble to Code is an independent service. Not affiliated with, endorsed by, or sponsored by Bubble Group, Inc.