diff --git a/pages/_document.jsx b/pages/_document.jsx
index 09240b4c..d861542b 100644
--- a/pages/_document.jsx
+++ b/pages/_document.jsx
@@ -1,6 +1,7 @@
import React from 'react'
import Document, { Html, Head, Main, NextScript } from 'next/document'
import { YMetrika } from '../src/components/YMetrika'
+import { GAnalytics } from '../src/components/GAnalytics'
export default class MyDocument extends Document {
// static async getInitialProps(ctx) {
@@ -56,6 +57,7 @@ export default class MyDocument extends Document {
+
diff --git a/src/components/GAnalytics.jsx b/src/components/GAnalytics.jsx
new file mode 100644
index 00000000..adc939d7
--- /dev/null
+++ b/src/components/GAnalytics.jsx
@@ -0,0 +1,29 @@
+import React from 'react'
+
+function script(account) {
+ return `
+ if (window.location.host.indexOf('localhost') === -1) {
+ (function (window, document, script, src, ga, element, m) {
+ window['GoogleAnalyticsObject'] = ga;
+ if (!window[ga]) {
+ window[ga] = function () {
+ (window[ga].q = window[ga].q || []).push(arguments)
+ }
+ }
+ window[ga].l = 1 * new Date();
+ element = document.createElement(script);
+ m = document.getElementsByTagName(script)[0];
+ element.async = 1;
+ element.src = src;
+ m.parentNode.insertBefore(element, m)
+ })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
+
+ ga('create', '${account}', 'auto');
+ ga('send', 'pageview');
+ }
+ `
+}
+
+export const GAnalytics = (props) => (
+
+)