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

How to record number of mouse click to a link

Options
  • 05-09-2014 9:14pm
    #1
    Registered Users 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 Posts: 403 ✭✭counterpointaud


    Sounds like Google Analytics API might suit this?


  • Registered Users 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 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 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 Posts: 40 team eGlobe


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


  • Advertisement
Advertisement