Skip to content

Commit

Permalink
docs: fixing gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
francav committed Apr 29, 2024
1 parent e8ab6bd commit 02c7013
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
19 changes: 9 additions & 10 deletions apps/react/docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const config: Config = {
locales: ["en"],
},

scripts: [],

presets: [
[
"classic",
Expand All @@ -48,6 +46,8 @@ const config: Config = {
],
],

plugins: [],

themeConfig: {
// Replace with your project's social card
image: "img/docusaurus-social-card.jpg",
Expand Down Expand Up @@ -150,14 +150,13 @@ const config: Config = {
};

if (process.env.PROD === "true") {
config.scripts.push({
src: `https://www.googletagmanager.com/gtag/js?id=${process.env.GTAG_ID}`,
async: true,
});
config.scripts.push({
src: "/js/gtag.js",
async: false,
});
config.plugins.push([
"@docusaurus/plugin-google-gtag",
{
trackingID: process.env.GTAG_ID,
anonymizeIP: true,
},
]);
}

export default config;
1 change: 1 addition & 0 deletions apps/react/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@docusaurus/core": "3.2.1",
"@docusaurus/plugin-google-gtag": "^3.2.1",
"@docusaurus/preset-classic": "3.2.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/react/docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@
"@docusaurus/utils-validation" "3.2.1"
tslib "^2.6.0"

"@docusaurus/[email protected]":
"@docusaurus/[email protected]", "@docusaurus/plugin-google-gtag@^3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.2.1.tgz#b54e6bfa0ca2efac5ed02fea39cbf069d2893a2c"
integrity sha512-XtuJnlMvYfppeVdUyKiDIJAa/gTJKCQU92z8CLZZ9ibJdgVjFOLS10s0hIC0eL5z0U2u2loJz2rZ63HOkNHbBA==
Expand Down

0 comments on commit 02c7013

Please sign in to comment.