2020-07-14 16:52:26 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import Datepicker from './datepicker'
|
2020-08-13 13:45:18 +03:00
|
|
|
import SiteSwitcher from './site-switcher'
|
2020-07-14 16:52:26 +03:00
|
|
|
import Filters from './filters'
|
|
|
|
import CurrentVisitors from './stats/current-visitors'
|
|
|
|
import VisitorGraph from './stats/visitor-graph'
|
2020-08-17 15:13:30 +03:00
|
|
|
import Sources from './stats/sources'
|
Adds entry and exit pages to Top Pages module (#712)
* Initial Pass
* Adds support for page visits counting by referrer
* Includes goal selection in entry and exit computation
* Adds goal-based entry and exit page stats, formatting, code cleanup
* Changelog
* Format
* Exit rate, visit duration, updated tests
* I keep forgetting to format :/
* Tests, last time
* Fixes double counting, exit rate >100%, relevant tests
* Fixes exit pages on filter and goal states
* Adds entry and exit filters, fixes various bugs
* Fixes discussed issues
* Format
* Fixes impossible case in tests
Originally, there were only 2 pageviews for `test-site.com`,`/` on `2019-01-01`, but that doesn't make sense when there were 3 sessions that exited on the same site/date.
* Format
* Removes boolean function parameter in favor of separate function
* Adds support for queries that use `page` filter as `entry-page`
* Format
* Makes loader/title interaction in sources report consistent
2021-02-26 12:02:37 +03:00
|
|
|
import Pages from './stats/pages/'
|
2020-07-14 16:52:26 +03:00
|
|
|
import Countries from './stats/countries'
|
|
|
|
import Devices from './stats/devices'
|
|
|
|
import Conversions from './stats/conversions'
|
2020-12-22 16:39:14 +03:00
|
|
|
import { withPinnedHeader } from './pinned-header-hoc';
|
2020-07-14 16:52:26 +03:00
|
|
|
|
2020-12-22 16:39:14 +03:00
|
|
|
class Realtime extends React.Component {
|
2020-07-14 16:52:26 +03:00
|
|
|
renderConversions() {
|
|
|
|
if (this.props.site.hasGoals) {
|
|
|
|
return (
|
|
|
|
<div className="w-full block md:flex items-start justify-between mt-6">
|
|
|
|
<Conversions site={this.props.site} query={this.props.query} title="Goal Conversions (last 30 min)" />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="mb-12">
|
2020-12-22 16:39:14 +03:00
|
|
|
<div id="stats-container-top"></div>
|
2020-12-29 12:00:41 +03:00
|
|
|
<div className={`sticky top-0 bg-gray-50 dark:bg-gray-850 sm:py-3 py-1 z-9 ${this.props.stuck ? 'z-10 fullwidth-shadow' : ''}`}>
|
2020-12-22 16:39:14 +03:00
|
|
|
<div className="w-full sm:flex justify-between items-center">
|
2020-12-29 12:00:41 +03:00
|
|
|
<div className="w-full flex items-center mb-2 sm:mb-0">
|
2020-12-22 16:39:14 +03:00
|
|
|
<SiteSwitcher site={this.props.site} loggedIn={this.props.loggedIn} />
|
2020-12-29 12:00:41 +03:00
|
|
|
<Filters query={this.props.query} history={this.props.history} />
|
2020-12-22 16:39:14 +03:00
|
|
|
</div>
|
|
|
|
<Datepicker site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<VisitorGraph site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
<div className="w-full block md:flex items-start justify-between">
|
2020-08-17 15:13:30 +03:00
|
|
|
<Sources site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
2020-07-14 16:52:26 +03:00
|
|
|
<Pages site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
</div>
|
|
|
|
<div className="w-full block md:flex items-start justify-between">
|
|
|
|
<Countries site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
<Devices site={this.props.site} query={this.props.query} timer={this.props.timer} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{ this.renderConversions() }
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2020-12-22 16:39:14 +03:00
|
|
|
|
|
|
|
export default withPinnedHeader(Realtime, 'realtime');
|