简体   繁体   中英

how to get from google Analytics Api data for each event recorded?

I need to import from G-Analytics to Amplitude the historical data. The amplitude api show a data example of how to prepare the dato to ulpload to his site.

I need to export from GA each event ever recorded this fields and values:

{"event_type": "MainLandingScreen", "revenue": null, "ip": null, "device_manufacturer": null, "location_lng": null, "city": "San Francisco", "event_properties": {}, "platform": "Android", "location_lat": null, "os_version": null, "app_version": "0.2", "os_name": "android", "device_brand": null, "user_id": "780834", "device_id": "be4c8f2d-7c3c-e323-5a17-46e19c07eb3f", "dma": null, "language": "English", "device_model": "Google Nexus 10", "country": "United States", "region": "Bay Area", "user_properties": {"gender": "male", "referral_source": "Facebook", "push_enabled": false, "location_enabled": true, "age": 19, "profile_source": "Twitter"}, "session_id": 1436682631504, "insert_id": "3b6e196f-9404-4d63-91e7-189221e20b88", "carrier": "Verizon", "time": 1436682981567}

it is posible to retrieve this kind of information from the api of GA? or maybe with BIG-QUERY?

Yes, exporting GA4 to BQ would be much easier than trying to access GA4's data through the reporting api .

Once your data is in BQ, you'll have a lot more options for further export since there are many connectors to BQ in various ETL tools. BQ offers many comfy options for data export too.

Oh, you may need to flatten your GA4 table in BQ since it stores event and user properties as json. And, surprise-surprise, BQ is incapable of querying json. Pretty odd decision on Google's side to store the data like that. Anyhow, there are many articles indicating how to do that, here's a good one: Flattening Google Analytics data (with repeated fields) not working anymore

GA Data API will only return aggregated data and will not provide user level data like your example.

You can use BigQuery export for Google Analytics to retrieve user level data. However, this will exclude demographic information as well as device id. You can review the GA4 web-ecommerce-demo-dataset to understand what data you can expect to get from BigQuery.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM