初次访问所有页面的用户的实地考察 [英] Site tour for first time user for all pages

查看:69
本文介绍了初次访问所有页面的用户的实地考察的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

识别用户首次访问网站页面的最佳方法是什么.我编写了一个脚本,显示了该页面的浏览过程.由于游览只能显示一次.我需要知道.

What is the best way to identify a user to visit a page in a site for the first time. I've written a script which shows a tour of the page. Since tours should be shown only once. I need to know.

例如,考虑一个域example.com,如果用户首次登录时我需要在"/"页面上显示游览.当用户导航到"/page1"时,我应该显示该页面的游览.当用户返回"/"时,我不应该显示游览.但是,当用户转到"/page2"时,我应该在第2页上显示游览.

For example consider a domain example.com if a user login for the first time i need to show a tour on the '/' page.. When the user navigates to '/page1' i should show the tour for that page. when the user go backs to '/' i shouldn't show the tour. But when user goes to '/page2' i should show the tour on page2.

我可以通过单个查询找到用户首次登录!但是我该怎么做每一页.我的想法是每次用户导航时都对数据库进行查询,但是我知道这不是最好的方法.

I could able to find the first time when the user logs in by a single query.! but How can i do that for each and every page. My idea was to make a query to database every time when the user navigates but i know it's not the best way.

注意:Cookies可以用来追踪任何东西.

Note: Cookies can be used to track anything.

推荐答案

客户端登录后,检查cookie以查看他访问过的页面.

When client logged in, check cookie for pages he has visited.

如果cookie为空,请检查数据库,并使用客户端已经访问过的页面创建新的cookie

If the cookie is empty, check database en create new cookie with the pages that de client allready had visited

此外,在每个页面上您都检查cookie,如果该页面尚不在页面中,请显示游览并将其添加到cookie(和db)中,否则不执行任何操作:)

Further, on every page you check the cookie, if the page is not yet in it, show the tour and add it to the cookie (and the db), else do nothing :)

当然,数据库部分仅适用于注册用户.另外,不要忘记将userid(或类似的东西)存储在cookie中并进行检查,这样,当另一个用户在同一台​​计算机上浏览您的网站时,他仍然会看到旅程!

Ofcourse the db part will only work with registered users. Also do not forgot to store the userid (or something similar) into the cookie and check that too, so that when another user browse your website on the same computer, he still will see the tour!

有些其他的事情,但在您遇到的情况中可能有用的是 http://notes.xoxco.com/post/36766728425/aware-js-make-your-site-reader-aware

Something completely else, but might be usefull in your situation is http://notes.xoxco.com/post/36766728425/aware-js-make-your-site-reader-aware

这是一个jQuery插件,可以跟踪您的访问并相应地更改布局(例如,首次访问者,回访者但今天是第一次访问...)

This is a jQuery plugin that keeps track of you visits and change the layout accordingly (eg first time visitor, returning visitor but first time today, ...)

这篇关于初次访问所有页面的用户的实地考察的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