Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Web Analytics tools - How are they made?

Featured Replies

Hey all,

 

I was just wondering how website analytics tools are made? Google analytics, squarespace analytics etc.

 

I was wondering if it can be done in php/javascript or if other languages are used. Id like to have a go writing my own purely for fun just to learn but not 100% sure where to start.

 

 

The basic data is mostly captured via javascript, the data being values that can be captured from a web browser eg,

 

Date/time

User agent

Page URI

Referring page

IP address

...and so on

 

Once the data is captured it's send to a central database, then from there the database can be quiried to produce reports.

I was going to say it's basically a very extensive JavaScript library that connects to a back end API, that could be written in PHP I suppose, to store data in a complex database - or rather, data warehouse in the case of Google.

Edited by andy9l

Those above have got it bang-on.

 

The only other thing to note is that they will usually set a cookie in the user's browser, which is what can help when determining new vs returning visits and such.

 

The approach you take in writing a custom system all depends on what data you're wanting to capture. A very basic system could be easily embedded into each page with PHP, just to pull the browser versions, IP and such. Throw this data into a MySQL database and then find a way of presenting it, and you're done.

 

It's worth remembering though, that the data any scripts like this can collect are easily falsified by the end user. This once again feeds back into your design, as you need to ensure that data you gather is useful and you understand the context fully.

 

As with all projects - begin by identifying what data you want to collect, how it should be processed, and what the output should be.

 

Jon

  • Author

Thanks for the great response guys! I feel like it is actually something that I could build. I like to have fun weekend programming projects so this seems like a great one to get stuck into as I can use Javascript and PHP, perhaps even transition it to node.js after :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.