Forum Moderators: open

Message Too Old, No Replies

hover and click information logging

         

jason_m

10:43 pm on Aug 28, 2010 (gmt 0)

10+ Year Member



the question is not really how to do the above but how to pass the information. i tried adding the information as a window.location.hash prior to switching pages such that the referrer would demonstrate what the user has done, but the has does not register on the php side.

therefore, my question is how to go about best passing this info.

thanks!

lostdreamer

10:18 am on Aug 31, 2010 (gmt 0)

10+ Year Member



perhaps some javascript would do the trick?

jquery:

<script>
$(document).ready(function() {
$("a").click(function() {
href = $(this).attr("href");
anchor = $(this).val();
logthis("clicked",href,anchor);
});
$("a").hover(
function () {
href = $(this).attr("href");
anchor = $(this).val();
logthis("mouseover",href,anchor);
},
function () {
href = $(this).attr("href");
anchor = $(this).val();
logthis("mouseout",href,anchor);
}
);
});
function logthis(action, href, anchor) {
// some ajax function to do what you want with the info?
}
<script>


I think you'll get the idea..

jason_m

3:00 pm on Aug 31, 2010 (gmt 0)

10+ Year Member



lostdreamer,

thanks for the response.
this is clear and i have completed this. my question more specifically is the following:

how do i pass this info? if i pass it in the address bar it becomes obvious to the user. i could create and append to cookies, but if the user has cookies disabled this data is not available.

basically, i am looking for a way to pass this information without the user knowing.

i am more or less looking for a best practice solution.

thanks again

jason_m

7:19 pm on Sep 8, 2010 (gmt 0)

10+ Year Member



this issue is closed. if anyone has any questions on this please pm me and i will walk you through the process.