ga: Add a download event to Google Analytics
This commit is contained in:
parent
0a453cfed9
commit
590ea16137
3 changed files with 113 additions and 113 deletions
33
src/components/DownloadButton.vue
Normal file
33
src/components/DownloadButton.vue
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<template>
|
||||||
|
<v-tooltip top>
|
||||||
|
<template v-slot:activator="{ on }">
|
||||||
|
<v-btn
|
||||||
|
v-on="on"
|
||||||
|
class="mx-2"
|
||||||
|
dark
|
||||||
|
:color="`ryu_${color}`"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
:loading="loading"
|
||||||
|
:href="href"
|
||||||
|
@click.once="click"
|
||||||
|
>
|
||||||
|
<v-icon class="mx-5">fab fa-{{ platform }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<span>{{ version }}</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
platform: String,
|
||||||
|
color: String,
|
||||||
|
loading: Boolean,
|
||||||
|
href: String,
|
||||||
|
version: String,
|
||||||
|
click: Function
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -3,6 +3,7 @@ import 'vuetify/dist/vuetify.min.css'
|
||||||
import '~/external/fontawesome/css/fontawesome-all.css'
|
import '~/external/fontawesome/css/fontawesome-all.css'
|
||||||
import DefaultLayout from '~/layouts/Default.vue'
|
import DefaultLayout from '~/layouts/Default.vue'
|
||||||
import SEO from '~/components/SEO.vue'
|
import SEO from '~/components/SEO.vue'
|
||||||
|
import DownloadButton from '~/components/DownloadButton.vue'
|
||||||
|
|
||||||
export default function (Vue, { appOptions, head }) {
|
export default function (Vue, { appOptions, head }) {
|
||||||
// First inject custom CSS needed
|
// First inject custom CSS needed
|
||||||
|
@ -55,4 +56,7 @@ export default function (Vue, { appOptions, head }) {
|
||||||
|
|
||||||
// Set the SEO component
|
// Set the SEO component
|
||||||
Vue.component('SEO', SEO)
|
Vue.component('SEO', SEO)
|
||||||
|
|
||||||
|
// Generic Components
|
||||||
|
Vue.component('DownloadButton', DownloadButton)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,58 +19,36 @@
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="12" md="6">
|
<v-col cols="12" md="6">
|
||||||
<p class="mt-4 title">Automatically compiled builds</p>
|
<p class="mt-4 title">Automatically compiled builds</p>
|
||||||
<v-tooltip top>
|
|
||||||
<template v-slot:activator="{ on }">
|
<DownloadButton
|
||||||
<v-btn
|
color="orange"
|
||||||
v-on="on"
|
platform="windows"
|
||||||
class="mx-2"
|
:version="version"
|
||||||
dark
|
:href="`${downloadURL}-win_x64.zip`"
|
||||||
color="ryu_orange"
|
:click="trackDownload"
|
||||||
target="_blank"
|
:loading="isLoading"
|
||||||
rel="noopener"
|
/>
|
||||||
:loading="isLoading"
|
|
||||||
:href="`${downloadURL}-win_x64.zip`"
|
<DownloadButton
|
||||||
>
|
color="orange"
|
||||||
<v-icon class="mx-5">fab fa-windows</v-icon>
|
platform="linux"
|
||||||
</v-btn>
|
:version="version"
|
||||||
</template>
|
:href="`${downloadURL}-linux_x64.tar.gz`"
|
||||||
<span>{{ version }}</span>
|
:click="trackDownload"
|
||||||
</v-tooltip>
|
:loading="isLoading"
|
||||||
<v-tooltip top>
|
/>
|
||||||
<template v-slot:activator="{ on }">
|
|
||||||
<v-btn
|
<DownloadButton
|
||||||
v-on="on"
|
color="orange"
|
||||||
class="mx-2"
|
platform="apple"
|
||||||
dark
|
:version="version"
|
||||||
color="ryu_orange"
|
:href="`${downloadURL}-osx_x64.zip`"
|
||||||
target="_blank"
|
:click="trackDownload"
|
||||||
rel="noopener"
|
:loading="isLoading"
|
||||||
:loading="isLoading"
|
/>
|
||||||
:href="`${downloadURL}-linux_x64.tar.gz`"
|
|
||||||
>
|
|
||||||
<v-icon class="mx-5">fab fa-linux</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<span>{{ version }}</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<v-tooltip top>
|
|
||||||
<template v-slot:activator="{ on }">
|
|
||||||
<v-btn
|
|
||||||
v-on="on"
|
|
||||||
class="mx-2"
|
|
||||||
dark
|
|
||||||
color="ryu_orange"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
:loading="isLoading"
|
|
||||||
:href="`${downloadURL}-osx_x64.zip`"
|
|
||||||
>
|
|
||||||
<v-icon class="mx-5">fab fa-apple</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<span>{{ version }}</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<v-btn
|
<v-btn
|
||||||
text
|
text
|
||||||
class="my-2"
|
class="my-2"
|
||||||
|
@ -83,6 +61,7 @@
|
||||||
src="https://ci.appveyor.com/api/projects/status/ssg4jwu6ve3k594s?svg=true"
|
src="https://ci.appveyor.com/api/projects/status/ssg4jwu6ve3k594s?svg=true"
|
||||||
/>
|
/>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<p class="mt-4 title">
|
<p class="mt-4 title">
|
||||||
Profiled builds
|
Profiled builds
|
||||||
<br />
|
<br />
|
||||||
|
@ -90,69 +69,45 @@
|
||||||
class="caption"
|
class="caption"
|
||||||
>(If you're not a developer, these builds aren't for you.)</span>
|
>(If you're not a developer, these builds aren't for you.)</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<div v-if="showProfiledBuilds">
|
<div v-if="showProfiledBuilds">
|
||||||
<v-tooltip top>
|
<DownloadButton
|
||||||
<template v-slot:activator="{ on }">
|
color="blue"
|
||||||
<v-btn
|
platform="windows"
|
||||||
v-on="on"
|
:version="version"
|
||||||
class="mx-2"
|
:href="`${downloadURL_profiled}-win_x64.zip`"
|
||||||
dark
|
:click="trackDownload"
|
||||||
color="ryu_blue"
|
:loading="isLoading"
|
||||||
target="_blank"
|
/>
|
||||||
rel="noopener"
|
|
||||||
:loading="isLoading"
|
<DownloadButton
|
||||||
:href="`${downloadURL_profiled}-win_x64.zip`"
|
color="blue"
|
||||||
>
|
platform="linux"
|
||||||
<v-icon class="mx-5">fab fa-windows</v-icon>
|
:version="version"
|
||||||
</v-btn>
|
:href="`${downloadURL_profiled}-linux_x64.tar.gz`"
|
||||||
</template>
|
:click="trackDownload"
|
||||||
<span>{{ this.version }}</span>
|
:loading="isLoading"
|
||||||
</v-tooltip>
|
/>
|
||||||
<v-tooltip top>
|
|
||||||
<template v-slot:activator="{ on }">
|
<DownloadButton
|
||||||
<v-btn
|
color="blue"
|
||||||
v-on="on"
|
platform="apple"
|
||||||
class="mx-2"
|
:version="version"
|
||||||
dark
|
:href="`${downloadURL_profiled}-osx_x64.zip`"
|
||||||
color="ryu_blue"
|
:click="trackDownload"
|
||||||
target="_blank"
|
:loading="isLoading"
|
||||||
rel="noopener"
|
/>
|
||||||
:loading="isLoading"
|
</div>
|
||||||
:href="`${downloadURL_profiled}-linux_x64.tar.gz`"
|
<div v-else>
|
||||||
>
|
<v-btn
|
||||||
<v-icon class="mx-5">fab fa-linux</v-icon>
|
dark
|
||||||
</v-btn>
|
color="ryu_orange"
|
||||||
</template>
|
target="_blank"
|
||||||
<span>{{ this.version }}</span>
|
rel="noopener"
|
||||||
</v-tooltip>
|
@click.stop="showProfiledBuilds = true"
|
||||||
<v-tooltip top>
|
>I know what I'm doing</v-btn>
|
||||||
<template v-slot:activator="{ on }">
|
</div>
|
||||||
<v-btn
|
|
||||||
v-on="on"
|
|
||||||
class="mx-2"
|
|
||||||
dark
|
|
||||||
color="ryu_blue"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
:loading="isLoading"
|
|
||||||
:href="`${downloadURL_profiled}-osx_x64.zip`"
|
|
||||||
>
|
|
||||||
<v-icon class="mx-5">fab fa-apple</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<span>{{ this.version }}</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<v-btn
|
|
||||||
dark
|
|
||||||
color="ryu_orange"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
@click.stop="showProfiledBuilds = true"
|
|
||||||
>I know what I'm doing</v-btn>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -208,6 +163,14 @@ export default {
|
||||||
this.downloadURL_profiled = `https://ci.appveyor.com/api/buildjobs/${jobIdProfiled}/artifacts/ryujinx-profiled-${this.version}`;
|
this.downloadURL_profiled = `https://ci.appveyor.com/api/buildjobs/${jobIdProfiled}/artifacts/ryujinx-profiled-${this.version}`;
|
||||||
|
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
trackDownload() {
|
||||||
|
this.$ga.event({
|
||||||
|
eventCategory: 'release',
|
||||||
|
eventAction: 'download',
|
||||||
|
eventLabel: this.version
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue