Skip to content

Commit

Permalink
Move google tagmanager noscript in body
Browse files Browse the repository at this point in the history
1. noscript elements are not supported in the head. According to GTM docs,
    this should be placed directly below the <body> tag. This isn't
    exactly under the <body> tag, but it is high enough in the vulcan
    dom that it will work the same.
  • Loading branch information
aburke07 committed Jul 5, 2023
1 parent ddcb10f commit 26f68ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions frontend/templates/troubleshooting/components/TagManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function GoogleScript() {
return <script dangerouslySetInnerHTML={{ __html: scriptTag }} />;
}

function GoogleNoScript() {
export function GoogleNoScript() {
return (
<noscript>
<iframe
Expand Down Expand Up @@ -74,7 +74,6 @@ export function TagManager() {
return (
<>
<GoogleScript />
<GoogleNoScript />
<MatomoScript />
</>
);
Expand Down
3 changes: 2 additions & 1 deletion frontend/templates/troubleshooting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { BreadCrumbs } from '@ifixit/breadcrumbs';
import { HeadingSelfLink } from './components/HeadingSelfLink';
import ProblemCard from './Problem';
import { PixelPing } from '@components/analytics/PixelPing';
import { TagManager } from './components/TagManager';
import { TagManager, GoogleNoScript } from './components/TagManager';

const Wiki: NextPageWithLayout<{
wikiData: TroubleshootingData;
Expand Down Expand Up @@ -87,6 +87,7 @@ const Wiki: NextPageWithLayout<{

return (
<Flex direction="column" alignItems="center" width="100%" fontSize="16px">
<GoogleNoScript />
<NavBar
editUrl={wikiData.editUrl}
historyUrl={wikiData.historyUrl}
Expand Down

0 comments on commit 26f68ea

Please sign in to comment.