Welcome Guest, Not a member yet? Register   Sign In
Advice on what I should be looking at?
#8

(This post was last modified: 07-01-2016, 05:19 PM by cartalot.)

you don't need javascript. you do need sessions. so lets say you make a db table called Users. and a table called UserPages. when the user first hits a web page - say its the home page - make a long randomized string to use as a 'token'. save that to the session. create your user in the db table, and use the Token as the unique ID.

Get the page name - Home - and in your UserPages table - insert with the Token, the page name, and the current day time. Return the insert id,
update your Users table with the id from UserPages in a field called something like last_page_visited, and a field for current day time.

the user goes to page About - you pick up the token from the session - retrieve the user from the Users Table which includes the last visited Page Id. Look it up in the UserPages table, in a field for daytime left the page - update that record with the new time - and you can do a calculation for duration and put that in there as well. Insert the new page About with the daytime, and etc etc etc. Obviously theres a lot more you can record like their browser, ip, etc but that should give you the general idea and its pretty simple to do.

also for those going omg google analytics --- theres a few million people using script blocker and it automatically blocks google analytics.
Reply


Messages In This Thread
RE: Advice on what I should be looking at? - by cartalot - 07-01-2016, 05:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB