Skip to content

Commit

Permalink
Setting CSP headers for Google Analytics automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Apr 16, 2024
1 parent ed4805f commit 4e78be4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lombiq.BaseTheme/Views/GoogleTag.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

@if (HostEnvironment.IsProduction() && (trackingConsentFeature is null || trackingConsentFeature.CanTrack))
{
GoogleAnalyticsContentSecurityPolicyProvider.EnableForCurrentRequest(Context);

var viewModel = Model as GoogleTagViewModel ?? new GoogleTagViewModel
{
GoogleTagPropertyId = Model.GoogleTagPropertyId,
Expand Down

0 comments on commit 4e78be4

Please sign in to comment.