Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #104 from jamesearl/feat/appinsights
Browse files Browse the repository at this point in the history
feat(DERP) add app insights
  • Loading branch information
allentong authored Jan 3, 2017
2 parents 7fc44db + 26ff8a1 commit 06479d3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
19 changes: 19 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
<link rel="stylesheet" href="/static/pe-icons/pe-icon-7-stroke.css"/>
<link rel="stylesheet" href="/static/pe-icons/helper.css"/>
<link rel="stylesheet" href="/static/stroke-icons/style.css"/>
<!--
To collect end-user usage analytics about your application,
insert the following script into each page you want to track.
Place this code immediately before the closing </head> tag,
and before any other scripts. Your first data will appear
automatically in just a few seconds.
-->
<script type="text/javascript">
/* eslint-disable */
var appInsights=window.appInsights||function(config){
function i(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s="AuthenticatedUserContext",h="start",c="stop",l="Track",a=l+"Event",v=l+"Page",y=u.createElement(o),r,f;y.src=config.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(y);try{t.cookie=u.cookie}catch(p){}for(t.queue=[],t.version="1.0",r=["Event","Exception","Metric","PageView","Trace","Dependency"];r.length;)i("track"+r.pop());return i("set"+s),i("clear"+s),i(h+a),i(c+a),i(h+v),i(c+v),i("flush"),config.disableExceptionTracking||(r="onerror",i("_"+r),f=e[r],e[r]=function(config,i,u,e,o){var s=f&&f(config,i,u,e,o);return s!==!0&&t["_"+r](config,i,u,e,o),s}),t
}({
instrumentationKey:"cbaf9617-1418-417b-a69f-2084f3ade0e3"
});

window.appInsights=appInsights;
appInsights.trackPageView();
/* eslint-enable */
</script>
</head>
<body>
<app></app>
Expand Down
21 changes: 21 additions & 0 deletions src/components/analytics/applicationInsights.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<!--
To collect end-user usage analytics about your application,
insert the following script into each page you want to track.
Place this code immediately before the closing </head> tag,
and before any other scripts. Your first data will appear
automatically in just a few seconds.
-->
<script type="text/javascript">
/* eslint-disable */
var appInsights=window.appInsights||function(config){
function i(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},u=document,e=window,o="script",s="AuthenticatedUserContext",h="start",c="stop",l="Track",a=l+"Event",v=l+"Page",y=u.createElement(o),r,f;y.src=config.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js";u.getElementsByTagName(o)[0].parentNode.appendChild(y);try{t.cookie=u.cookie}catch(p){}for(t.queue=[],t.version="1.0",r=["Event","Exception","Metric","PageView","Trace","Dependency"];r.length;)i("track"+r.pop());return i("set"+s),i("clear"+s),i(h+a),i(c+a),i(h+v),i(c+v),i("flush"),config.disableExceptionTracking||(r="onerror",i("_"+r),f=e[r],e[r]=function(config,i,u,e,o){var s=f&&f(config,i,u,e,o);return s!==!0&&t["_"+r](config,i,u,e,o),s}),t
}({
instrumentationKey:"cbaf9617-1418-417b-a69f-2084f3ade0e3"
});
window.appInsights=appInsights;
appInsights.trackPageView();
/* eslint-enable */
</script>
</template>
3 changes: 2 additions & 1 deletion src/components/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import Pace from 'pace-progress';
import 'bootstrap/less/bootstrap.less';
import 'toastr/toastr.less';
import 'font-awesome/css/font-awesome.css';
import store from '../stores/store';
import '../assets/stylesheets/style.less';
export default {
name: 'appView',
store,
components: {
},
mounted() {
Pace.start();
}
Expand Down

0 comments on commit 06479d3

Please sign in to comment.