Skip to content

Commit

Permalink
Merge pull request #86 from GetStream/remove-duplicate-gtm
Browse files Browse the repository at this point in the history
WD-671: fix script duplication
  • Loading branch information
jaapbakker88 committed Jul 17, 2023
2 parents fb6d6a9 + 33839be commit 511cfdf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
9 changes: 0 additions & 9 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,6 @@ if (navbarSDKItems.length > 1) {

const plugins = [...defaultPlugins, ...CUSTOM_PLUGINS]

if (process.env.DEPLOYMENT_ENV === "production") {
plugins.push([
"@docusaurus/plugin-google-gtag",
{
trackingID: process.env.GOOGLE_TAG_TRACKING_ID || "DEFAULT",
},
])
}

/**
* For video, we want to embed the homepage in the content repository.
*/
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@docusaurus/core": "2.4.1",
"@docusaurus/plugin-content-docs": "2.4.1",
"@docusaurus/plugin-content-pages": "2.4.1",
"@docusaurus/plugin-google-gtag": "2.4.1",
"@docusaurus/theme-classic": "2.4.1",
"@docusaurus/theme-live-codeblock": "2.4.1",
"@docusaurus/theme-mermaid": "2.4.1",
Expand Down
7 changes: 7 additions & 0 deletions src/theme/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ export default function Layout(props) {
return (
<AuthContextProvider>
<Head>
{isProd && (
<script
async
key="gtmPreload"
src={`https://www.googletagmanager.com/gtag/js?id=${gtmId}`}
></script>
)}
{trackingScript && (
<script data-cookieconsent="ignore">{trackingScript}</script>
)}
Expand Down
10 changes: 0 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1491,16 +1491,6 @@
tslib "^2.4.0"
webpack "^5.73.0"

"@docusaurus/plugin-google-gtag@2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.4.1.tgz#6a3eb91022714735e625c7ca70ef5188fa7bd0dc"
integrity sha512-mKIefK+2kGTQBYvloNEKtDmnRD7bxHLsBcxgnbt4oZwzi2nxCGjPX6+9SQO2KCN5HZbNrYmGo5GJfMgoRvy6uA==
dependencies:
"@docusaurus/core" "2.4.1"
"@docusaurus/types" "2.4.1"
"@docusaurus/utils-validation" "2.4.1"
tslib "^2.4.0"

"@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
Expand Down

0 comments on commit 511cfdf

Please sign in to comment.