1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Add google analytics

This commit is contained in:
vrde 2015-07-15 01:45:03 +02:00
parent e1af4c615f
commit 9e7e9782d6
2 changed files with 14 additions and 1 deletions

View File

@ -41,6 +41,16 @@
<body>
<div id="main"></div>
<!-- Google Analytics tracking code -->
<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', 'UA-60614729-2', 'auto');
</script>
<!-- Intercom library -->
<script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;

View File

@ -52,7 +52,10 @@ class AppGateway {
}
load(type) {
Router.run(getRoutes(type), Router.HistoryLocation, (App) => {
Router.run(getRoutes(type), Router.HistoryLocation, (App, state) => {
if (window.ga) {
window.ga('send', 'pageview');
}
React.render(
<App />,
document.getElementById('main')