If you are transitioning from GA4 to Amplitude, then you might want to bring all your historical GA4 data into Amplitude as well. In this post, I will share step-by-step instructions on how to do that.
Note: The following will only work if you connected GA4 data to BigQuery using the native connector. If you did not, then the following process will not work for you.
Step 1: Verify that you have the GA4 data in BigQuery
As mentioned above, for this process to work, you will need the data in the standard GA4/BigQuery format. If you have data in another format, then contact us to move that to Amplitude
Step 2: Set up a Google Cloud Storage (GCS) bucket.
BigQuery has some export limitations. In order to work around these limitations, Amplitude unloads the data from BigQuery to the GCS bucket. To create a GSC bucket, go to https://console.cloud.google.com/storage/browser and click on "Create". Give the bucket a name; you will need this name when setting up the process in Amplitude.
Step 3: Set up a service account
Service account setup is done in BigQuery. This account should have access to the bucket and the dataset/tables that you want to use for the backfill.
The service account will need the following permissions
- BigQuery
- BigQuery Job User at the project level.
- BigQuery Data Viewer at the resource level is necessary to access your data to be ingested. If your data is in a single table, just grant the service account BigQuery Data Viewer for that table resource. If the query requires multiple tables or datasets, grant BigQuery Data Viewer on all tables or datasets in the query.
- Cloud Storage
- Storage Admin on the GCS bucket you're using for ingestion.
To create a service account, go to https://console.cloud.google.com/iam-admin/serviceaccounts
When you create a service account, you will get a Service Account Key, a JSON file (downloaded) that you will need later.
Step 4: Set up The Import in Amplitude
- Log in to your Amplitude account, select the project in which you want to import (backfill) the data.
- Go to Data --> Sources
- Click on "Add Source".
- Scroll down to the Data Warehouse section and click Google Analytics 4 (Make sure you select Google Analytics 4 and not BigQuery)
- Next, add the name of the GSC bucket and upload the service account key file (the JSON file that was downloaded)
- Click Next to verify the access
- Click next to configure table selection. Follow these options:
- Select Table Type: Choose the table type based on the export type you configured in BigQuery Linking:
- Daily: Select if you configured it with daily.
- Streaming: Select if you configured it with streaming.
- Both: If both were selected, select Daily.
- Input Table Name: Provide the table name in the format projectId.datasetName.tableName.
- GA4 tables have the last part as the data of the data. Enter the name of the table that contains the first data of data that you want to import. For example, if you want to import the data from Jan 1, 2025, then you will write projectId.datasetName.events_20250101
- After configuring your options, click Next. Amplitude shows you a pre-defined SQL query to verify the data import from BigQuery. This SQL Query transforms GA4 data into an Amplitude-compatible format.
- The pre-defined query usually handles all required fields, but you can customize it to include additional fields if needed. If your event names or paramater are different in GA4 than what you need for Amplitude, then you can make modifications in this SQL query to make them similar. Alternatively, you can also do them in BigQuery before ingesting the data.
- Select Table Type: Choose the table type based on the export type you configured in BigQuery Linking:
- Click Next. Enter the name of the source and then click Save.
- Now you are done. Wait for the data to start showing up.
Need Help with Moving from GA4 to Amplitude?
If you need help with moving from GA4 to Amplitude then email us at support@optizent.com or fill out the contact us form