_setupEventHandlers() {
    Router.addEventListener('routechange', this._onRouteChange.bind(this));
    VideoMetrics.addEventListener(
      'videostarted',
      this._onVideoStarted.bind(this)
    );
    VideoMetrics.addEventListener(
      'videounregistered',
      this._onVideoUnregistered.bind(this)
    );
    VideoMetrics.addEventListener(
      'videoReportQuartile',
      this._onVideoReportQuartile.bind(this)
    );
    SharingManager.addEventListener(
      'shareclicked',
      this._onShareClicked.bind(this)
    );
    MicrozineEvents.addEventListener(
      'relateditemclicked',
      this._onRelatedItemClicked.bind(this)
    );
    MicrozineEvents.addEventListener(
      'shoppableitemclicked',
      this._onShoppableItemClicked.bind(this)
    );
    MicrozineEvents.addEventListener(
      'pageswipe',
      this._onPageSwiped.bind(this)
    );
    MicrozineEvents.addEventListener(
      'scrollended',
      this._onScrollEnded.bind(this)
    );
    MicrozineEvents.addEventListener(
      'microzineready',
      this._onMicrozineReady.bind(this)
    );
    document.addEventListener('click', this._onPageClicked.bind(this));
    document.addEventListener('beforeunload', this._onPageUnload.bind(this));
    window.addEventListener('pagehide', this._onPageUnload.bind(this));
    if (Properties.isFriendlyIframe) {
      document
        .getElementById('content')
        .addEventListener('scroll', this._onScroll.bind(this));
    } else {
      document.addEventListener('scroll', this._onScroll.bind(this));
    }

    // if (document.getElementById('brand_header')) {
    //   document.getElementById('brand_header').addEventListener('click', this._onHeaderClicked.bind(this));
    // }

    if (Properties.isFriendlyIframe) {
      window.addEventListener('message', e => {
        let message = e.data || e.originalEvent.data;
        if (message.event === 'stateChange' && message.value === 'hidden') {
          this._onPageUnload();
        }
      });
    }
  }
/**
   * Creates event handlers for all interactions that might require metrics to be fired.
   * @private
   * @returns {void}
   */
Creates event handlers for all interactions that might require metrics to be fired.
@private
@returns {void}
Creates event handlers for all interactions that might require metrics to be fired . @private @returns { void }
_setupEventHandlers() {
    Router.addEventListener('routechange', this._onRouteChange.bind(this));
    VideoMetrics.addEventListener(
      'videostarted',
      this._onVideoStarted.bind(this)
    );
    VideoMetrics.addEventListener(
      'videounregistered',
      this._onVideoUnregistered.bind(this)
    );
    VideoMetrics.addEventListener(
      'videoReportQuartile',
      this._onVideoReportQuartile.bind(this)
    );
    SharingManager.addEventListener(
      'shareclicked',
      this._onShareClicked.bind(this)
    );
    MicrozineEvents.addEventListener(
      'relateditemclicked',
      this._onRelatedItemClicked.bind(this)
    );
    MicrozineEvents.addEventListener(
      'shoppableitemclicked',
      this._onShoppableItemClicked.bind(this)
    );
    MicrozineEvents.addEventListener(
      'pageswipe',
      this._onPageSwiped.bind(this)
    );
    MicrozineEvents.addEventListener(
      'scrollended',
      this._onScrollEnded.bind(this)
    );
    MicrozineEvents.addEventListener(
      'microzineready',
      this._onMicrozineReady.bind(this)
    );
    document.addEventListener('click', this._onPageClicked.bind(this));
    document.addEventListener('beforeunload', this._onPageUnload.bind(this));
    window.addEventListener('pagehide', this._onPageUnload.bind(this));
    if (Properties.isFriendlyIframe) {
      document
        .getElementById('content')
        .addEventListener('scroll', this._onScroll.bind(this));
    } else {
      document.addEventListener('scroll', this._onScroll.bind(this));
    }
    if (Properties.isFriendlyIframe) {
      window.addEventListener('message', e => {
        let message = e.data || e.originalEvent.data;
        if (message.event === 'stateChange' && message.value === 'hidden') {
          this._onPageUnload();
        }
      });
    }
  }
_setupEventHandlers ( ) { Router . addEventListener ( 'routechange' , this . _onRouteChange . bind ( this ) ) ; VideoMetrics . addEventListener ( 'videostarted' , this . _onVideoStarted . bind ( this ) ) ; VideoMetrics . addEventListener ( 'videounregistered' , this . _onVideoUnregistered . bind ( this ) ) ; VideoMetrics . addEventListener ( 'videoReportQuartile' , this . _onVideoReportQuartile . bind ( this ) ) ; SharingManager . addEventListener ( 'shareclicked' , this . _onShareClicked . bind ( this ) ) ; MicrozineEvents . addEventListener ( 'relateditemclicked' , this . _onRelatedItemClicked . bind ( this ) ) ; MicrozineEvents . addEventListener ( 'shoppableitemclicked' , this . _onShoppableItemClicked . bind ( this ) ) ; MicrozineEvents . addEventListener ( 'pageswipe' , this . _onPageSwiped . bind ( this ) ) ; MicrozineEvents . addEventListener ( 'scrollended' , this . _onScrollEnded . bind ( this ) ) ; MicrozineEvents . addEventListener ( 'microzineready' , this . _onMicrozineReady . bind ( this ) ) ; document . addEventListener ( 'click' , this . _onPageClicked . bind ( this ) ) ; document . addEventListener ( 'beforeunload' , this . _onPageUnload . bind ( this ) ) ; window . addEventListener ( 'pagehide' , this . _onPageUnload . bind ( this ) ) ; if ( Properties . isFriendlyIframe ) { document . getElementById ( 'content' ) . addEventListener ( 'scroll' , this . _onScroll . bind ( this ) ) ; } else { document . addEventListener ( 'scroll' , this . _onScroll . bind ( this ) ) ; } if ( Properties . isFriendlyIframe ) { window . addEventListener ( 'message' , e => { let message = e . data || e . originalEvent . data ; if ( message . event === 'stateChange' && message . value === 'hidden' ) { this . _onPageUnload ( ) ; } } ) ; } }
Creates event handlers for all interactions that might require metrics to be fired.
Creates event handlers for all interactions that might require metrics to be fired .
// if (document.getElementById('brand_header')) { //   document.getElementById('brand_header').addEventListener('click', this._onHeaderClicked.bind(this)); // }