Amplify JS API Documentation
    Preparing search index...
    • Configures automatic event tracking for Kinesis Data Firehose. This API will automatically transmit an analytic event to the configured Firehose delivery stream when configured events are detected within your application. This can include: DOM element events (via the event tracker), session events (via the session tracker), and page view events (via the pageView tracker).

      Auto-tracked events are recorded with a data payload of the shape { name: eventName, attributes }.

      Parameters

      Returns void

      Only session tracking is currently supported on React Native.

      validation: AnalyticsValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or when streamName is missing while enabling a tracker.

      // Enable session tracking
      configureAutoTrack({
      enable: true,
      type: 'session',
      options: {
      streamName: 'myFirehoseStream',
      },
      });
      // Enable page view tracking for a single-page application
      configureAutoTrack({
      enable: true,
      type: 'pageView',
      options: {
      streamName: 'myFirehoseStream',
      appType: 'singlePage',
      },
      });
      // Enable DOM element event tracking
      configureAutoTrack({
      enable: true,
      type: 'event',
      options: {
      streamName: 'myFirehoseStream',
      },
      });