Skip to content

Commit

Permalink
Allow custom scripts on GTM
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Nov 21, 2023
1 parent 635b5c0 commit 224922d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/services/analytics/TagManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const TagManager = {
})

TagManager.dataLayer({
// Block JS variables and custom scripts
// Block JS variables
// @see https://developers.google.com/tag-platform/tag-manager/web/restrict
'gtm.blocklist': ['j', 'jsm', 'customScripts'],
'gtm.blocklist': ['j', 'jsm'],
pageLocation: `${location.origin}${location.pathname}`,
pagePath: location.pathname,
})
Expand Down
2 changes: 1 addition & 1 deletion src/services/analytics/__tests__/TagManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('TagManager', () => {
wait_for_update: 500,
})
expect(window.dataLayer?.[1]).toStrictEqual({
'gtm.blocklist': ['j', 'jsm', 'customScripts'],
'gtm.blocklist': ['j', 'jsm'],
pageLocation: 'http://localhost/balances',
pagePath: '/balances',
})
Expand Down

0 comments on commit 224922d

Please sign in to comment.