Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Software Referer Graph

Referer Graph

A small python script, that generates a clickable image showing references between pages.

Some big websites use some sort of user tracking to optimize the clickpaths of their visitors. The optimization can either be userfriendly: "oh, this page is a hub we should provide direct links without travelling through five other pages", or some markting guy tries to figure out where to best place ads.

Whatever the reasons. The question is, how to do this. Common solution is a tracking pixel or tracking Javascript that sends informations to a logging server. But if you don't want to use this you can try to get away by simply parsing your logfiles.

sample referer graph

So here is what the script does:

  • Extract source and target URL by looking at the referer. 
  • Store data in a database
  • Aggregate them and plot all links that have more then N entries

 

Of course this doesn't work if the user is not sending a referer. But a lot of browsers do.

The numbers inside the bubbles are just the internal IDs for the URL. Otherwise the bubbles would be way too big. In the real output all the bubbles are clickable by use of an imagemap.

Any Squares are external references. The numbers beside the arrows are the number of clicks that happened.

Download and test. Feedback is welcome