Stats-How do I count the number of clicks on a page for a picture?

Source: Internet
Author: User
How to count the number of clicks or impressions of an image link on a php page?
Ask a master to give some ideas?
See a lot of online, useful database with the cache, the kind of optimal?

Reply content:

How to count the number of clicks or impressions of an image link on a php page?
Ask a master to give some ideas?
See a lot of online, useful database with the cache, the kind of optimal?

Redis or Memcache write a key, the image link open background processing when the key value plus 1.

You should use caching to do frequent statistical work, and ultimately this data is to be saved to the database, if the cache is cached, once the buffer is lost (especially memory-based cache), then you must not cry to death

Simply want to know the number of clicks per link you can use directly with Google Analytics _trackevent ()

Following:
1. You can link the redirect in the htaccess, write a log, and then write a timed script to batch processing in the storage.
2. Redis is memory-based, but can also be implemented (Redis periodically writes updated data to disk).
3.MC, because it is memory-based, easy to lose.

  • 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.