[UA] User Data import example [Legacy]

Learn how to import a Customer Segment dimension to track your users' interests.
You are viewing a legacy article about Universal Analytics. Learn more about Google Analytics 4 replacing Universal Analytics.

Importing user metadata, such as a loyalty rating or lifetime customer value, enables you to create highly relevant Segments and Remarketing Audience lists.

Scenario

You want to understand which features on your site are most popular with food and wine enthusiasts, sports enthusiasts, and other customer segments. You maintain a data file outside of Analytics that associates customer IDs with customer segments and you plan to upload this information into Analytics to use as the basis for a Remarketing Audience.

Step One: Decide what data to import

The user IDs that you upload need to match the user IDs that you set in the hits received by your site. Refer to the developer documentation to learn how to set user ID in hits.

You can use (i.e. upload and use in hits) the same user IDs that you maintain in your offline data source as long as these IDs do not contain any personally identifying information. Note that the Analytics Terms of Service, which all Analytics customers must adhere to, prohibits sending personally identifiable information (PII) to Analytics, such as names, social security numbers, email addresses, or any similar data.

Step Two: Create the Custom Dimension

Since Customer Segment doesn’t exist as a dimension in Analytics, you’ll need to create it as a Custom Dimension.

Custom Dimension Name Scope
Customer Segment User

Step Three: Create the Data Set

  1. Sign in to Google Analytics.
  2. Click Admin, and navigate to the property to which you want to upload data.
  3. In the PROPERTY column, click Data Import.
  4. Click New Data Set.
  5. Select User Data as the Type.
  6. Name the Data Set: Customer metadata
  7. Select one or more views in which you want to see this data.
  8. Define the Schema:
    Key: Visitor > User ID
    Imported Data: Custom Dimensions > Customer Segment
    Overwrite hit data: Yes
    Click Save.

Step Four: Create the CSV

Generating your upload CSV file is a 2-step process:

1. Get the header for the CSV

In the Data Set table, click Customer metadata. This will display the Data Set schema page.

Click Get schema. You’ll see something similar to the following:

CSV header
ga:userId,ga:dimension16

 

This is the header you should use as the first line of your uploaded CSV files. The table below identifies the columns:

User ID Customer Segment
ga:userId ga:dimension16

2. Create a spreadsheet and export it as a CSV

Create a spreadsheet that follows the format above. The first (header) row of your spreadsheet should use the internal names (e.g. ga:pagePath instead of Page) provided in the Get schema dialog as shown above. The columns beneath each header cell should include the corresponding data for each header.

ga:userId ga:dimension16
456abc Food/Wine Enthusiasts
383ghz Food/Wine Enthusiasts
323hht Motorsports Enthusiasts
541vvv Motorsports Enthusiasts

Export the spreadsheet as a CSV. Your file will look something like this:

    ga:UserId,ga:dimension16
    456abc,Food/Wine Enthusiasts
    383ghz,Food/Wine Enthusiasts
    323hht,Motorsports Enthusiasts
    541vvv,Motorsports Enthusiasts

Step Five: Upload the data

You can must now upload the CSV file you created to Analytics. You have two choices for uploading your data: manually, using the Analytics user interface, or programmatically, using the Management API.

Step Six: Analyze and take action

Uploaded data needs to be processed before it can show up in reports. Once processing is complete, it may take up to 24 hours before the imported data will begin to be applied to incoming hit data.

With the component pieces in place it is now possible to analyze the results and take action. For example, to create a Remarketing Audience, complete each of the steps below:

  1. Create a custom report
  2. Create a segment
  3. Create a remarketing audience

Next steps

Once you've created a Remarketing Audience, you should create a new Google Ads campaign and add your Audience to an ad group. See the Google Ads Remarketing Help Center article for details.

Was this helpful?

How can we improve it?
true
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

18104224495244880666
true
Search Help Center
true
true
true
true
true
69256
false
false
false
false
Search
Clear search
Close search
Main menu