Importing Data into Google Analytics 4: A Complete Guide to End-to-End Analysis

Effective data analysis is critical to the success of any business. However, data is often scattered across different platforms, including CRMs, advertising accounts, and analytics tools. This fragmentation makes it challenging to obtain a comprehensive view of the business, identify key insights, and refine strategies.

Google Analytics 4 enables you to import data from external sources and consolidate all data into a single interface. In this article, I will explain the types of data you can import, the analytics benefits of importing data, and how to implement importing.

What is the difference between data import and the Measurement Protocol?

In GA4, data import involves uploading large amounts of structured data from external systems, such as Customer Relationship Management (CRM) systems, advertising platforms, and databases. CSV files are typically used for this purpose. This imported data is then combined with the raw data collected by GA4 through its tracking code, enabling comprehensive analysis and the creation of advanced reports.  

The Measurement Protocol (MP) is a tool that sends individual events directly to GA4 servers in real time via special HTTP requests.

The Measurement Protocol tracks events that are not automatically tracked by the site or app. Here are some examples of such events:

  • Offline conversions, which are target actions performed outside the site.
  • Server-side interactions, including order processing, payment processing, and user registration.
  • Actions from devices where it is not possible to install the standard GA4 tracking code, such as POS terminals.

The main difference is:

  • Data import involves downloading large arrays of pre-collected, structured data to enrich analytical reports.
  • The Measurement Protocol involves sending individual events in real time to track non-standard interactions.

Now, let's look at some examples from e-commerce.

Example 1. Let’s say you want to analyze the effects of marketing campaigns on sales. There are two main sources of data:

  • Advertising costs from various platforms.
  • Transaction data from the CRM system.

The best solution in this case is to import the data into Google Analytics 4, which allows you to:

  • Combine large amounts of data on expenses and sales.
  • Conduct a comprehensive analysis of return on investment (ROI).
  • Evaluate the effectiveness of marketing channels by considering the entire picture.

Importing data enables you to upload large amounts of structured data into GA4, thereby expanding your analysis and reporting capabilities.

Example 2. You need to track purchases made through an app, but the standard GA4 tracking code does not always accurately record these transactions.

The best solution in this situation is to use the Measurement Protocol, which allows you to send data about each transaction directly to GA4.

  • Send data about each transaction directly to GA4.
  • It works in real time.
  • Achieve accurate sales tracking, even when standard tracking fails.

For more information about data merging methods, see Google Analytics Help.

Types of data available for import into GA4

GA4 supports the import of six main data types.

Cost data

This feature enables you to download advertising cost data from platforms outside the Google Ads ecosystem, including Facebook Ads, TikTok Ads, and Bing Ads. This can be done using specific services:

By importing cost data, you can see your marketing expenses in full. This approach enables you to compare the return on investment for each platform within a single interface, and you can then make informed decisions about budget allocation. 

For example, assume that you run advertising campaigns on Facebook Ads and Bing Ads and want to compare their effectiveness by calculating return on ad spend (ROAS).

In this case, importing expense data into GA4 is useful.

After importing expenses from Facebook Ads and Bing Ads and combining them with revenue data from your website, GA4 will automatically calculate the ROAS for each platform.

Item data

This type of data import allows you to upload detailed product information.

You can import the following types of data:

  • Item IDs (SKUs)
  • Item names
  • Categories
  • Brands
  • Options: color and size

Importing product data allows you to:

  • Segment reports by various item attributes.
  • Gain a deeper understanding of buyer behavior for specific products. 

For example, you can transfer the cost and profit data of each product to GA4. The system will then automatically calculate the ROI for each product.

User data by user ID

This option allows you to send additional information about registered users to GA4 using the user ID as an identifier.

A user ID is a unique identifier assigned to each user when they create an account on your website or in your app. This identifier allows you to recognize the same person even if they log in from different devices, such as a smartphone during the day and a laptop in the evening.

Using the user ID, you can import the following data:

  • Demographic data: age, gender, and location
  • Loyalty data: loyalty level and date of last purchase
  • Financial data: lifetime value (LTV) and average order value (AOV)
  • Subscription information: status and expiration date

When importing data into GA4, it is important to understand how the system handles duplicates. For instance, if you upload data with the same key (e.g., user ID and field), GA4 will overwrite the old value with the new one.

As an example, if a user ID has a value in the "location" field, and you import a new one, the previous value will be replaced.

Therefore, you should only import demographic or behavioral data if GA4 does not collect it automatically or if you have more accurate information from other sources.

Note that importing User ID data only works in GA4 properties where the User ID feature was enabled during setup. You may need a separate GA4 property for analyzing data from registered users.

Example: A company that provides subscription services wants to analyze how changes in subscription status affect lifetime value (LTV) and user activity.

To perform this analysis, the analysts must import the following data from the CRM into GA4:

  • User ID
  • Subscription status (trial, active, or canceled)
  • Subscription start and end date

GA4 is already collecting data on platform usage, including the number of sessions, views, and events.

The following can then be analyzed:

  • LTV for subscription statuses.
  • Engagement before and after cancellation.
  • User behavior based on subscription duration.

User data by client ID

