How to design mobile app-php to count users' time in the app

Source: Internet
Author: User
The product design wants to calculate the length of time a user spends in the app, including the time when the user activates and hides the app. My current solution is to request backend interfaces with different parameters when the app is activated or hidden Based on the home page for statistics. However, if you think about it, the data volume of the table will be very large... the product design wants to count the duration of the user's time in the app, including the time when the user activates and hides the app.

My current solution is to request backend interfaces with different parameters when the app is activated or hidden Based on the home page for statistics.

However, the data volume of the table will be very large. Difficult to maintain.
Is there any better solution?

Reply content:

The product design wants to calculate the length of time a user spends in the app, including the time when the user activates and hides the app.

My current solution is to request backend interfaces with different parameters when the app is activated or hidden Based on the home page for statistics.

However, the data volume of the table will be very large. Difficult to maintain.
Is there any better solution?

Simple statistics include third parties, such as umeng.

1. Write access log analysis
2. One Table per day

Write a timer function on the client side to report device status every 30 S or 60 s

Why is the data volume very large? If you want to count the total length of time and accumulate each time, if you want to know how long it takes to open it, there is no way to be lazy. You just need to create a table, so it's a big deal to back up regularly, maintain a certain amount of data in the table.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.