Skip to main content

Analytics

You can track page views using Microsoft Application Insights in the deployed web site. There are many other analytics platforms supported by Docusaurus through other plugins.

Insert your application insights web configuration in the docusaurus.config.js file with, at least, the instrumentationKey. By default, cookies are disabled.

./docusaurus.config.js
...
const config = configure({ ... }, {
appInsights: {
config: {
instrumentationKey: "YOUR KEY HERE"
}
enableClickAnalytics: false,
}
})

Options

The following options are available:

FieldTypeRequiredDefault ValueDescription
configApplicationInsightsConfigYesN/AThis object holds the configuration for Application Insights. It has many possible fields including instrumentationKey, endpointUrl, maxBatchInterval, etc. See ApplicationInsights-JS Configuration for full details.
enableClickAnalyticsbooleanNofalseIf set to true, enables click analytics.