<commit_before>import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';
import { Provider } from 'mobx-react';
import { Helmet } from 'react-helmet';

import 'i18n.js';

import NavBar from 'components/NavBar/NavBar.jsx';

import Search from 'views/Search/Search.jsx';
import Favorites from 'views/Favorites/Favorites.jsx';
import Map from 'views/Map/Map.jsx';
import Settings from 'views/Settings/Settings.jsx';
import Stop from 'views/Stop/Stop.jsx';

import storeCoords from 'stores/coords.js';
import storeSearch from 'stores/search.js';
import storeFavorites from 'stores/favorites.js';
import storeSettings from 'stores/settings.js';

import './index.css';

const stores = {
	storeCoords,
	storeSearch,
	storeFavorites,
	storeSettings
};

render((
	<Provider {...stores}>
		<BrowserRouter>
			<>
				<Helmet>
					<title>Bussiaeg.ee: Kogu Eesti ühistranspordi väljumisajad ühest kohast.</title>
					<meta name="theme-color" content="#ffffff" />
					<meta property="og:type" content="website" />
					<meta property="og:title" content="Bussiaeg.ee: Kogu Eesti ühistranspordi väljumisajad ühest kohast." />
				</Helmet>
				<Map />
				{window.location.pathname === '/' && window.location.pathname !== '/' + storeSettings.data.view ? <Redirect to={'/' + storeSettings.data.view} /> : null}
				<Switch>
					<Redirect from="/map" to="/" />
					<Route path="/search" component={Search} />
					<Route path="/favorites" component={Favorites} />
					<Route path="/settings" component={Settings} />
					<Route path="/stop" component={Stop} />
				</Switch>
				<NavBar />
			</>
		</BrowserRouter>
	</Provider>
), document.getElementById('app'));

// Disable navigating through elements with tab key.
window.addEventListener('keydown', (e) => {
	if (e.which === 9) e.preventDefault();
});

// Send analytics about active page.
let lastPath = '';
setInterval(() => {
	
	const path = window.location.pathname + window.location.search;
	if (path === lastPath) return;
	lastPath = path;
	
	if (window.gtag) window.gtag('config', process.env['REACT_APP_GA'], {
		'page_path': path
	});
	
}, 2000);
<commit_msg>Add page title to GA reporting (web)<commit_after>import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';
import { Provider } from 'mobx-react';
import { Helmet } from 'react-helmet';

import 'i18n.js';

import NavBar from 'components/NavBar/NavBar.jsx';

import Search from 'views/Search/Search.jsx';
import Favorites from 'views/Favorites/Favorites.jsx';
import Map from 'views/Map/Map.jsx';
import Settings from 'views/Settings/Settings.jsx';
import Stop from 'views/Stop/Stop.jsx';

import storeCoords from 'stores/coords.js';
import storeSearch from 'stores/search.js';
import storeFavorites from 'stores/favorites.js';
import storeSettings from 'stores/settings.js';

import './index.css';

const stores = {
	storeCoords,
	storeSearch,
	storeFavorites,
	storeSettings
};

render((
	<Provider {...stores}>
		<BrowserRouter>
			<>
				<Helmet>
					<title>Bussiaeg.ee: Kogu Eesti ühistranspordi väljumisajad ühest kohast.</title>
					<meta name="theme-color" content="#ffffff" />
					<meta property="og:type" content="website" />
					<meta property="og:title" content="Bussiaeg.ee: Kogu Eesti ühistranspordi väljumisajad ühest kohast." />
				</Helmet>
				<Map />
				{window.location.pathname === '/' && window.location.pathname !== '/' + storeSettings.data.view ? <Redirect to={'/' + storeSettings.data.view} /> : null}
				<Switch>
					<Redirect from="/map" to="/" />
					<Route path="/search" component={Search} />
					<Route path="/favorites" component={Favorites} />
					<Route path="/settings" component={Settings} />
					<Route path="/stop" component={Stop} />
				</Switch>
				<NavBar />
			</>
		</BrowserRouter>
	</Provider>
), document.getElementById('app'));

// Disable navigating through elements with tab key.
window.addEventListener('keydown', (e) => {
	if (e.which === 9) e.preventDefault();
});

// Send analytics about active page.
let lastPath = '';
setInterval(() => {
	
	const path = window.location.pathname + window.location.search;
	if (path === lastPath) return;
	lastPath = path;
	
	if (window.gtag) window.gtag('config', process.env['REACT_APP_GA'], {
		'page_title': document.title,
		'page_path': path
	});
	
}, 2000);

{'fraction_non_alphanumeric': 0.16520171286905566, 'fraction_numerical': 0.0031552851025467656, 'mean_word_length': 4.148491879350348, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '717852', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1454, 'n_words': 344}