How should clickstream data be prepared before user segmentation can be performed?
This sounds like a time-related predictive task...i.e. forecasting. The data you have available is event-driven, e.g. data is recorded when a user clicks on a link/refreshes a page/clicks on a Google ad etc. This means that you need to treat your data as if it were a time-series for each user. This would be easier if you had access to ESP (Event Stream Processing) but let's say that you do not. Therefore, you need to identify each user, aggregate their info/features so that you have features identifying the number of unique pages they visited, the number of sessions they had etc. etc. Then you can segment these users and you may or may not derive useful segments from them. You could even go a step further and do session analysis whereby you identify unique sessions and cluster/segment user sessions looking for nice visual patterns or anomalies.