Repository URL to install this package:
|
Version:
1.0.1 ▾
|
@doodle/tracking
/
dist
/
esm
/
src
/
services
/
googleAnalytics
/
helpers
/
getBasicAnalyticsData.js
|
|---|
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