Last updated 1 month ago

analytics

Usage

Use the analytics section to integrate popular web analytics solutions into your portal.

Add it to the top level of the siteConfig.yaml file and configure supported analytics integrations inside it.

Options

Option Description
fullstory Integrates FullStory analytics into your developer portal. When configured, this integration works only in production, not in local development mode.
ga Integrates Google Analytics into your developer portal. This integration is supported through the Gatsby Google Analytics plugin. Refer to the official plugin documentation for more details.
gtag Integrates Google Global Site Tag into your developer portal. When configured, this integration works only in production, not in local development mode. This integration is supported through the Gatsby google-gtag plugin. Refer to the official plugin documentation for more details.
gtm Integrates Google Tag Manager into your developer portal. This integration is supported through the Gatsby Google Tag Manager plugin. Refer to the official plugin documentation for more details.
heap Integrates Heap Analytics into your developer portal. This integration is supported through the Gatsby Heap plugin. Refer to the official plugin documentation for more details.
segment Integrates Segment Analytics into your developer portal. This integration is supported through the Gatsby SegmentJS plugin. Refer to the official plugin documentation for more details.

Examples

FullStory

analytics:
  fullstory:
    fs_org: YOUR_ORG_ID

Google Analytics

analytics:
  ga:
    trackingId: your-google-analytics-tracking-id

Google Global Site Tag (gtag.js)

analytics:
  gtag:
    trackingIds:
      - "GA-TRACKING_ID" #Google Analytics / GA
      - "AW-CONVERSION_ID" #Google Ads / Adwords / AW
      - "DC-FLOODIGHT_ID" # Marketing Platform advertising products (Display & Video 360, Search Ads 360, and Campaign Manager)
    # This object gets passed directly to the gtag config command
    # This config will be shared across all trackingIds
    gtagConfig:
      optimize_id: "OPT_CONTAINER_ID"
      anonymize_ip: true
      cookie_expires: 0
    # This object is used for configuration specific to this plugin
    pluginConfig:
      # Puts tracking script in the head instead of the body
      head: false
      # Setting this parameter is also optional
      respectDNT: true
      # Avoids sending pageview hits from custom paths
      exclude: ["/preview/**", "/do-not-track/me/too/"]

Google Tag Manager

analytics:
  gtm:
    id: your-google-tag-manager-id

Heap Analytics

analytics:
  heap:
    appId: your-app-id
    enableOnDevMode: true # set to false by default

Segment

analytics:
  segment:
    prodKey: SEGMENT_PRODUCTION_WRITE_KEY
    trackPage: true