If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Sep 2015
    Member #

    Java script for counting the number of clicks and replacing the context

    Hi Friends I am a new designer i just launched my website and i wanted to know that is there a way to calculate and show the number of clicks on a particular context for example consider this website
    Whatsapp Status|Rare Whatsapp Status|Whatsapp Whatsapp!

    In this i have used the zero clipper to copy directly into the system's clipboard so that will be it works in a flash content system which copies using a flash command these are the things i want
    1 ) when someone clicks on the content to copy it i want a way to record the click count and in the real time i want to show it in the website that "this many people clicked this content" in a small box
    2) In the real time i want to show the most clicked content in top like in ascending order from top to bottom.

    I dont know what kind of script it required and since i am stater in this website development thing i want kind of scripts i needed.
    Thank you for helping
    Any kind of help will be ok


  3. #2
    Junior Member DisasterMaster's Avatar
    Join Date
    Oct 2015
    Lees Summit, MO. USA
    Member #
    Raindeer, you could always use Google Tag Manager to record clicks but I don't think it's such a good fit for the purpose you describe. It won't provide details like user IP, nor user browser, nor can you fetch the data to display in real time on your page...

    A while back I wrote some custom coding to do pretty much what you describe. My purpose was a bit different as I wanted to track clicks on header banner ads and gather the time stamp, and user IP. I then pushed that info into a database and subsequently wrote additional code to display this info to users on their advertising dashboard. This allowed me to show them how many clicks, click user IP, time stamp and of course total clicks, click through rate vs. impressions (I created another class just to record impressions only), average cost per impression and average cost per click.

    In your post you mentioned javascript but I went with PHP tied to a mySQLi database.

    The way the code works is like this:

    When the desired item gets "clicked" a PHP class runs that grabs the desired data and then pushes it into a database. Once that is accomplished the same class then routes the user through with the originally clicked item. You could say this is like an "intercept" at the point of click - then load the data - then send the clicker on their merry way to the desired destination.

    I don't mind sharing some code samples with you but I am very new here and don't even know if we can place any code in these discussion posts. If you would like to see some code sample of how to do this and of course if it is possible to place code in my post just let me know what the procedure is for that...

    Edit: Disregard the posting of code procedure. I've done two posts with the quick reply option but then found the full featured posting GUI that does have the button for inserting code. Yep I'm a newby here LOL so bear with me
    Last edited by DisasterMaster; Oct 22nd, 2015 at 10:32 AM. Reason: Figured out how to post code

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 08:08 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: