Skip to content

Commit

Permalink
Fix analytics for the extension (inline scripts are limited in
Browse files Browse the repository at this point in the history
extensions).
  • Loading branch information
sebadoom committed Apr 26, 2018
1 parent ca4f291 commit f23e2a5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/extension/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../google-analytics.js';
import {
setupTokenEditor,
setTokenEditorValue,
Expand Down
13 changes: 13 additions & 0 deletions src/google-analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-37952868-23']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
1 change: 1 addition & 0 deletions src/website/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../google-analytics.js';
import { setupNavbar } from './navbar.js';
import { setupExtensionButton } from './extension.js';
import { setupLibraries } from './libraries.js';
Expand Down
17 changes: 1 addition & 16 deletions views/extension/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,4 @@ html(lang='en')
include ../stylesheets.pug

body
block content

script.
//Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-37952868-23']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
block content

0 comments on commit f23e2a5

Please sign in to comment.