Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/tracking / dist / esm / src / services / googleAnalytics / helpers / getBasicAnalyticsData.js
Size: Mime:
import { getSystemType as getSystemType$1 } from './getSystemType.js';

const {
  NODE_ENV,
  DOODLE_ENV
} = process.env;
/**
 * Collect basic page and environment data for Google Analytics
 *
 * @param {TrackingIntent} trackingIntent
 * @param {string} trackingIntent.pageType
 * @return {undefined}
 */

const getBasicAnalyticsData = ({
  pageType
} = {}) => ({
  page: { ...(pageType && {
      pageType
    }),
    viewportHeight: window.innerHeight || 0,
    viewportWidth: window.innerWidth || 0
  },
  environment: {
    systemType: getSystemType$1({
      NODE_ENV,
      DOODLE_ENV
    })
  }
});

export { getBasicAnalyticsData };
//# sourceMappingURL=getBasicAnalyticsData.js.map