Update GA event names (#143)

* Update GA event names

* Make DownloadButtons.vue modular

* Attempting custom dimension and metrics

* Change forks dimension to static

* Fix wrong tag for Metrics

* Add secondary dimension instead of metric

* Send both dimensions in one call

* Please let this be the fix

* The actual fix

Apparently custom dimensions didn't work for the intended use here.

* Switch label to tag
This commit is contained in:
Soitora 2020-04-28 05:00:49 +02:00 committed by GitHub
parent b0b69bf3dd
commit bb315726ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 44 deletions

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="downloadContainer"> <div class="downloadContainer">
<button class="downloadStableButton" @click="downloadStable"> <button class="downloadStableButton" @click="downloadStable">
Stable {{ downloadStableLabel }}
</button> </button>
<button class="downloadPreviewButton" @click="downloadPreview"> <button class="downloadPreviewButton" @click="downloadPreview">
Preview {{ downloadPreviewLabel }}
</button> </button>
</div> </div>
</template> </template>
@ -15,11 +15,39 @@ import axios from "axios";
const RELEASE_URL = const RELEASE_URL =
"https://api.github.com/repos/inorichi/tachiyomi/releases/latest"; "https://api.github.com/repos/inorichi/tachiyomi/releases/latest";
const PREVIEW_URL =
"https://tachiyomi.kanade.eu/latest";
export default { export default {
props: {
downloadStableTag: {
type: String,
required: true
},
downloadPreviewTag: {
type: String,
required: true
},
downloadStableLabel: {
type: String,
default: "Stable"
},
downloadPreviewLabel: {
type: String,
default: "Preview"
},
downloadStableUrl: {
type: String
},
downloadPreviewUrl: {
type: String
}
},
data() { data() {
return { return {
tagName: "", tagName: "",
browserDownloadUrl: "" browserDownloadUrl: "",
}; };
}, },
@ -36,7 +64,7 @@ export default {
downloadStable() { downloadStable() {
this.$swal({ this.$swal({
title: "Downloading", title: "Downloading",
text: "Stable version is being downloaded.", text: this.downloadStableLabel + " version is being downloaded.",
icon: "success", icon: "success",
focusConfirm: false, focusConfirm: false,
focusCancel: false, focusCancel: false,
@ -54,20 +82,14 @@ export default {
} }
}); });
window.location.assign( window.location.assign(
this.$data.browserDownloadUrl || RELEASE_URL this.$props.downloadStableUrl || this.$data.browserDownloadUrl || RELEASE_URL
);
window.ga(
"send",
"event",
"Button",
"Click",
"Stable download - Getting Started"
); );
window.ga("send", "event", "Action", "Download", this.downloadStableTag);
}, },
downloadPreview() { downloadPreview() {
this.$swal({ this.$swal({
title: "Downloading", title: "Downloading",
text: "Preview version is being downloaded.", text: this.downloadPreviewLabel + " version is being downloaded.",
icon: "success", icon: "success",
focusConfirm: false, focusConfirm: false,
focusCancel: false, focusCancel: false,
@ -84,14 +106,10 @@ export default {
popup: "animated zoomOut faster" popup: "animated zoomOut faster"
} }
}); });
window.location.assign("https://tachiyomi.kanade.eu/latest"); window.location.assign(
window.ga( this.$props.downloadPreviewUrl || PREVIEW_URL
"send",
"event",
"Button",
"Click",
"Dev download - Getting Started"
); );
window.ga("send", "event", "Action", "Download", this.downloadPreviewTag);
} }
} }
}; };

View File

@ -75,13 +75,7 @@ export default {
window.location.assign( window.location.assign(
this.$data.browserDownloadUrl || this.$props.downloadLink this.$data.browserDownloadUrl || this.$props.downloadLink
); );
window.ga( window.ga("send", "event", "Action", "Download", this.$props.forkName);
"send",
"event",
"Button",
"Click",
this.$props.forkName + " download - Forks"
);
} }
} }
}; };

View File

@ -55,6 +55,9 @@ import axios from "axios";
const RELEASE_URL = const RELEASE_URL =
"https://api.github.com/repos/inorichi/tachiyomi/releases/latest"; "https://api.github.com/repos/inorichi/tachiyomi/releases/latest";
const PREVIEW_URL =
"https://tachiyomi.kanade.eu/latest";
export default { export default {
components: { NavLink }, components: { NavLink },
@ -130,16 +133,9 @@ export default {
} }
}); });
window.location.assign( window.location.assign(
this.$data.browserDownloadUrl || this.$data.browserDownloadUrl || RELEASE_URL
"https://github.com/inorichi/tachiyomi/releases/latest"
);
window.ga(
"send",
"event",
"Button",
"Click",
"Stable download"
); );
window.ga("send", "event", "Action", "Download", "Tachiyomi");
} else if (result.dismiss === "cancel") { } else if (result.dismiss === "cancel") {
this.$swal({ this.$swal({
title: "Downloading", title: "Downloading",
@ -160,14 +156,10 @@ export default {
popup: "animated zoomOut faster" popup: "animated zoomOut faster"
} }
}); });
window.location.assign("https://tachiyomi.kanade.eu/latest"); window.location.assign(
window.ga( PREVIEW_URL
"send",
"event",
"Button",
"Click",
"Dev download"
); );
window.ga("send", "event", "Action", "Download", "Tachiyomi Preview");
} }
}); });
} }

View File

@ -7,7 +7,7 @@ lang: en-US
## Installation ## Installation
<DownloadButtons/> <DownloadButtons downloadStableTag="Tachiyomi" downloadPreviewTag="Tachiyomi Preview"/>
You can download the latest version of **Tachiyomi** from any of the above buttons. You can download the latest version of **Tachiyomi** from any of the above buttons.