Add beta item logging

This commit is contained in:
Dominik Korsa 2019-03-03 13:45:02 +01:00
parent fa5e4eb419
commit 79421f71cf

View file

@ -1,18 +1,29 @@
<template> <template>
<div class="download-beta-item"> <div class="download-beta-item">
<div class="code"><a :href="github" target="_blank">{{ code }}</a></div> <div class="code"><a :href="github" target="_blank" @click="codeClick">{{ code }}</a></div>
<a <a
class="released" class="released"
:title="releasedString" :title="releasedString"
:href="`https://github.com/wulkanowy/wulkanowy/tree/${code}`" :href="`https://github.com/wulkanowy/wulkanowy/tree/${code}`"
target="_blank"> target="_blank"
@click="releasedClick">
{{ releasedRelativeString }} {{ releasedRelativeString }}
</a> </a>
<div class="buttons"> <div class="buttons">
<a class="github-button" :href="github" target="_blank" title="GitHub"> <a
class="github-button"
:href="github"
target="_blank"
title="GitHub"
@click="githubClick">
<span class="mdi mdi-github-circle"></span> <span class="mdi mdi-github-circle"></span>
</a> </a>
<a class="download-button" :href="download" target="_blank" title="Download"> <a
class="download-button"
:href="download"
target="_blank"
title="Download"
@click="downloadClick">
<span class="mdi mdi-download"></span> <span class="mdi mdi-download"></span>
</a> </a>
</div> </div>
@ -40,6 +51,36 @@ export default {
type: String, type: String,
}, },
}, },
methods: {
codeClick() {
this.$ga.event({
eventCategory: 'beta-item',
eventAction: 'code-click',
eventLabel: this.code,
});
},
releasedClick() {
this.$ga.event({
eventCategory: 'beta-item',
eventAction: 'released-click',
eventLabel: this.code,
});
},
githubClick() {
this.$ga.event({
eventCategory: 'beta-item',
eventAction: 'github-click',
eventLabel: this.code,
});
},
downloadClick() {
this.$ga.event({
eventCategory: 'beta-item',
eventAction: 'download-click',
eventLabel: this.code,
});
},
},
computed: { computed: {
releasedString() { releasedString() {
return moment(this.released).format('dddd, D MMM YYYY HH:mm:ss'); return moment(this.released).format('dddd, D MMM YYYY HH:mm:ss');