maxandriani / ngx-google-analytics

An easy way to use and configure Google Analytics on Angular 6+ applications
MIT License
120 stars 49 forks source link

How can we use nonce properly with content security policy? #86

Open dsarlo-viso opened 2 years ago

dsarlo-viso commented 2 years ago

We are trying to use google analytics with our existing content security policy.

Currently, our content security policy lives in our backend service.

We generate a new nonce for every content security policy. - the content security policy is provided on every response

How can we leverage the nonce parameter of the NgxGoogleAnalytics forRoot initializer here? It seems as though we may need to roll our own version of this so that we can set the nonce on our google analytics inlined script for every request.