According to the Google Analytics docs if you want to collect analytics data when running an app on localhost you should replace
ga('create', 'UA-XXXX-Y', 'auto');
with
ga('create', 'UA-XXXX-Y', 'none');
When using the latter, will analytics data also be collected on "normal" domains, e.g. www.example.com, or will it only work on localhost?