Search code examples
sqlhttpanalytics

saving referer url in a database


I have written some code that provides statistical information about visitors to a website (like "Google Analytics")

I have a REFERER table with refererID, refererURL columns. The refererURL contains the whole url, including the parameters.

other tables, such as the statistics table, refer to this table by the refererID column.

This is not efficient in terms of database storage space.

How could I save the referer URL differently to save as much space as I can?

Thank you Yaron


Solution

  • I would recommend storing the domain, path, and query each separately. The domain will get a lot of reuse, especially from all of the Google traffic.

    When displaying analytics data you will normally show the site which sent the traffic and when drilling down into the information you will display the more specific URL which sent the traffic.