Skip to content

Commit

Permalink
fix(gatsby-plugin-google-tagmanager): Add "aria-hidden" (#27062)
Browse files Browse the repository at this point in the history
  • Loading branch information
mareksuscak authored Sep 29, 2020
1 parent d8ed76c commit 0ecba23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ exports[`gatsby-plugin-google-tagmanager defaultDatalayer should add a static ob

exports[`gatsby-plugin-google-tagmanager should load gtm 1`] = `"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl+'';f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer', 'undefined');"`;

exports[`gatsby-plugin-google-tagmanager should load gtm 2`] = `"<iframe src=\\"https://www.googletagmanager.com/ns.html?id=undefined\\" height=\\"0\\" width=\\"0\\" style=\\"display: none; visibility: hidden\\"></iframe>"`;
exports[`gatsby-plugin-google-tagmanager should load gtm 2`] = `"<iframe src=\\"https://www.googletagmanager.com/ns.html?id=undefined\\" height=\\"0\\" width=\\"0\\" style=\\"display: none; visibility: hidden\\" aria-hidden=\\"true\\"></iframe>"`;
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-tagmanager/src/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const generateGTM = ({ id, environmentParamStr, dataLayerName }) => stripIndent`
})(window,document,'script','${dataLayerName}', '${id}');`

const generateGTMIframe = ({ id, environmentParamStr }) =>
oneLine`<iframe src="https://www.googletagmanager.com/ns.html?id=${id}${environmentParamStr}" height="0" width="0" style="display: none; visibility: hidden"></iframe>`
oneLine`<iframe src="https://www.googletagmanager.com/ns.html?id=${id}${environmentParamStr}" height="0" width="0" style="display: none; visibility: hidden" aria-hidden="true"></iframe>`

const generateDefaultDataLayer = (dataLayer, reporter, dataLayerName) => {
let result = `window.${dataLayerName} = window.${dataLayerName} || [];`
Expand Down

0 comments on commit 0ecba23

Please sign in to comment.