You can collect data through the Google tag as well as Measurement Protocol and data import features using Google Analytics. This will make sure you have a comprehensive view of all of your purchase events, including the ones that weren’t collected by tag or viewable before. You can import user-provided data directly from the Google Analytics client ID. With this new data, you can improve measurement insights across important events and campaign performance. You can collect all of your web purchase events through the “Event Data Import” feature in Google Analytics.
Supported source types
The following import sources are supported for web import into Google Analytics:
- BigQuery
- Google Cloud Storage
- MySQL
- PostgreSQL
- Amazon Redshift
- Amazon S3
- Google Sheets
- HTTPS
- Oracle
- Snowflake
How to import data using purchase events
- In Admin
, under "Data collection and modification", click Data import. Note: The previous link opens to the last Analytics property you accessed. You must be signed in to a Google Account to open the property. You can change the property using the property selector. You must be an Editor or above on the Analytics accountat the property level to view data source details.
- Create a new data source or select an existing data source.
- Click Create data source, to create a new source of data.
- Enter a name for your data source in the Data source name field.
- Under “Data type”, select Events.
- Select Web.
- Toggle on the “Improve measurement for purchase events” option.
- (Optional) Select a data stream. If your property has multiple web streams, you’ll have the option to select one data stream. If your property only has one web data stream, it will be pre-selected.
- Navigate to the “Upload data for import” section.
- Select your import source from the drop down.
- Click Connect.
- In the “Select web purchase data to use” section under the “Set up connection” window, fill all the required fields under the “Data selection” section.
- Optional: You can create filters by adding conditions by selecting fields for your required conditions under the “Optional data enhancements” section. These filters ensure only web purchase events are collected, requiring all other events to be filtered out.
- Click Next.
- In the “Map fields” page of the “Set up connection” window, complete the fields in each step to get more details from web purchase reports. The more information you provide, the more accurate your reports will be.
- Purchase event identification: For accurate measurement, complete the required information in the table or click Nextto accept the recommended suggestions. The data in these fields should be in the same data being sent from your Google tag.
- User identifiers: To accurately match your data to purchase events, select at least one field or click Nextto automatically accept suggestions.
- Purchase value: Specify the value of the purchase. Select at least one field or click Nextto automatically accept suggestions.
- Consent: Specify consent values per data row. Select at least one field or click Nextto automatically accept suggestions.
- Optional improvements: Add fields to improve accuracy. Select at least one field or click Nextto automatically accept suggestions.
- Optional parameters: Select any additional parameters that you’d like to include with the purchase events. Select a parameter or property and click Addto choose from a list of known parameters and registered dimensions in the property.
Learn more about these fields in the “ Data-source details ” section.
- Click Next.
- In the Set up connection window, in the Review page, review your connection and set up a schedule for when you want to import your data
- Click Done.
- Click Doneagain and follow the next steps.
Data-source details
Field type
Field name
Data type
Description
Purchase event identification fields
Note: These are required fields.
Conversion date/time
String
Used to know when the event occurred.
Transaction ID
String
Used to identify and deduplicate purchase events.
User identifier fields
Note: You must provide at least one of these fields.
Client ID
String
Used to find and match the event and to count unique users appropriately.
User ID
String
Used to find and match the event to look up advertising identifiers and to count unique users appropriately.
GCLID
String
Used as an advertising identifier and to count unique users appropriately.
Purchase value fields
Note: These fields are optional.
Conversion value
Double
Used as the value of the conversion.
Currency code
String
Used to currency convert the value parameter.
Consent fields
Note: These fields are optional.
Ad personalization consent (ad_personalization)
String
Sets consent for personalized advertising.
Ad measurement consent (ad_user_data)
String
Sets consent for sending user data related to advertising to Google. The ad_user_data consent type is required for measurement use cases, such as enhanced conversions and tag-based conversion tracking.
Optional improvements
Note: These fields are optional.
User agent
String
Used for device information.
IP address
GBRAID
String
Used for campaign attribution.
WBRAID
String
Used for campaign attribution.
Email address
Hash
User-provided data, used for identification and activation in the trusted execution environment (TEE).
Phone number
Hash
User-provided data, used for identification and activation in the trusted execution environment (TEE).
First name
Hash
User-provided data, used for identification and activation in the trusted execution environment (TEE).
Last name
Hash
User-provided data, used for identification and activation in the trusted execution environment (TEE).
Postal code
String
Non-sensitive address information.
Country
String
Non-sensitive address information.
Optional parameters
Note: These fields are optional.
Standard event parameters and or event-scoped custom parameters
String
Additional pieces of data about an event.
Event-scoped custom parameters must be pre-registered as a custom dimension in the property. Learn more about creating event-scoped custom dimensions .
Standard user properties and or user-scoped custom parameters
String
Attributes that describe a user.
User-scoped custom parameters must be pre-registered as a custom dimension in the property. Learn more about creating event-scoped custom dimensions .
Standard item parameters and or item-scoped custom parameters
String
Attributes that can describe the products or services.
Item-scoped custom parameters must be pre-registered as a custom dimension in the property. Learn more about creating event-scoped custom dimensions .
Check the section below to learn how to format item parameters for import.
How to format item parameters
You can add item parameters and map them to your source fields. If your purchase events have multiple products in a single transaction, you must arrange your item parameters in arrays. The items array should contain information about items included in the event and is repeated for each item.
Example
A customer purchased a $10 blue shirt, $5 red shorts, and a $20 orange t-shirt in a single transaction.
| item_price |
item_color |
item_category |
|---|---|---|
| 10, 5, 20 |
blue, red, orange |
shirt, shorts, t-shirt |
Deduplication of purchase events
Accurate deduplication of events can only be done when transaction_id for purchase events is collected. Make sure that you’re collecting the same value across tag, Measurement Protocol and Data Import, so that deduplication of events is carried out.
You can also import your copy of the transaction log using to deduplicate with your website measured purchases to improve your purchase measurement. You can add additional item parameters to include details about items sold in your purchases.
Note: While you can import data without any time limit, only events with a time stamp from the previous 2 calendar days, plus today will be collected and processed. Learn more about the timing of importing events.
The calendar day is based on the reporting time zone that you have set in the “Property details” page under your “Property settings.” Learn more about editing a property ./p>
Example
If events are imported at 1:00 AM today, any event with a timestamp originating from 2 days prior up to 1:00 AM today will be processed. Similarly, if events are imported at 11:00 PM today, the processing will involve all events bearing a timestamp from 2 days prior until 11:00 PM today.

