Skip to content
Last updated

Amplitude Analytics

Integrate Amplitude Analytics into Redocly project to track page views and outbound link clicks

With the consent option on, this integration loads only while the consent state allows the analytics category. In opt-in mode the visitor must accept first. In opt-out mode the category starts on and stays on until the visitor refuses.

Configuration

OptionTypeDescription
apiKeystringREQUIRED. Amplitude project API key
includeInDevelopmentbooleanSet this option to true to enable Amplitude Analytics in development mode and preview builds. Default: false.
headbooleanPut tracking scripts in the head tag instead of body
exclude[string]Do not send page view events on certain pages
pageViewEventNameStringSet this option to change the event name for page views. Default: pageView.
outboundClickEventNameStringSet this option to change the event name for outbound link clicks. Default: outboundLinkClick.
amplitudeConfigAmplitude JS SDK optionsAmplitude SDK init options as described in Amplitude docs

Example

analytics:
  amplitude:
    includeInDevelopment: true
    apiKey: my-api-key
    head: true
    respectDNT: true
    exclude:
      - /private-docs/**
    outboundClickEventName: linkClick
    pageViewEventName: routeChange
    amplitudeConfig:
      batchEvents: true
      includeReferrer: true

Resources