Skip to content

Commit

Permalink
Allow passing a nonce to google tag manager related script (#73370)
Browse files Browse the repository at this point in the history
What 

Adding nonce in script in google tag manager

Why 

Prevent from using csp header inline script or adding url manually in
csp headers by package users.

How

passing nonce to the script.

Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
abdelrahmanAbouelkheir and ijjk authored Dec 3, 2024
1 parent 1f44f13 commit 3fcd1a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/third-parties/src/google/gtm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function GoogleTagManager(props: GTMParams) {
id="_next-gtm"
data-ntpc="GTM"
src={`${gtmScriptUrl}?id=${gtmId}${gtmLayer}${gtmAuth}${gtmPreview}`}
nonce={nonce}
/>
</>
)
Expand Down

0 comments on commit 3fcd1a1

Please sign in to comment.