* fixes

* make monaco workers available in static folder

* fixes

* fixes

* fix(worker): monaco workers path

* chore(ga): added google analytics
This commit is contained in:
Ritesh Kumar authored and GitHub committed 2019-07-19 13:17:52 +05:30
1 parent eb68108b67
commit 8f28ba28ec
1 file changed
+11 -8
+11 -8
View File
@@ -8,15 +8,19 @@ interface DocumentProps {
}
function trackingScript() {
window["dataLayer"] = window["dataLayer"] || [];
// @ts-ignore
if (window.dataLayer) return;
// @ts-ignore
window.dataLayer = window.dataLayer || [];
function gtag() {
window["dataLayer"].push(arguments);
// @ts-ignore
window.dataLayer.push(arguments);
}
// @ts-ignore
gtag("js", new Date());
// @ts-ignore
gtag("config", "UA-60624235-5");
gtag("config", "UA-60624235-8");
}
export default class MyDocument extends Document<DocumentProps> {
@@ -31,10 +35,6 @@ export default class MyDocument extends Document<DocumentProps> {
};
}
componentDidMount(): void {
trackingScript();
}
render() {
const { css, hydrationScript } = this.props;
@@ -56,8 +56,11 @@ export default class MyDocument extends Document<DocumentProps> {
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-60624235-5"
src="https://www.googletagmanager.com/gtag/js?id=UA-60624235-8"
/>
<script>
<>{IN_BROWSER && trackingScript()}</>
</script>
</body>
</html>
);