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

View File

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

View File

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

View File

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