When I realized that I cannot track directly in content script. I start to work with background HTML tracking my data. via Content Script tracking with Google Analytics
It looks good. You are on the right track. You just need to update your manifest.json file to allow scripts to be downloaded from the google domain.
Assuming you are using manifest.json file with manifest_version:2
. You should add this line to the manifest
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
More info:
http://developer.chrome.com/extensions/tut_analytics.html