Google Analytics may not work as it is if you want to get it working from your browser plugin due to security limitations and protocol conflict. To resolve it, follow the steps explained below,
First step is to get your manifest file allow GA domain.
"content_security_policy": "script-src 'self' https://www.google-analytics.com; object-src 'self'"
ga('create', 'UA-YOUR_ID-1', 'DOMAIN_NAME');
ga('set', 'checkProtocolTask', null);
ga('send', 'pageview', 'user');
ga('set', 'checkProtocolTask', null); line is important as it makes GA ignore the protocol check. This was causing me a lot of trouble. See here Google Analytics
DOMAIN_NAME is also important, as GA can't detect that for your plugin. Set that to your domain name you want to track!
GA has a hidden gem, instead of
https://www.google-analytics.com/analytics.js just use
https://www.google-analytics.com/analytics_debug.js which will print useful debug messages on the chrome console!