View Full Version : serving page content depending on what pages the user visited in the past.
DoubleV
12-12-2002, 07:13 PM
like for example, a home page would highlight the products that the user viewed in the past.
i do not need specific lines of code for now, but i would like to find out 'what is the mechanism' to make this work?
what needs to happen and how?
From an active page, the furthest you can look backwards is one page - 'the referer'.
Understanding that leads you to deciding what method to use for storing client-viewing-data.
You have:
Sessions: effective only while client is on the site and in the same browser window.
Cookies: effective as long as the client accepts them.
Database: nice place to store the info - just remembering which client's info is which when they leave and return is tricky.
Are you looking to store the data from one day to the next / indefinitely / single browser session?
DoubleV
12-12-2002, 08:05 PM
possibly indefinitely.
then database seems like the only option, doesn't it?
if we make the users register, then i guess we could store the pages according to user names. but what if they do not register? will i have to generate a random id for them?
and also, how do i keep track of all those pages? will i have to create a separate table for each user to keep records of the pages?
Transistor
12-13-2002, 01:21 AM
DoubleV, I did a similar thing to what you would like to do.
1 Allow registration, if the user registers, it is going to be easier.
2 Serve cookies (with milk, ha!) to every user.
3 Create a log and everytime anyone visits a page, record in that table the cookie id, the page and other information you would like to have (probably User Agent, IP, date...).
The next steps depends on what you want to store that information for.
Perhaps, show them a list of past viewed pages?
Perhaps a suggestion, based on your analysis of the pages visited? (this is the one I use my log for).
What would you like to do with that log?
DoubleV
12-16-2002, 03:03 PM
Transistor,
sorry it took me so long to get back to the thread.
what we wold like to do is pretty much teh same thing as suggestion. we would like to display info based on what pages were most visited in the past.
Transistor
12-16-2002, 04:58 PM
It´s ok, DoubleV.
Then, your next step would be to find if the cookie id is stored in your log, if so, then select the pages visited in the past.
You will need a way to relate pages, if you want this process to be automated, for example using keywords.
If not, you could make an interface that shows you the pages visited and allows you to enter the recommended pages.
My site is about music and I have related artists in another database. This way, when I analyse a user's log, I can suggest other artists from the ones he/she has browsed before.
Well, hope this helps! Good luck! :thumbsup:
DoubleV
12-16-2002, 05:58 PM
Transistor,
thats a lot! :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.