This guide describes how to import user data into Google Analytics and how to use that data to create remarketing audiences for Google Ads.
Google Analytics provides a rich set of tools to analyze and segment your users, and create Google Ads remarketing audiences when you've linked Google Analytics to Google Ads. Data import can be used to enhance user segmentation and remarketing audiences by allowing you to import and take advantage of user information stored outside of Google Analytics such as in CRM systems.
This article uses the following Google Analytics technologies:
- User ID
- Remarketing Audiences
- Display Features
- Data import
To learn more about these technologies see the related resources section below.
To leverage your external CRM data to create Google Ads remarketing audiences in Google Analytics there are three main steps:
- Configure your account: Link your Google Ads account, create user scoped dimensions and a data set, and upload your user data.
- Update your tracking code: Enable the remarketing display feature, and send user scoped data with hit data.
- Analysis and taking action: Analyze user data to create user segments, and export the remarketing audience to Google Ads.
Configure your account
There are few one time operations that you will need make in the Google Analytics Admin section. The Google Analytics administration steps are:
- Link your Google Analytics and Google Ads accounts
- Create user scope dimensions
- Create a data set
- Prepare and upload data
- Upload user data
Link your Google Analytics and Google Ads accounts
To export remarketing audiences from Google Analytics to Google Ads you must first link your two accounts. You can either link your accounts programmatically through the API or from the Google Analytics Admin section with the following steps:
- In the Property column, click Google Ads Linking -> +New Google Ads Link
- Select the Google Ads accounts to link.
- Select the views (profiles) you wish to link.
- Click Save.
Create user scope dimensions
To map users to external data from a CRM system you can use custom dimensions to represent the CRM user and imported values in Google Analytics. For example, you could create two user scoped dimensions, CRM User Id, which will be sent with hit data to represent the user, and Lifetime Value, which will be set from CRM data imported into Google Analytics. The steps to create the dimensions are:
- Click Custom Definitions -> Custom Dimensions -> + New Custom Dimension.
- Name the dimensions and set the scope to User.
- Click Create.
User Id vs custom dimensions
The built-in User ID dimension that is available in Google Analytics is not used in this example to join CRM data with a user since the primary use case for the User ID feature is to enable cross device reporting, not for data import. Using a custom dimension is recommended to prevent data collisions between Id's that are used for the User ID feature and Id's that may be used in external systems.
Create a data set
To import your user data you must create a data set. A data set is used to represent one or more external data sources in Google Analytics. A data set can only be created through the Web Interface.
Under the property tab of the admin page perform the following steps:
- Select Data Import.
- Click New Data Set.
- Select User Data for the type and click Next Step.
- Name the data set and select at least one view (profile) and click Next Step.
- For the Key select the CRM User Id dimension we defined above.
- For Imported Data select the dimension Lifetime Value we created above.
- Select an Overwrite hit data option.
- Click Save.
Prepare user data for upload
Google Analytics expects user data to be uploaded in a properly formatted comma separated file (CSV). You need to make sure the user data meets these requirements before uploading.
The primary modifications and validations that you need to make to the CSV file are:
- Rename the column headers to those recognized by Google Analytics. You can retrieve the header from the data set details page in the web interface.
- Add any required values that are missing.
For example you may export your user data from a CRM tool in the following format:
After properly formatting the data it should look like the following example:
ga:dimension1,ga:dimension2 123,Gold 124,Platinum 125,Silver 126,Bronze 127,Platinum
Upload user data
Once you have created your custom dimensions and data set, and prepared your user data for upload in a CSV file, you're ready to upload your content data using the Management API or through the web interface.
Google Analytics' query-time dimension widening (QTDW) allows you to import data after a user visits your site. QTDW will also back-populate audience lists when a new Query Time Data Import dataset is uploaded, attempting to look back at DCLK (or Google Analytics in case of Optimize) cookies for the last 30 days. For more information, see Enable Remarketing and Advertising Reporting Features in Analytics.
Update your tracking code
To correctly match users with uploaded CRM data and to enable remarketing in Google Analytics, there are two changes that must be made to your tracking code:
- Enable the remarketing feature of Google Analytics by turning on Display Features as discussed in the Display Features - Web Tracking Developer Guide.
- Set the user scoped dimension to represent the CRM user. Review the Custom Dimensions & Metrics - Web Tracking (analytics.js) developer guide to learn how to set a custom dimension or metric.
Your tracking code should look like the following example after the library load snippet:
ga('create', 'UA-XXXX-Y', 'auto'); ga('require', 'displayfeatures'); ga('set', 'dimension1', 'NNNN'); // Where NNNN represents the CRM User Id. ga('send', 'pageview');
Analysis and taking action
With the component pieces in place it is now possible to analyze the results and take action. The steps needed to create a remarketing audience from the imported data are:
Create a custom report
The easiest way to verify and evaluate the imported user data is to create a custom report. For example:
- Click + New Custom Report.
- Change the report type to be Flat Table.
- Select the Lifetime Value custom dimension we created above.
- Select Sessions or any other metric you would like to use to measure a user groups behavior.
Create a segment
Create a segment representing the users you want to target. From the custom report perform the following steps:
- Click Add Segment.
- Click New Segment.
- Click Advanced Conditions.
- Change filter from Sessions to Users.
- Select the Lifetime Value custom dimension created above.
- Add as many conditional groups to the segment as you would like and click Save.
- Iterate with the segments conditions and view the results in the custom report until you are satisfied with the segment.
Create a remarketing audience
After creating a segment you can then create a remarketing audience. The steps to create a remarketing audience from the Google Analytics admin page are as follows:
- Under the property column click Remarketing -> Audiences.
- Click + New Audience.
- Select Create my own remarketing type using Segments.
- Click Import and select the Lifetime Value custom segment created above.
- Select the Google Ads account that will have access to this audience.
- Click Save.
Once you've created a remarketing audience, it is now time to create a new Google Ads campaign and add your audience to an ad group. See the Google Ads Remarketing Help Center article for details.
To learn more about each of the features:
- Read the Google Ads Links (Help Center) and the Google Ads Links Developer Guide articles to learn about linking your Google Analytics and Google Ads accounts.
- Read the About User Id (Help Center) and the User Id Feature reference articles to learn about the user id feature.
- Read the Remarketing Audiences (Help Center) article to learn about remarketing audiences in Google Analytics.
- Read the Display Feature (Help Center) and the Display Feature - Web Tracking Developer Guide articles to learn about using Google Analytics to create remarketing audiences.
- Read the Data Import Guide (Help Center) to learn about the data import feature.
- Read the Data Import Developer Guide to learn about concepts on how to use the Management API to import data.
- Read the Uploads resource reference to learn about the data import API.