Welcome Guest, Not a member yet? Register   Sign In
Using cookie to track users
#1

Hello,
I want to track my users while browsing my website how can I do this job?
Reply
#2

(This post was last modified: 12-10-2015, 12:57 AM by solidcodes.)

First step you need to use User Authentication.

Community-Auth
IonAuth2

just google.

How do you want to track your users?
No SEO spam
Reply
#3

My site doesn't have login, I want to trace my visitors.
Reply
#4

Tracking a visitor has nothing to do with authentication...

For simple statistics the easiest thing you could do is use a session and store each pageview in a database with a timestamp, session_id and current url. That way you can track how many pages an average user visists etc.
But you could just rely on some external statistics like Google analytics, Piwik etc.
Reply
#5

I want to track myself can you explain more?
Reply
#6

(This post was last modified: 12-11-2015, 03:03 PM by cartalot.)

there are two ways to track someone while they are going to page to page. You can write some kind of ID to their cookie, and then retrieve that ID on the next page load. You can then use that ID to retrieve and write information to a database table such as what page they just went to. This does rely on cookies working on the visitors web browser. You can write / read the ID directly to / from the cookie, but using codeigniter 'sessions' gives you much more functionality. any information written to a cookie is unique to the visitor, but its not private - its part of the http headers that are sent by the browser.

The other way to track page to page is to create an ID, but instead of writing it to the cookie, you pass it in a hidden form field or added to the URL string. then when the person goes to the next page, you get the ID, retrieve and write the info, etc etc.
Reply
#7

(This post was last modified: 12-11-2015, 03:04 PM by solidcodes.)

(12-10-2015, 05:40 AM)Diederik Wrote: Tracking a visitor has nothing to do with authentication...

For simple statistics the easiest thing you could do is use a session and store each pageview in a database with a timestamp, session_id and current url. That way you can track how many pages an average user visists etc.
But you could just rely on some external statistics like Google analytics, Piwik etc.

Using authentication is the most complete and proper way.
Because session is on, ip is recorded etc...
No SEO spam
Reply
#8

(This post was last modified: 12-13-2015, 05:30 AM by scion.)

(12-10-2015, 12:12 AM)Hamed Wrote: Hello,
I want to track my users while browsing my website how can I do this job?

What kind of tracking u need? What information?

Implement by yourself those system dont make sense to me. For this just try to use statistic, for exmaple Google capabilities

anyway if decide to implement then u need to write to your database information info about user actions, for exapmle mb IP

addresses

Best wishes, Scion
Reply
#9

I want to save cookie id in user browser and after that find return user and path they browsed my website.
Reply
#10

What is want to is this:
1-User visit my website for 1st time
2-I save a cookie in user visitor
3-I track user url
4-user exit my website
5-user return to my website for next time
6-with saved cookie I found user visited my website last time.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB