Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

How to record number of mouse click to a link

  • 05-09-2014 8:14pm
    #1
    Registered Users, Registered Users 2 Posts: 40


    Hi,
    we are developing a listing website, one of the requirement is to hide the business contact details to user and reveal it only if they click a button/link (say 'Contact Details' ) and record this clicks (this click wont open a new page but show only couple of lines under or above the link - phone no, email etc). How to record this number of click in the database to show to business owner.

    Idea is that, site admin wants to show to listed business owner that these many people tried to get contact details of business through this site.

    site is building using PHP/mySQL

    Thanks for your help
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 403 ✭✭counterpointaud


    Sounds like Google Analytics API might suit this?


  • Registered Users, Registered Users 2 Posts: 159 ✭✭magooly


    Use an ajax call attached to the button that calls a method from your controller to increment and save the count.
    Reveal the details when the response arrives.
    Place a flag in the session to prevent the user clicking it more than once.


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Journeyman_1


    Should be pretty easy to write a small php function to update the database onClick(). Maybe only increment once per session.


  • Registered Users, Registered Users 2 Posts: 1,127 ✭✭✭smcelhinney


    +1 for GA. If its javascript event-driven functionality (ie. no page transition) event tracking is what you're looking for.


  • Registered Users, Registered Users 2 Posts: 40 team eGlobe


    Thanks guys for valuable information. I am going to try GA first. Thanks again


  • Advertisement
Advertisement