Add analytics

pull/345/head
cagataycivici 2020-05-27 09:52:02 +03:00
parent 2fdc8c3465
commit 56d367cd59
2 changed files with 13 additions and 0 deletions

View File

@ -2,6 +2,12 @@
<html lang="en"> <html lang="en">
<head> <head>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-93461466-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
</script>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, viewport-fit=cover"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, viewport-fit=cover">

View File

@ -49,6 +49,13 @@ export default {
$route: { $route: {
immediate: true, immediate: true,
handler(to) { handler(to) {
let route = window.location.href.split('/#')[1];
if (to.path === route) {
window['gtag']('config', 'UA-93461466-1', {
'page_path': '/primevue' + to.path
});
}
this.sidebarActive = false; this.sidebarActive = false;
this.$toast.removeAllGroups(); this.$toast.removeAllGroups();
} }