I have looked through several other posts about adding GA to my chrome extension but have had no luck yet.
So far this is my analytics code
analytics.js
(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-XXXXXXX-Y', 'auto');
ga('send', 'pageview');
And of course, I have already added my GA ID.The main error I keep getting is
analytics.js:3 Refused to load the script 'https://www.google-analytics.com/analytics.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem:". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.
In reference to the tutorial, I have added the following to my manifest.json
manifest.json
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
However, even after adding this to my extension, I keep getting the error in my dev console.
For reference, here is the script in my index.html
<html lang="en">
<head>
<title>Polus</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="shortcut icon" type='image/png' href="images/polus_tab_icon.png"/>
<link rel="stylesheet" type="text/css" media="screen" href="./css/calendar-style.css"/>
<script type="text/javascript" src="./js/analytics.js"></script>
</head>
Please help if possible!