initialize(
    trackingId = this.trackingId,
    trackingOptions = this.options,
  ) {
    if (!trackingId) {
      console.warn('[Analytics] ANALYTICS DISABLED: Tracking ID not specified.');
    }
    else if (!this.initialized) {
      this.trackingId = trackingId;
      if (trackingOptions) this.options = {...this.options, ...trackingOptions};

      // Ensure we never send analtyics events during tests.
      if (process?.env?.test === 'true') this.options.testMode = true;
      // Enable debug logging in verbose mode.
      if (this.options.verbose == null) this.options.debug = true;

      // Initialize the tracking id.
      ReactGA.initialize(trackingId, this.options);

      // TODO Allow passing through options
      // Set session variables.
      // ReactGA.set({
      //   dimension1: '???',
      // });

      // Do this last in case something blows up.
      this.initialized = true;
    }
  }
/**
   * Initialize the underlying tracker, setting
   * the tracking id and session level analytics dimensions.
   * This must be called before you can do any event tracking.
   *
   * @param {string} [trackingId] - The id of the analytics account
   *   to track events to. This gets pulled from the environment
   *   variables if not specified.
   * @param {AnalyticsOptions} [trackingOptions] - Options to pass to the underlying
   *   tracker object. This can also be passed in the constructor.
   *   See https://github.com/react-ga/react-ga#reactgainitializegatrackingid-options
   */
Initialize the underlying tracker, setting
the tracking id and session level analytics dimensions.
This must be called before you can do any event tracking.

@param {string} [trackingId] - The id of the analytics account
to track events to. This gets pulled from the environment
variables if not specified.
@param {AnalyticsOptions} [trackingOptions] - Options to pass to the underlying
tracker object. This can also be passed in the constructor.
Initialize the underlying tracker setting the tracking id and session level analytics dimensions . This must be called before you can do any event tracking . @param { string } [ trackingId ] - The id of the analytics account to track events to . This gets pulled from the environment variables if not specified . @param { AnalyticsOptions } [ trackingOptions ] - Options to pass to the underlying tracker object . This can also be passed in the constructor .
initialize(
    trackingId = this.trackingId,
    trackingOptions = this.options,
  ) {
    if (!trackingId) {
      console.warn('[Analytics] ANALYTICS DISABLED: Tracking ID not specified.');
    }
    else if (!this.initialized) {
      this.trackingId = trackingId;
      if (trackingOptions) this.options = {...this.options, ...trackingOptions};
      if (process?.env?.test === 'true') this.options.testMode = true;
      if (this.options.verbose == null) this.options.debug = true;
      ReactGA.initialize(trackingId, this.options);
      this.initialized = true;
    }
  }
initialize ( trackingId = this . trackingId , trackingOptions = this . options , ) { if ( ! trackingId ) { console . warn ( '[Analytics] ANALYTICS DISABLED: Tracking ID not specified.' ) ; } else if ( ! this . initialized ) { this . trackingId = trackingId ; if ( trackingOptions ) this . options = { ... this . options , ... trackingOptions } ; if ( process ?. env ?. test === 'true' ) this . options . testMode = true ; if ( this . options . verbose == null ) this . options . debug = true ; ReactGA . initialize ( trackingId , this . options ) ; this . initialized = true ; } }
Initialize the underlying tracker, setting
 the tracking id and session level analytics dimensions.
Initialize the underlying tracker setting the tracking id and session level analytics dimensions .
// Ensure we never send analtyics events during tests. // Enable debug logging in verbose mode. // Initialize the tracking id. // TODO Allow passing through options // Set session variables. // ReactGA.set({ //   dimension1: '???', // }); // Do this last in case something blows up.