简体   繁体   中英

How can I log and save every click action in the app with Ionic 3?

I have an Ionic 3 application and I need to log everything that user does in the application such as the button that user clicks or the page that user enters etc. After that, I am going to send these logs to the database. I tried to do this with HostListeners but it makes things confusing. Because even I click onto an empty space, it still continues to log. Acutally, I don't want to write function to every single function into app, beucase I have already over 300 functions. So, I am curious about if there is any best practice for this situation or not. Thank you for your help!

if you want to save user actions in your database then you need to look every actions manually. In that case use following things. You need to track every events that user went through including: Click, Mouse hover, Page change etc.

https://ionicframework.com/docs/v3/api/util/Events/
https://ionicframework.com/docs/angular/lifecycle

Or if you want to add third party analytics then you can use following:

https://ionicframework.com/docs/native/google-analytics

Simple log file appender for Ionic 3.

ionic Log File Appender

在这里保存用户日志的用户火力分析是如何保存链接的链接

https://ionicframework.com/docs/native/firebase-analytics

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