Add some simple GA activity tracking

This commit is contained in:
Matt Isenhower
2017-08-24 14:12:23 -07:00
parent aca5fa1023
commit c055ce04c1
4 changed files with 20 additions and 1 deletions

View File

@@ -1,5 +1,12 @@
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
if (GOOGLE_ANALYTICS_ID) {
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', GOOGLE_ANALYTICS_ID, 'auto');
ga('send', 'pageview');
}
export default {
event() {
ga('send', 'event', ...arguments);
},
}

View File

@@ -64,9 +64,13 @@
</style>
<script>
import analytics from '@/js/analytics';
import Modal from './Modal.vue';
export default {
components: { Modal },
mounted() {
analytics.event('About', 'Open');
},
}
</script>

View File

@@ -12,6 +12,7 @@
</template>
<script>
import analytics from '@/js/analytics';
import Modal from '@/js/components/Modal.vue';
import GameModeHeader from './GameModeHeader.vue';
import ScheduleList from './ScheduleList.vue';
@@ -19,5 +20,8 @@ import ScheduleList from './ScheduleList.vue';
export default {
components: { Modal, GameModeHeader, ScheduleList },
props: ['schedules', 'gameMode', 'cssClass', 'now'],
mounted() {
analytics.event('Schedule', 'Open', this.gameMode.name);
},
}
</script>

View File

@@ -18,11 +18,15 @@
</template>
<script>
import analytics from '@/js/analytics';
import Modal from '@/js/components/Modal.vue';
import MerchandiseBox from './MerchandiseBox.vue';
export default {
components: { Modal, MerchandiseBox },
props: ['merchandises', 'now'],
mounted() {
analytics.event('SplatNet Gear', 'Open');
},
}
</script>