Google Analytics 4
Bring a site’s history from Google Analytics 4 into Lyli: Google’s daily totals for the days before we started counting, shown in the Overview and Goals & events beside our own numbers. A workspace’s admins import; everyone in it sees the result.
Before you start
- Add the site and install the script. An import fills in the days before the site’s first visit in Lyli, so no day is counted twice.
- You need to be an admin of the workspace.
- You need a Google account that can read the Google Analytics 4 property. Older Universal Analytics properties can’t be imported.
- Check the site’s hostnames in Settings › General › Hostnames. Only visits on the hostnames the site counts come over.
Import your history
Open the site, choose Settings in the sidebar, then Import & export. The first section is Import from Google Analytics.
Connect Google Analytics. Google asks you to sign in and to allow read-only access to your Analytics. Leave that box ticked.
Pick a property. Back in Lyli, the section says which Google account you connected and lists the Google Analytics 4 properties it can read. Picking one shows when its data starts on the site’s hostnames, its time zone, and whether it matches the site’s hostnames.
Pick the days in From and To: from the property’s first day up to the day before Lyli’s first visit, or up to yesterday if we haven’t recorded one yet. They’re Google Analytics’ days, in the property’s time zone.
Start import. Do it within an hour of connecting; after that, connect again.
While it runs
The section shows how far it is, with a bar for each year. Most imports take a few minutes. Google limits how much a property hands out each day, so a very busy property can take longer: the import pauses and carries on by itself. You can leave the page.
- Imported days appear in reports only once everything is in, never half an import.
- The admin who started it gets an email when the history is in, or if the import stops. Anyone on the site’s pages when it lands sees “Google Analytics history imported”.
- Stop import… asks first, then removes what’s been imported so far and ends our access to your Google Analytics. You can start again at any time.
What comes over
Google provides daily totals, never single visits, IP addresses, or user IDs. So an import brings each day’s totals, and everything that follows single visits comes only from what we collect.
- Campaign tags are cleaned as ours are: email addresses replaced, phone numbers and IP and MAC addresses hidden, and IDs turned into short codes (hidden in the term and content tags).
- Google’s
page_view,session_start,first_visit, anduser_engagementevents aren’t imported as custom events: they’re the page views, visits, and visitors already counted. Its other events, such asscrollandfile_download, come over and are listed in Goals & events like any other. - For each day, each list (pages, sources, locations, and so on) keeps its 2,000 busiest rows. A longer tail stays in Google Analytics.
How it shows in reports
Imported days are added to our numbers in the Overview’s tiles, chart, and lists, and in Goals & events. On the chart, a dashed line marks where our own visits begin.
- Filters of one kind work with imported days: a page, on its own or on one hostname; an entry page; a source, channel, or campaign tag; a country or city; a device, browser, or operating system. Two kinds at once, a segment, a cohort, an hourly view, a hostname on its own, or a page pattern with
*leave imported days out, and the page says so. - Goals and custom events count imported days only without filters. With any filter, in Goals & events, on an event’s page, and in the Overview’s goals, they count our own visits.
- Sessions, Breakdown, Funnels, Journeys, Attribution, and Retention start where our own visits do, and say so.
- The numbers are Google’s own. Google counts differently from us and is blocked more often, so imported days and the days we recorded can differ. We don’t correct or rescale them.
Limits
- One import at a time per site, and no day twice: days another import covers can’t be imported again. Import another property brings in other days, from the same property or another one.
- An import keeps the site’s Hostnames settings as they were when it started.
- An import runs on the access its admin gave. If they’re removed from the workspace, made a member, or leave, their running import stops; what earlier imports brought stays.
- While the workspace’s dashboards are paused, an import can’t start, and one that’s running stops.
- Share links, API keys, and connected AI assistants never read imported history, and raw data downloads don’t include it. It doesn’t count toward your plan.
Your Google access
- We ask Google for read-only access (
analytics.readonly) and use it only to list the properties you can import and to read the one you pick. - We keep Google’s token encrypted, only while the import runs, and revoke it at Google when the import ends, however it ends. If no import starts within an hour of connecting, we revoke and delete it. While another import or connection from the same Google account still uses that access, we only delete the token, and revoke the access when the last one ends.
- The Google account’s email address is shown so you know which one you connected, and kept only until the import starts.
- Your Google account’s ID (not its address) is kept with each import until its imported history is deleted, so we know which imports share one access.
Imported history is part of the site’s data. We keep it until you delete it or the site, or 60 days after your trial or plan ends. Only import what you’re allowed to move: what Google Analytics collected about your visitors is covered by your own privacy notice. How we handle Google Analytics data
Delete imported history
Once an import has finished, and none is running, an admin finds Delete imported history last in Settings › Import & export. Choose Delete imported history… and type the site’s domain to confirm. Reports stop counting it at once, and the rows are deleted in the background. What we collected ourselves stays, and you can import again afterwards.
Troubleshooting
Something else? Write to us at support@lyli.io.



