diff --git a/website/pages/en/404.js b/website/pages/en/404.js new file mode 100644 index 0000000000..96b01f2c36 --- /dev/null +++ b/website/pages/en/404.js @@ -0,0 +1,42 @@ +const React = require("react"); +const siteConfig = require(`${process.cwd()}/siteConfig.js`); + +class ErrorPage extends React.Component { + getTrackingScript() { + if (!siteConfig.gaTrackingId) { + return null; + } + + return {__html:` + ga('create', "${siteConfig.gaTrackingId}"); + ga('send', { + hitType: 'event', + eventCategory: '404 Response', + eventAction: window.location.href, + eventLabel: document.referrer + });` + } + } + + render() { + const trackingScript = this.getTrackingScript(); + + return ( +
+ {trackingScript &&