Skip to content

Commit f23e2a5

Browse files
committed
Fix analytics for the extension (inline scripts are limited in
extensions).
1 parent ca4f291 commit f23e2a5

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/extension/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../google-analytics.js';
12
import {
23
setupTokenEditor,
34
setTokenEditorValue,

src/google-analytics.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//Google Analytics
2+
var _gaq = _gaq || [];
3+
_gaq.push(['_setAccount', 'UA-37952868-23']);
4+
_gaq.push(['_trackPageview']);
5+
6+
(function() {
7+
var ga = document.createElement('script');
8+
ga.type = 'text/javascript';
9+
ga.async = true;
10+
ga.src = 'https://ssl.google-analytics.com/ga.js';
11+
var s = document.getElementsByTagName('script')[0];
12+
s.parentNode.insertBefore(ga, s);
13+
})();

src/website/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../google-analytics.js';
12
import { setupNavbar } from './navbar.js';
23
import { setupExtensionButton } from './extension.js';
34
import { setupLibraries } from './libraries.js';

views/extension/layout.pug

+1-16
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,4 @@ html(lang='en')
55
include ../stylesheets.pug
66

77
body
8-
block content
9-
10-
script.
11-
//Google Analytics
12-
var _gaq = _gaq || [];
13-
_gaq.push(['_setAccount', 'UA-37952868-23']);
14-
_gaq.push(['_trackPageview']);
15-
16-
(function() {
17-
var ga = document.createElement('script');
18-
ga.type = 'text/javascript';
19-
ga.async = true;
20-
ga.src = 'https://ssl.google-analytics.com/ga.js';
21-
var s = document.getElementsByTagName('script')[0];
22-
s.parentNode.insertBefore(ga, s);
23-
})();
8+
block content

0 commit comments

Comments
 (0)