summaryrefslogtreecommitdiff
path: root/public/views/shared/ga.ejs
diff options
context:
space:
mode:
authorWu Cheng-Han2017-01-21 13:08:29 +0800
committerWu Cheng-Han2017-01-21 13:08:29 +0800
commit09a7bcbdef237c1443bbbfc29010e7106cffd739 (patch)
tree12e28f44dc82ae8f4d48dc8072a480f7312e47a3 /public/views/shared/ga.ejs
parent6e8ff3de234471375836ba907e86bf39804c308e (diff)
Refactor templates and rearrange its path
Diffstat (limited to 'public/views/shared/ga.ejs')
-rw-r--r--public/views/shared/ga.ejs18
1 files changed, 18 insertions, 0 deletions
diff --git a/public/views/shared/ga.ejs b/public/views/shared/ga.ejs
new file mode 100644
index 00000000..66d4acd9
--- /dev/null
+++ b/public/views/shared/ga.ejs
@@ -0,0 +1,18 @@
+<% if(typeof GA !== 'undefined' && GA) { %>
+<script>
+(function (i, s, o, g, r, a, m) {
+ i['GoogleAnalyticsObject'] = r;
+ i[r] = i[r] || function () {
+ (i[r].q = i[r].q || []).push(arguments)
+ }, i[r].l = 1 * new Date();
+ a = s.createElement(o),
+ m = s.getElementsByTagName(o)[0];
+ a.async = 1;
+ a.src = g;
+ m.parentNode.insertBefore(a, m)
+})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
+
+ga('create', '<%= GA %>', 'auto');
+ga('send', 'pageview');
+</script>
+<% } %> \ No newline at end of file