Skip to content
all posts
Guide 5 min read updated August 17, 2026

How to migrate from Google Analytics 4 (without losing your history)

A step-by-step GA4 migration guide — export your history before the 14-month retention window closes, run both tools in parallel, and remove the consent banner correctly.

By Sourav · Building sonex
All posts

Migrating off GA4 is fifteen minutes of work wrapped in two things people usually get wrong: exporting the history before it expires, and removing the consent banner only after checking what else on the page needs it. This is the order that avoids both.

Step 0: know what you are about to lose

GA4 keeps event-level data for 2 or 14 months, configurable, on the free version. Google Signals data is capped at 26 months regardless.

That means a portion of your history is already gone, and the rest has an expiry date. Whatever you want to keep has to leave before it does — and once it expires, no support ticket brings it back.

Check your setting first: Admin → Data Settings → Data Retention. If it says 2 months, change it to 14 now, before doing anything else. That alone buys you a year on everything collected from today.

Step 1: export your history

Two routes, and it is worth doing both.

CSV, per report. In each report, use the share/export control and choose CSV. Do the ones you actually revisit: acquisition by channel, landing pages, countries, conversions, and any custom report you built. Tedious, and enough for most people.

BigQuery export, for raw events. GA4 offers a free BigQuery export. If you have ever wanted event-level data you could query yourself, set this up — but note it is not retroactive. It starts collecting from the day you enable it, so it preserves the future rather than the past.

Do this before the tag comes off. An export you meant to run is worth nothing.

Step 2: import into the new tool

sonex accepts GA4 and CSV exports, so your history continues in the same dashboard rather than sitting in a folder. Imports run in the background and resume from their last checkpoint if interrupted, which matters for a large GA4 export.

If your new tool has no import path, keep the CSVs somewhere findable and label them clearly. “Pre-migration GA4 history” in a shared drive is a low bar that a surprising number of migrations fail to clear.

Step 3: add the new tag, keep GA4 running

One script tag in <head>:

<script defer src="https://api.trysonex.com/sonex.js"
        data-website-id="YOUR-WEBSITE-ID"></script>

No build step, no SDK. Verify it is reporting before touching anything else — our install verification checks the page, the id and the response.

Leave GA4 in place for two weeks. You want both tools looking at the same traffic before you trust either.

Step 4: expect the numbers to disagree

They will, in both directions, and neither tool is broken.

Your new tool will usually report more visitors, because there is no consent gate. Every visitor who declined GA4’s banner was invisible to it and is now counted.

Some figures will be lower, because GA4 fills gaps with modelled estimates. A cookieless tool reports what it observed and does not model what it did not.

Definitions differ. A session, a bounce and a unique visitor are defined differently by every vendor — see session, bounce rate and unique visitor for what changes. Two tools on the same site have never agreed and never will.

What should match is the shape: traffic peaks on the same days, the same channels in roughly the same order, the same pages at the top. If the shapes agree, both are working. If they do not, something is misconfigured — usually the tag missing on a subset of pages.

Step 5: connect revenue

The step that makes migration worth doing rather than merely lateral.

In GA4, revenue is a purchase event you implement, and Google’s documentation is explicit that these are not sent automatically. That means it is lost whenever the tracker is blocked or the checkout completes on the payment provider’s domain.

Connect Stripe or Polar with a read-only key instead and revenue is read from the provider’s API — net of refunds, never blocked, and available on every plan. The revenue documentation covers the exact key permissions.

Step 6: remove the GA tag

Take out the gtag snippet, and take out anything that only existed to serve it — the Tag Manager container, if analytics was all it carried.

You have just removed 122,345 bytes of brotli-compressed JavaScript from every page load, as measured, which is usually visible in a Lighthouse run immediately.

Step 7: audit the banner before removing it

This is where migrations go wrong. Removing GA4 removes one trigger for the consent requirement. The banner can only go if nothing else on the page stores or reads data on the visitor’s device.

Check for:

  • Advertising pixels — Meta, LinkedIn, TikTok, Google Ads remarketing.
  • Embedded YouTube (use youtube-nocookie.com, and check what it still sets).
  • Chat widgets, which almost always set cookies.
  • Social embeds, share buttons, and A/B testing tools.
  • Session recording or heatmap tools.

Our cookie banner checker walks through this. If everything is clear, the banner comes out — and our cookie banner impact calculator will tell you roughly how much traffic you were losing to it.

If something else on the page still needs consent, keep the banner and narrow its scope. That is not a failed migration; you still removed the largest tracker on the page.

A realistic timeline

DayAction
0Check retention setting, export CSVs, set up BigQuery export
0Import history, add the new tag, verify it
1–14Both tools running; compare shapes weekly
3Connect Stripe or Polar
14Remove the GA tag and any container that only carried it
15Audit remaining cookies, then remove or narrow the banner
15Run Lighthouse and enjoy the difference

What you are giving up

Worth stating, because a migration guide that only lists benefits is an advertisement.

You lose Google Ads and Search Console integration, BigQuery raw export, and the very deep configuration surface — custom dimensions, audiences, explorations. If you run serious paid acquisition through Google Ads, those integrations are worth real money and no independent tool replaces them.

If you do not, you are giving up complexity you were not using, in exchange for a banner you no longer show and a page that loads faster.

Retention limits and revenue-event behaviour taken from Google’s own support documentation on 2026-08-17.

Frequently asked questions

How do I export my Google Analytics history before leaving?
Export from the GA4 interface as CSV per report, or set up the free BigQuery export for raw events. Do this before you switch, because GA4 keeps event-level data for only 2 or 14 months depending on your setting, and the older data is gone permanently once that window passes.
Will my numbers match after migrating from GA4?
No, and they never do between any two analytics tools. Expect your new tool to count more visitors, because there is no consent gate turning people away, and to count fewer of some things, because GA4 models conversions it did not observe. Compare trends, not absolute numbers.
Can I remove my cookie banner after leaving Google Analytics?
Only if analytics was the only thing requiring it. Advertising pixels, embedded video, chat widgets and social embeds each trigger the consent requirement on their own. Audit what else your pages load before removing the banner.
How long does migrating from GA4 take?
The tag swap takes about fifteen minutes. The export and the parallel-running period take longer — allow a fortnight before you turn GA4 off, so you can see both tools against the same traffic.

sonex is privacy-first web analytics. No cookies, no consent banner, no personal data. Drop one script and read realtime visitors, funnels and a world map in seconds.

Try sonex free
Questions

Frequently asked.

Cookies, install and pricing, answered. Still stuck? Ask us anything .

01 Can sonex show revenue next to my traffic?

Yes. Connect Stripe or Polar with a read-only key and sonex reads revenue straight from your payment provider, per website. Revenue then appears as a focusable series on the Overview chart and as its own report, beside the traffic that earned it. No tracked event is needed for it to work.

02 Does sonex use cookies?

No. sonex sets no cookies and needs no consent banner. It counts visits without cookies, fingerprinting, or any personal data, so it is GDPR, PECR and CCPA-ready by default.

03 How do I install sonex?

Add one script tag to your site's <head> with your website id. It is a single lightweight tracker — no build step and no SDK required.

04 Is sonex a Google Analytics alternative?

Yes. sonex gives you the reports that matter — visitors, pages, referrers, funnels, revenue and a world map — without surveilling your audience or drowning you in configuration.

05 How is sonex priced?

By monthly tracked events. Free covers 2k events, Pro is $20/mo for 200k events, and Business is $200/mo for 2M events with team seats.

See what your traffic actually earns.

Revenue beside the visitors that produced it. No cookies, no credit card, no consent banner.

Get started