Google Analytics tracking in Chrome Extension's background.html

前端 未结 1 718
既然无缘
既然无缘 2020-12-23 22:40

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

相关标签:
1条回答
  • 2020-12-23 23:19

    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

    0 讨论(0)
提交回复
热议问题