[GA4] Import offline events

About offline-event data

You can import offline events from sources that don't have an internet connection or that otherwise cannot support real-time event collection via the SDKs or Measurement Protocol. Once you upload events, they are processed as though they were collected via our SDKs, and use the timestamp you provide or the timestamp of the upload if you don't provide your own.

You can import any event that matches the ones Analytics collects automatically or the ones we recommend for different verticals, or any custom event, parameter, or user property that is properly formed. Learn more

Removing this data requires either a data-deletion request or user deletion.

How offline-event-data import works

To import offline events you create a CSV file that matches the Analytics event schema. See the template examples below.

Create the custom dimensions

If you're importing values for dimensions that don't already exist in Analytics and you want to see that data in reports, then you need to create those dimensions before you upload your data. Learn more

Once you create the custom dimensions, Analytics needs up to 4 hours before it’s ready to recognize the data you import. (You can verify that the custom dimensions are processed by opening an exploration and checking to see if the dimensions are available in the dimension picker.)

Create a CSV file

Create a CSV file of your event data using the template below as a guide.

Upload data

The general upload procedure is outlined in About Data Import.

When you create the data source, select Offline event data.

For offline events, your imported fields get mapped to Analytics fields automatically.

After you upload your data, it can take up to 24 hours for Analytics to make that data available in reports, audiences, and explorations.

Deleting a data source from the data-upload service does not delete uploaded data. If necessary, and as with all other collection methodologies, you may need to follow up with a data deletion request to remove data uploaded via Data Import.

Note: Depending on the type of upload or data import source, it may or may not be possible to edit field names.

Data-source details

Legend

ScopeEvent
Required fields

[one of] client_id or app_instance_id

[one of] measurement_id or firebase_app_id

(measurement_id and client_id) or (firebase_app_id and app_instance_id)

event_name

Imported data

You may upload any event, parameter, item, or user-property data using the following header formats:

  • timestamp_micros (optional; must be within 72 hours of event; timestamp of upload if not provided)
  • user_id (optional, but recommended when it is available)
  • consent signals (optional, but highly recommended when it is available. Learn more)
  • event_param.<xxxxx> (import any param of any name)
  • user_property.<yyyyy> (import any user property of any name)
  • item<x>.<item_param> (ie: item2.item_name)
NotesYou may not upload or associate personally identifiable information with offline-event import. Learn more

 

Template

Here is an example CSV template for event data. If you need to create your upload files by hand, use this example as a guide.

measurement_idclient_iduser_idtimestamp_microsad_personalizationad_user_dataevent_nameevent_param.page_locationevent_param.page_referrerevent_param.page_titleevent_param.screen_resolutionuser_property.color_scoreevent_param.fooitem1.item_iditem1.item_nameitem1.categoryitem1.item_list_iditem1.item_list_nameitem1.indexitem1.quantityitem1.priceitem2.item_iditem2.item_nameitem2.quantityitem2.priceevent_param.transaction_idevent_param.valueevent_param.taxevent_param.shippingevent_param.currency
G-12345ABCDE1234567890.098765432110000011609488000000000granteddeniedpage_view/homereferrer.comHome page1600x900blue1-2                 
G-12345ABCDE1234567890.098765432110000011609488060000000denieddeniedpage_view/video_detail Video viewer1600x900blue1-4                 
G-12345ABCDE1234567890.098765432110000011609488120000000deniedgrantedvideo_play/video_detail Video viewer1600x900blue                  
G-67890ABCDE2345678901.987654321010000021609574400000000deniedgrantedpage_view/homereferrer.comHome page2560x1440green2-2                 
G-67890ABCDE2345678901.987654321010000021609574460000000deniedgrantedpage_view/product_detail Product detail2560x1440green2-16                 
G-67890ABCDE2345678901.987654321010000021609574520000000grantedgrantedpage_view/product_detail Product detail2560x1440green                  
G-67890ABCDE121212.343410000031609574520000000grantedgrantedpage_view/camp_lp_1referrer.comSummer Sale!2560x1440blue3-1                 
G-67890ABCDE121212.343410000031609660801000000granteddeniedview_item_list/camp_lp_1 Summer Sale!2560x1440blue 123abcred_shoeshoelist_123colorful_shoes11 234bcdblue_shoe130.00     
G-67890ABCDE121212.343410000031609660860000000grantedgrantedselect_item/camp_lp_1 Summer Sale!2560x1440blue 234bcdblue_shoeshoelist_123colorful_shoes2130.00         
G-67890ABCDE121212.343410000031609660870000000grantedgrantedpage_view/product_detail Product detail2560x1440blue3-5234bcdblue_shoeshoelist_123colorful_shoes2130.00         
G-67890ABCDE121212.343410000031609660930000000deniedgrantedview_item/product_detail Product detail2560x1440blue3-17234bcdblue_shoeshoelist_123colorful_shoes2130.00         
G-67890ABCDE121212.343410000031609660950000000denieddeniedadd_to_cart/product_detail Product detail2560x1440blue 234bcdblue_shoeshoelist_123colorful_shoes2130.00         
G-67890ABCDE121212.343410000031609660970000000granteddeniedbegin_checkout/product_detail Product detail2560x1440blue 234bcdblue_shoeshoelist_123colorful_shoes2130.00         
G-67890ABCDE121212.343410000031609660975000000granteddeniedpage_view/purchase_confirmation Congratulations!2560x1440blue3-21234bcdblue_shoeshoelist_123colorful_shoes2130.00         
G-67890ABCDE121212.343410000031609660980000000granteddeniedpurchase/purchase_confirmation Congratulations!2560x1440purple3-21234bcdblue_shoeshoelist_123colorful_shoes2130.00    t1234537.492.504.99USD

 

 

Limits

Events, parameters, and user properties that use reserved names will be rejected.

Item-event parameters (e.g., item_list_name) without values will be rejected. Item-event parameters are supported for recommended subset of events (e.g., Ecommerce, Jobs, Travel).

Event and parameter names need to observe the following rules:

  • Events can have a maximum of 25 parameters.
  • Events can have a maximum of 25 user properties.
  • User property names must be 24 characters or fewer.
  • User property values must be 36 characters or fewer.
  • Event names must be 40 characters or fewer, may only contain alpha-numeric characters and underscores, and must start with an alphabetic character.
  • Parameter names (including item parameters) must be 40 characters or fewer, may only contain alpha-numeric characters and underscores, and must start with an alphabetic character.
  • Parameter values (including item parameter values) must be 100 characters or fewer.

Limits of offline event data import

You can create up to 10 data sources for offline event data.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
5142388839375983570
true
Search Help Center
true
true
true
true
true
69256
false
false
false
false
close