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 Historical extends React.Component {
|
2020-07-14 16:52:26 +03:00
|
|
|
renderConversions() {
|
|
|
|
if (this.props.site.hasGoals) {
|
|
|
|
return (
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full mt-6 md:flex">
|
2020-07-14 16:52:26 +03:00
|
|
|
<Conversions site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2021-03-10 15:41:17 +03:00
|
|
|
const extraStyle = this.props.site.background ? {backgroundColor: this.props.site.background} : {}
|
2020-07-14 16:52:26 +03:00
|
|
|
return (
|
|
|
|
<div className="mb-12">
|
2020-12-22 16:39:14 +03:00
|
|
|
<div id="stats-container-top"></div>
|
2021-03-10 15:41:17 +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' : ''}`} style={extraStyle}>
|
|
|
|
<div className="items-center w-full sm:flex">
|
|
|
|
<div className="flex items-center w-full 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
|
|
|
<CurrentVisitors timer={this.props.timer} site={this.props.site} query={this.props.query} />
|
|
|
|
<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} />
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
2020-08-17 15:13:30 +03:00
|
|
|
<Sources site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
<Pages site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
2021-03-10 15:41:17 +03:00
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
2020-07-14 16:52:26 +03:00
|
|
|
<Countries site={this.props.site} query={this.props.query} />
|
|
|
|
<Devices site={this.props.site} query={this.props.query} />
|
|
|
|
</div>
|
|
|
|
{ this.renderConversions() }
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2020-12-22 16:39:14 +03:00
|
|
|
|
|
|
|
export default withPinnedHeader(Historical, 'historical');
|