We extend Ukkonen's online suffix tree construction algorithm to support frequency queries, by adding count fields to the internal nodes of the tree, as suggested in [8]. This may be useful in the field of sequential data compression, for example in the implementation of an efficient PPM-style compression algorithm with unbounded context length. We show that due to the onlineness requirement the algorithm's worst case time complexity is O(n2 ). However, our approach remains acceptable since its average case performance can be shown to be n log n under some reasonable assumptions.