I am trying to create a library, lets call it L. A company has an android app, say A.
L can be linked to A such that in the codes of A, the dev just needs to add something like:
L l = new L("client_id") l.startTrack();
Now L should be able to track all clicks that happens in A and pass to a server for logging. AppSee is a product that is already doing this.
I am wondering how can i intercept every user action to get the action target name (button title? textfield?)
Thank you!
What Is In App Event Tracking? In app event tracking means to have a detailed overview of the post – install activities inside your app. It offers you many hints about the way users interact with your app. That allows you to improve your campaigns in terms of acquisition, engagement, and retention.
Android Event Handlers Event Handlers are useful to define several callback methods when we are building custom components from view. Following are some of the commonly used callback methods for event handling in android applications. Method. Description. onKeyDown()
OnFocusChangeListener . This is called when the user navigates onto or away from the item, using the navigation-keys or trackball.
Mixpanel is the most advanced analytics platform which is used to track user interaction with the web and mobile apps.
What you are asking is EventTracking, like in GoogleAnalytics. But the approach you are doing is different. In Google analytic one needs to start event to event tracker. Like say you have a 3 buttons and you need to track each button separately, there you put 3 separate events trackers.
If you want to track all the events going through the activity you need to implement Activity's onInterceptTouchEvent()
. Whenever a touch event happens in an activity, it passes through the said method above.
As Google says
Implement this method to intercept all touch screen motion events. This allows you to watch events as they are dispatched to your children, and take ownership of the current gesture at any point.
with caution
Using this function takes some care, as it has a fairly complicated interaction with View.onTouchEvent(MotionEvent), and using it requires implementing that method as well as this one in the correct way.
For more Event details, look here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With