Got it working now. Not 100% sure how but I believe it had to do with merged javascript files.
I had the merge javascript files setting in the admin switched on prior to the upgrade. I now disabled it, cleared the cache and since then analytics seems back on track. Probably was this but it could also been some other random thing.
Note to self: Switch off merge of JS and CSS prior to any upgrade or server move.