How to import GA4 data into Honest Analytics
Switching analytics usually means losing your history, which is the main reason people put it off. You do not have to. Importing is in the free edition of Honest Analytics, not held back for a paid tier, and it handles Google Analytics 4 as well as WP Statistics and Independent Analytics.
The GA4 route is the fiddliest of the three, because Google requires credentials. This is the whole process, including the part that is not effortless.
Before you start
Decide how far back you want. GA4 keeps event-level data for 14 months by default, though aggregated reporting goes back further. Whatever is there is what can come across, so if you have been meaning to do this, sooner is better than later.
Also decide whether you are keeping GA4 running afterwards. Running both for a month is a reasonable way to switch, and it lets you see the size of the gap rather than guessing at it.
Getting the credentials
This is the step that takes the time. GA4 does not offer a simple export token, so access goes through the Google Analytics Data API, which means a Google Cloud project and a service account.
In outline:
- Create a project in the Google Cloud console, or reuse one you already have.
- Enable the Google Analytics Data API for that project.
- Create a service account and generate a JSON key for it.
- In Google Analytics, add the service account’s email address as a user on the property, with Viewer access.
- Find your GA4 property ID. It is the number in Admin, under Property Settings, not the
G-measurement ID.
The step people miss is the fourth. Creating the service account does not grant it access to anything; you have to add it to the property explicitly, and the error you get if you skip it looks like an authentication failure rather than a permissions one.
The import guide has the current detail, including where each value goes.
Running the import
With the credentials in place, the import screen takes the property ID and the key, asks for a date range, and runs.
Two things worth knowing:
Running it twice is safe. Whole days are replaced rather than appended, so if an import is interrupted or you want to extend the range, you can simply run it again over the same dates without doubling anything.
Import in chunks if the range is long. The API has quotas, and a multi-year range in one go is more likely to hit them than several smaller runs.
Why the totals will not match
They will not, and any tool that promised otherwise would be hiding something. The reasons are structural rather than faults in the import.
GA4 was only counting consenting visitors. If your site had a consent banner, GA4 never saw the people who declined. Honest Analytics counts them. Depending on your audience, this alone can move the number by tens of per cent, and it can move it upwards.
GA4 was blocked for some visitors. Content blockers ship in browsers now, and analytics domains are on every list. Server-side counting sees those visits.
The definitions differ. Sessions time out differently. What counts as a pageview differs. GA4 samples above certain thresholds; this does not.
Uniques are not the same measurement. GA4’s user count is cookie-based and persists across days. Here it is a daily estimate of distinct browsers with the identifier destroyed every 24 hours. A monthly figure from one is not comparable with a monthly figure from the other, and summing daily uniques does not produce a true monthly unique.
Why your analytics numbers never match goes through the mechanics if you want the longer version.
What to do with the join
You will see a step in the data at the import boundary. That is expected. A few suggestions:
- Note the date. Write it down somewhere, or in a post, so that in six months nobody is investigating a “traffic anomaly” that is actually the day you changed tools.
- Do not compare across it. Year-on-year comparisons that straddle the boundary are comparing two different measurements.
- Tell anyone who reads your numbers. If a client or an advertiser gets a monthly figure, say in advance that the source is changing and the number will move. Much better than being asked afterwards.
The short version
Get a service account, enable the Data API, add the service account to the property, find the numeric property ID, run the import in chunks, and expect the totals to disagree with GA4 because they are measuring different things.