A lot of people are replying to the suggestion of implementing your own analytics by calling out it&#x27;s NIHness.<p>I&#x27;ve recently been faced with this problem, and a solution doesn&#x27;t have to be too complex.<p>There are roughly two parts to an analytics solution: event logging and, well, the actual analytics.<p>Writing your own logger in javascript is super simple, you&#x27;re just sending off json objects to be inserted into a elasticsearch cluster. Since you have to define that logging anyhow, the only extra work you need to do is the layer to do the actual ajaxrequests.<p>What&#x27;s left is running and defining your queries in elasticsearch.<p>BAM! Analytics<p>I realize it&#x27;s not fit to be used for <i>every</i> situation, but it can so some pretty complex things this way without the hugest amount of effort ...