I have following code on my MyBB based website forum. Strangely it works fine on Chrome but I'm not receiving any events (in realtime view) when using Opera 45 (v45.0.2552.888).
Code is copied in footer template, in script tags as provided by Google, UA-XXXXXXXXX-X has replaced the actual Id.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXXX-X', 'auto'); ga('send', 'pageview');