docs: Add heading and codeblock events for segment (#9050)

* docs: Add heading and codeblock events for segment

* docs: Update scroll event names

* docs: improve capture of code block language

* docs: ensure code block language capture for mobile
This commit is contained in:
Ronnie Miller 2025-07-15 08:17:11 -07:00 • committed by GitHub
commit d8291131ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 407 additions and 0 deletions

View file

@ -131,6 +131,27 @@ const config = {
["docusaurus-node-polyfills", { excludeAliases: ["console"] }],
"docusaurus-plugin-image-zoom",
["./src/plugins/segment", { segmentPublicWriteKey: process.env.SEGMENT_PUBLIC_WRITE_KEY, allowedInDev: true }],
["./src/plugins/scroll-tracking", {
segmentPublicWriteKey: process.env.SEGMENT_PUBLIC_WRITE_KEY,
allowedInDev: true,
selectors: [
{
selector: 'h1, h2, h3, h4, h5, h6',
eventName: 'Docs.langflow.org - Heading Viewed',
properties: {
element_type: 'heading'
}
},
{
selector: '.ch-codeblock',
eventName: 'Docs.langflow.org - Codeblock Viewed',
properties: {
element_type: 'code',
language: 'helper:codeLanguage'
}
}
]
}],
[
"@docusaurus/plugin-client-redirects",
{