Skip to content

Commit 3628dcc

Browse files
authored
chore(docs): add gtm tag to docs (#32048)
Docusarus gtm langchain v2
1 parent 8d2135a commit 3628dcc

File tree

3 files changed

+2303
-35
lines changed

3 files changed

+2303
-35
lines changed

docs/docusaurus.config.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const config = {
6565
},
6666
{
6767
test: /\.ya?ml$/,
68-
use: 'yaml-loader'
68+
use: "yaml-loader",
6969
},
7070
{
7171
test: /\.ipynb$/,
@@ -86,7 +86,8 @@ const config = {
8686
/** @type {import('@docusaurus/preset-classic').Options} */
8787
({
8888
docs: {
89-
editUrl: "https://github.com/langchain-ai/langchain/edit/master/docs/",
89+
editUrl:
90+
"https://github.com/langchain-ai/langchain/edit/master/docs/",
9091
sidebarPath: require.resolve("./sidebars.js"),
9192
remarkPlugins: [
9293
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
@@ -120,6 +121,9 @@ const config = {
120121
theme: {
121122
customCss: require.resolve("./src/css/custom.css"),
122123
},
124+
googleTagManager: {
125+
containerId: "GTM-MH4VTX4V",
126+
},
123127
}),
124128
],
125129
],
@@ -140,7 +144,7 @@ const config = {
140144
announcementBar: {
141145
content:
142146
'<strong>Our <a href="https://academy.langchain.com/courses/ambient-agents/?utm_medium=internal&utm_source=docs&utm_campaign=q2-2025_ambient-agents_co" target="_blank">Building Ambient Agents with LangGraph</a> course is now available on LangChain Academy!</strong>',
143-
backgroundColor: '#d0c9fe'
147+
backgroundColor: "#d0c9fe",
144148
},
145149
prism: {
146150
theme: {
@@ -160,7 +164,10 @@ const config = {
160164
},
161165
image: "img/brand/theme-image.png",
162166
navbar: {
163-
logo: {src: "img/brand/wordmark.png", srcDark: "img/brand/wordmark-dark.png"},
167+
logo: {
168+
src: "img/brand/wordmark.png",
169+
srcDark: "img/brand/wordmark-dark.png",
170+
},
164171
items: [
165172
{
166173
type: "docSidebar",
@@ -193,8 +200,9 @@ const config = {
193200
label: "Error reference",
194201
},
195202
{
196-
type: 'html',
197-
value: '<hr class="dropdown-separator" style="margin-top: 0.5rem; margin-bottom: 0.5rem">',
203+
type: "html",
204+
value:
205+
'<hr class="dropdown-separator" style="margin-top: 0.5rem; margin-bottom: 0.5rem">',
198206
},
199207
{
200208
href: "https://docs.smith.langchain.com",
@@ -212,7 +220,7 @@ const config = {
212220
href: "https://js.langchain.com",
213221
label: "LangChain JS/TS",
214222
},
215-
]
223+
],
216224
},
217225
{
218226
type: "dropdown",
@@ -221,17 +229,17 @@ const config = {
221229
items: [
222230
{
223231
label: "v0.3",
224-
href: "/docs/introduction"
232+
href: "/docs/introduction",
225233
},
226234
{
227235
label: "v0.2",
228-
href: "https://python.langchain.com/v0.2/docs/introduction"
236+
href: "https://python.langchain.com/v0.2/docs/introduction",
229237
},
230238
{
231239
label: "v0.1",
232-
href: "https://python.langchain.com/v0.1/docs/get_started/introduction"
233-
}
234-
]
240+
href: "https://python.langchain.com/v0.1/docs/get_started/introduction",
241+
},
242+
],
235243
},
236244
{
237245
to: "https://chat.langchain.com",
@@ -313,15 +321,6 @@ const config = {
313321
contextualSearch: false,
314322
},
315323
}),
316-
317-
scripts: [
318-
baseUrl + "js/google_analytics.js",
319-
{
320-
src: "https://www.googletagmanager.com/gtag/js?id=G-9B66JQQH2F",
321-
async: true,
322-
},
323-
],
324-
325324
customFields: {
326325
supabasePublicKey: process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_KEY,
327326
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL,

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@docusaurus/core": "3.5.2",
26+
"@docusaurus/plugin-google-tag-manager": "^3.8.1",
2627
"@docusaurus/preset-classic": "3.5.2",
2728
"@docusaurus/remark-plugin-npm2yarn": "^3.5.2",
2829
"@docusaurus/theme-mermaid": "3.5.2",

0 commit comments

Comments
 (0)