SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru JoePrice's Avatar
    Join Date
    Jan 2002
    Location
    UK
    Posts
    673
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can you do user tracking with just cookies, javascript and html?

    Hi there

    I've got a site where I want to implement user tracking,
    for example if there are six sections to a website, if a user has visited sections 1,2 and 3, they appear red

    Can I do this just with cookies, javascript and html?
    I am not using any server side languages like php, asp etc

    Thanks for your responses! :-)

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You can but how are you going to save the data in a why that you can use it?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Guru JoePrice's Avatar
    Join Date
    Jan 2002
    Location
    UK
    Posts
    673
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Say a user views page 1 of 6, I want to write to a cookie that that page has been accessed and therefore make page 1 in the menu display red

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could do but if the menu was comprised of simple hyperlinks - they would show as a different color once visited anyway - does that not work for you (it's much simpler)

  5. #5
    SitePoint Guru JoePrice's Avatar
    Join Date
    Jan 2002
    Location
    UK
    Posts
    673
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm thinking it'll need to be more obvious than that...

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyway - sure you could do it with cookies - check out the excellent basic cookie scripts at quirksmode.org/cookies.

    From there, you could make a delimited string that contains all of the visited pages and store it in a cookie - on page load check to see if the current page is in the cookie if not add it - then change the colors of the corresponding menu items to red or whatever.


Bookmarks

Posting Permissions

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