This type of data import retrieves information about potential customers using the Client ID.

A Client ID is a unique identifier assigned by GA4 to users' browsers and devices. It is necessary to combine data collected before a user registered or logged in.

Example: You can import data on the pages viewed by a user before they filled out a feedback form and match it by Client ID.

Offline event data

This type of import allows you to track events that occur outside of your site or app and are therefore not automatically tracked by GA4.

Offline events include customer interactions with your business that take place in an offline environment, such as:

  • Purchases made in physical stores
  • Phone orders
  • Meetings with customers or consultations
  • Visits to exhibitions or events
  • Interactions with customer support via phone or email

To import offline event data, collect information about the events, such as the date, time, event type, and purchase amount, and link it to user identifiers (User ID or Client ID), if possible.

Example: You own a retail store and want to analyze the impact of online advertising on your offline sales. Here's how to do it:

  • First, collect data about in-store purchases, including the date and time of the purchase, the amount purchased, and the customer ID (e.g., the loyalty card number), which can be matched to the User ID if the customer is registered online.
  • Import the data into GA4.
  • GA4 will then match the customer’s offline purchases with their online activity, such as ad views and website visits. This will show you which campaigns lead to an increase in offline sales.

Custom event data

In GA4, you can pass additional parameters for custom events that aren't included in standard GA4 capabilities.

Custom events are user actions on your site or in your app that you want to track but are not automatically generated by GA4.

Importing these parameters allows you to enrich your custom event information and gain deeper insights into user behavior.

Example: You want to track downloads of PDF files from your site. Here's how:

  • Create a special event called file_download.
  • Import the following additional parameters: file_name, file_category, and file_size.

With these parameters, you can analyze which files are downloaded most often, the categories they are from, and whether there is a correlation between file size and the number of downloads.

Preparing to import data

GA4 supports the import of data in CSV format. However, you'll need to prepare your file to meet Google Analytics' structure and format requirements.

Visit the GA Help Center for CSV file templates with example parameters.

Fields for importing data 

To import data correctly, you need to understand the required data and fields. This data is typically exported from internal systems, such as CRM, advertising platforms, record management systems, and user databases.

Data type

Required fields

Other useful fields

Cost data

Date, Source, Medium, Cost

Campaign, Ad Group, Creative, Currency

Item data

Item ID (e.g., item_id or SKU)

Item Name, Category, Brand, Variant, Price

User data by User ID

User ID

Loyalty Level, Customer Lifetime Value, Demographics (e.g., age, gender), Subscription Status

User data by Client ID

Client ID

Phone Number, Email Address, Lead Source

Offline event data

Event timestamp, Event name, Client ID, or User ID

Transaction ID, Purchase Amount, Offline Channel

Custom event Data

Parameters set for a special event, at least one.

Any additional parameters related to your business process

Importing data into GA4

The import process is similar for all types of data. 

  1. Log in to your GA4 account, and go to the Admin section.

  1. Go to Data collection and modification, and select Data import.

  1. Click Create data source.

  1. Enter a name, and select the data type and source for import.

  1. Compare the source data with the corresponding GA4 fields, and click Import.

Common errors and possible solutions

While it is a straightforward process, certain issues often pop up. Here is a table of common mistakes and their solutions.

Error

Description

How to fix

Incorrect file format

The uploaded file is not in CSV format or has an incorrect file extension.

Ensure that the file is in CSV format and has the .csv extension.

Incorrect CSV file structure

The file is missing required columns, or the columns are in the wrong order.

Check the file structure to ensure that it meets the requirements for the selected import type. Ensure that all required columns are present and in the correct order.

Incorrect data format in columns

The data in the columns does not match the expected format. For example, there may be text values instead of numeric values or an incorrect date format.

Check each column and ensure that the data matches the expected format. Correct any discrepancies.

Import limits exceeded

The file is too large or contains too many rows.

Split the file into smaller parts and import them separately. For more information about import limits for your data type, check Google Analytics Help.

File encoding issues

The file is encoded in a format that is not supported by GA4. For example, it may be encoded in ANSI instead of UTF-8.

Save the file in UTF-8 format. Most text editors and spreadsheet programs allow you to select the encoding when saving a file.

Field mapping errors

When setting up the import, the fields in your file were not mapped correctly to the GA4 fields.

Check the field mapping settings to ensure that each field in your file is mapped to the correct GA4 field.

Data import is not processing

The data does not appear in GA4 reports even after a long time.

Check the status of the data import in the "Data Import" section of GA4. Ensure there are no error messages or processing delays. If the problem persists, contact Google Analytics Support.

Conclusions

  1. By importing data, companies can enhance their GA4 reports with information from CRM systems, advertising platforms, databases, and other relevant sources.
  2. GA4 allows you to import six types of data:
  • Cost data
  • Item data
  • User data by User ID
  • User data by Client ID
  • Offline event data
  • Custom event data
  1. The more data you import, the better the insights. You can then evaluate your advertising campaigns, products, and user behavior more effectively.
  2. It’s important to regularly check the quality and relevance of your imported data.
  3. Import data as often as your business requires.

Topics:
1
0
Found a mistake? Select it and press Ctrl + Enter
OSZAR »