Integrations
/Analytics
/Analytics Integrations
Analytics Integrations
Integrate an analytics platform to track events
Automatically send analytics data about your documentation engagement to your third party analytics providers.
All integrations
Enable Analytics
Set your analytics keys in docs.json
under the integrations.analytics
section:
docs.json
{ "integrations": { "analytics": { "livesession": { "trackId": "required" } } } }
Tip
Sign up to LiveSession to get your trackId
.
Demo
Welcome to the analytics demo!
This is a demo of the analytics integration.
Analytics APIExperimental
You can use analytics
API in your custom MDX components:
export function MyComponent() { function handleClick() { analytics.track( "event_name", { key: "value" } ) } return ( <div className="mycomponent"> <Button kind="secondary" onClick={handleClick} > Get Started </Button> </div> ) } <MyComponent/>
Info
Note that analytics
refers to a global variable.
Analytics Events
We send the following events to your analytics provider.
Event name | Custom properties | Description |
---|---|---|
docs.copy_page | { | When a page is copied. |
docs.anchor.click | { | When a heading anchor is clicked. |
docs.code.copy | { | When code is copied. |
docs.code.example_change | { | When a code example is changed. |
docs.code.scroll_100 | { | Triggers when a scroll of codeblock reached at bottom. |
docs.code.scroll_depth | { | Triggers when a specific depth of codeblock scroll reached out. |
docs.code.tab_change | { | When a code tab is changed. |
docs.details.open | { | When a user opens a details. |
docs.details.close | { | When a user closes a details. |
docs.search.open | - | When a user clicks on search. |
docs.search.result_click | { | When a user click a search result. |
docs.search.query_change | { | When a user change query on search input. |
More powerful analytics events coming soon.
Built with
Show your support! Star us on GitHub ⭐️