Skip to content

Commit

Permalink
activate gtm using presets (#165)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Tworkiewicz <[email protected]>
  • Loading branch information
adamtwo and Adam Tworkiewicz authored Dec 13, 2024
1 parent e9ea280 commit 76969c2
Show file tree
Hide file tree
Showing 3 changed files with 5,280 additions and 1,400 deletions.
24 changes: 3 additions & 21 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { sidebarItemsGenerator } from './custom-sidebar.js';

const baseUrl = '';
const projectName = 'ai-unlimited-docs';
const gtTagId = 'GTM-PPXTTZ2';
const getCurrentLocale = () => process.env.DOCUSAURUS_CURRENT_LOCALE ?? 'en';

/**
Expand Down Expand Up @@ -56,26 +55,6 @@ const trackingScripts = [
async: 'true',
},
},
{
tagName: 'script',
attributes: {
type: 'text/partytown',
src: `https://www.googletagmanager.com/gtag/js?id=${gtTagId}`,
async: 'true',
},
},
{
tagName: 'script',
attributes: {
type: 'text/partytown',
},
innerHTML: `
window.dataLayer = window.dataLayer || [];
window.gtag = function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${gtTagId}');
`,
},
];

/** @type {import('@docusaurus/types').Config} */
Expand Down Expand Up @@ -180,6 +159,9 @@ const config = {
'./src/css/custom.css',
],
},
googleTagManager: {
containerId: 'GTM-PPXTTZ2',
},
}),
],
// Redocusaurus config
Expand Down
Loading

0 comments on commit 76969c2

Please sign in to comment.