• 0

Internal Analytics / Customer Tracking


Question

How does one build something like Clicky, which tracks users' movements, where they came from, etc? I want to learn more about my customers and I also want to learn more about web technologies and analytics, so I figured building Clicky-like features on my own would be a good place to start. The problem is, I'm not sure where to start. What sorts of things should I be learning more about (cookies, sessions, etc)?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

It's a lot of work to build your own. I build my own, and it took a lot of work, and I'm still working on it lol I decided to make my own as something to learn more PHP.

 

You basically need to get their user agent, referer, current page, time/date, and location (I use GeoIP).

Then you need to decide if you're going to use flat files, or a database (I use a database, hate flat files lol).

Then you need to go through thousands of user agents to make a script to find out what browser/os they are using.

 

So if someone visits with a user agent of:

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.11 Safari/537.36 OPR/21.0.1432.5 (Edition Developer)

You need your script to find out they are using Windows 7, and Opera 21.0.1432.5

There are thousands of user agents (You can thank bots for that..far too many bots..).

 

Then you need to compare dates, and the page they are on, and their previous page, to calculate how long they spent on the page.

 

Unless you have a bunch of time, it's just easier of using Google Analytics, BBclone, Piwik or Clicky lol No use re-invinting the wheel if you don't have to. Though I did enjoy building my own.

Link to comment
Share on other sites

  • 0

How does one build something like Clicky, which tracks users' movements, where they came from, etc? I want to learn more about my customers and I also want to learn more about web technologies and analytics, so I figured building Clicky-like features on my own would be a good place to start. The problem is, I'm not sure where to start. What sorts of things should I be learning more about (cookies, sessions, etc)?

You can use stuff like Google Analytics for internal use as well.  https://analyticsacademy.withgoogle.com/explorer

Link to comment
Share on other sites

  • 0

It's a lot of work to build your own. I build my own, and it took a lot of work, and I'm still working on it lol I decided to make my own as something to learn more PHP.

 

You basically need to get their user agent, referer, current page, time/date, and location (I use GeoIP).

Then you need to decide if you're going to use flat files, or a database (I use a database, hate flat files lol).

Then you need to go through thousands of user agents to make a script to find out what browser/os they are using.

 

So if someone visits with a user agent of:

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.11 Safari/537.36 OPR/21.0.1432.5 (Edition Developer)

You need your script to find out they are using Windows 7, and Opera 21.0.1432.5

There are thousands of user agents (You can thank bots for that..far too many bots..).

 

Then you need to compare dates, and the page they are on, and their previous page, to calculate how long they spent on the page.

 

Unless you have a bunch of time, it's just easier of using Google Analytics, BBclone, Piwik or Clicky lol No use re-invinting the wheel if you don't have to. Though I did enjoy building my own.

THANK YOU! This was really helpful. I want to learn as much as I can about web applications so I'm excited to get started on building a mini-Clicky for my own site. So I'm bascially tracking user agents -- that's great. I'll get started!

Link to comment
Share on other sites

  • 0

THANK YOU! This was really helpful. I want to learn as much as I can about web applications so I'm excited to get started on building a mini-Clicky for my own site. So I'm bascially tracking user agents -- that's great. I'll get started!

No problem :)

You're tracking more than user agents, it's just the most time consuming part of the project.

Tracking the pages is fairly easy. You need to get the users current page. However, I recommend not tracking the pages of bots, or your database/flat file will grow too quickly too fast.

With tracking the users page, you can determine which pages are first visited by the user, and which page is the users exit page, and how many pages the average user visits.

With the referrer, you need to find lots of search engines too. Just like with the user agents, find the search engines, and determining the search terms can be time consuming, but useful (Except with Google and DuckDuckGo due to secure search).

 

Enjoy your project :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.