Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Location
    PA, USA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to track User's actions (i.e. mouse clicks) inside frames (or another means)

    I am building a website that offers cash to users for completing offers. Such as signing up on a site and you get $1.

    I have very little javascript knowledge. But I do know that it can be used to "listen" for mouse clicks and such. So I am wondering how to go about it.

    Can I somehow, listen for mouseclicks a user makes, tracking what they clicked on, when they clicked on it, etc. inside a iframe, then pass the values thru php into my DB?

    I have also just started learning about cookies too, The other 'offer' sites I am a member of, and I would like to duplicate, (ex. www.inboxdollars.com) say sit uses cookies to track user actions for verifications. Any thoughts?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,652
    Thanks
    80
    Thanked 4,640 Times in 4,602 Posts
    You can't do *ANYTHING* in JavaScript in a window or frame where the URL of that frame is not from the same domain as the domain where the JS is loaded from.

    So...

    I assume that these "offers"--and therefor the <iframe>s--are coming from vendors. What you would probably need to do is use a "proxy" on your web server. That is, you'd use server-side code to go out to these various sites and retrieve their HTML. Then you'd present that HTML to the user but coming from *your* domain. And of course now it's easy: You don't even have to do cross-frame scripting. You could just dump in your own JS code into their pages to catch the user clicks. Or in fact have clicks in those frames come back to your server side code, where you record the click and then do a Response.Redirect to send the user off to the actual offer page.

    HOWEVER... This all assumes that the vendors don't mind you grabbing their content via your server-side code.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •