This article is about Google Analytics 4 properties. If you're using a Universal Analytics property, refer to the Universal Analytics section of this help center.

[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 example below.

Data-source details

Legend

Scope Event
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 24 hours of event; timestamp of upload if not provided)
  • user_id (optional, but recommended when it is available)
  • 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)
Notes You 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_id client_id user_id timestamp_micros event_name event_param.language event_param.page_location event_param.page_referrer event_param.page_title event_param.screen_resolution user_property.color_score event_param.foo item1.item_id item1.item_name item1.category item1.item_list_id item1.item_list_name item1.index item1.quantity item1.price item2.item_id item2.item_name item2.quantity item2.price event_param.transaction_id event_param.value event_param.tax event_param.shipping event_param.currency
G-12345ABCDE 1234567890.0987654321 1000001 1609488000000000 page_view en /home referrer.com Home page 1600x900 blue 1-2                                  
G-12345ABCDE 1234567890.0987654321 1000001 1609488060000000 page_view en /video_detail   Video viewer 1600x900 blue 1-4                                  
G-12345ABCDE 1234567890.0987654321 1000001 1609488120000000 video_play en /video_detail   Video viewer 1600x900 blue                                    
G-67890ABCDE 2345678901.9876543210 1000002 1609574400000000 page_view fr /home referrer.com Home page 2560x1440 green 2-2                                  
G-67890ABCDE 2345678901.9876543210 1000002 1609574460000000 page_view fr /product_detail   Product detail 2560x1440 green 2-16                                  
G-67890ABCDE 2345678901.9876543210 1000002 1609574520000000 page_view fr /product_detail   Product detail 2560x1440 green                                    
G-67890ABCDE 121212.3434 1000003 1609574520000000 page_view it /camp_lp_1 referrer.com Summer Sale! 2560x1440 blue 3-1                                  
G-67890ABCDE 121212.3434 1000003 1609660801000000 view_item_list it /camp_lp_1   Summer Sale! 2560x1440 blue   123abc red_shoe shoe list_123 colorful_shoes 1 1   234bcd blue_shoe 1 30.00          
G-67890ABCDE 121212.3434 1000003 1609660860000000 select_item it /camp_lp_1   Summer Sale! 2560x1440 blue   234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00                  
G-67890ABCDE 121212.3434 1000003 1609660870000000 page_view it /product_detail   Product detail 2560x1440 blue 3-5 234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00                  
G-67890ABCDE 121212.3434 1000003 1609660930000000 view_item it /product_detail   Product detail 2560x1440 blue 3-17 234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00                  
G-67890ABCDE 121212.3434 1000003 1609660950000000 add_to_cart it /product_detail   Product detail 2560x1440 blue   234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00                  
G-67890ABCDE 121212.3434 1000003 1609660970000000 begin_checkout it /product_detail   Product detail 2560x1440 blue   234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00                  
G-67890ABCDE 121212.3434 1000003 1609660975000000 page_view it /purchase_confirmation   Congratulations! 2560x1440 blue 3-21 234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00                  
G-67890ABCDE 121212.3434 1000003 1609660980000000 purchase it /purchase_confirmation   Congratulations! 2560x1440 purple 3-21 234bcd blue_shoe shoe list_123 colorful_shoes 2 1 30.00         t12345 37.49 2.50 4.99 USD

 

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 a subset of events (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 character or fewer.
Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
69256
false