Skip to content

Commit

Permalink
feat(project): add yandex metrics and drift live chat
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderrudnik committed Jan 10, 2019
1 parent c116c7f commit 0c63447
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 10 deletions.
26 changes: 17 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,73 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Vuestic Admin</title>

<% if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_YANDEX_METRICS_KEY) { %>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
/* eslint-disable */
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w['yaCounter' + '<%= process.env.VUE_APP_YANDEX_METRICS_KEY %>'] = new Ya.Metrika2({
id: '<%= process.env.VUE_APP_YANDEX_METRICS_KEY %>',
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true,
trackHash:true
});
} catch(e) { }
});

var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/tag.js";

if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks2");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/<%= process.env.VUE_APP_YANDEX_METRICS_KEY %>" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<% } %>

</head>
<body>

<% if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_DRIFT_KEY) { %>
<script>
/* eslint-disable */
!function() {
var t;
if (t = window.driftt = window.drift = window.driftt || [], !t.init) return t.invoked ? void (window.console && console.error && console.error("Drift snippet included twice.")) : (t.invoked = !0,
t.methods = [ "identify", "config", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on" ],
t.factory = function(e) {
return function() {
var n;
return n = Array.prototype.slice.call(arguments), n.unshift(e), t.push(n), t;
};
}, t.methods.forEach(function(e) {
t[e] = t.factory(e);
}), t.load = function(t) {
var e, n, o, i;
e = 3e5, i = Math.ceil(new Date() / e) * e, o = document.createElement("script"),
o.type = "text/javascript", o.async = !0, o.crossorigin = "anonymous", o.src = "https://js.driftt.com/include/" + i + "/" + t + ".js",
n = document.getElementsByTagName("script")[0], n.parentNode.insertBefore(o, n);
});
}();
drift.config({
welcomeMessageDelay: 30000
});
drift.SNIPPET_VERSION = '0.3.1';
drift.load('<%= process.env.VUE_APP_DRIFT_KEY %>');
</script>
<% } %>

<div id="app"></div>
<!-- built files will be auto injected -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<script>
export default {
name: 'app',
name: 'app'
}
</script>

Expand Down

0 comments on commit 0c63447

Please sign in to comment.