Skip to content

Commit e7191cc

Browse files
author
SPRINX0\prochazka
committed
download events
1 parent 01aa1d8 commit e7191cc

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

assets/js/app.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,23 @@ style.innerHTML =
7474
getOsClass("is-linux", "linux") +
7575
getOtherOsClass("is-other-os");
7676
document.getElementsByTagName("head")[0].appendChild(style);
77+
78+
function sendDownloadEventToGoatCounter(event) {
79+
if (!event) {
80+
return;
81+
}
82+
83+
window.goatcounter.count({
84+
path: event,
85+
title: "Download: " + event,
86+
event: true,
87+
});
88+
89+
window.goatcounter.count({
90+
path: "download-aggregate",
91+
title: "Download - aggregate",
92+
event: true,
93+
});
94+
}
95+
96+
window.sendDownloadEventToGoatCounter = sendDownloadEventToGoatCounter;

data/download.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,77 @@
44
- text: Installer
55
icon: fa fa-download
66
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest.exe
7+
event: download-windows-exe
78
- text: Portable ZIP
89
icon: fa fa-download
910
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-windows-latest.zip
11+
event: download-windows-zip
1012
- text: Portable ZIP
1113
icon: fa fa-download
1214
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-windows-latest-arm64.zip
1315
platform: arm64
16+
event: download-windows-zip-arm
1417
- text: Linux
1518
icon: fab fa-linux
1619
items:
1720
- text: AppImage
1821
icon: fa fa-download
1922
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest.AppImage
23+
event: download-linux-appimage
2024
- text: DEB
2125
icon: fa fa-download
2226
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest.deb
27+
event: download-linux-deb
2328
- text: Snap
2429
icon: fas fa-external-link-alt
2530
link: https://snapcraft.io/dbgate
31+
event: download-linux-snap
2632
- text: AppImage
2733
icon: fa fa-download
2834
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest-arm64.AppImage
2935
platform: arm64
36+
event: download-linux-appimage-arm
3037
# - text: AppImage
3138
# icon: fa fa-download
3239
# link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest-armv7l.AppImage
3340
# platform: armv7l
3441
- text: Flathub
3542
icon: fas fa-external-link-alt
3643
link: https://flathub.org/apps/org.dbgate.DbGate
44+
event: download-linux-flathub
3745
- text: MacOS
3846
icon: fab fa-apple
3947
items:
4048
- text: Installer
4149
icon: fa fa-download
4250
platform: Apple+Intel
4351
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest.dmg
52+
event: download-macos-combined
4453
- text: Installer
4554
icon: fa fa-download
4655
platform: Apple (arm64)
4756
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest-arm64.dmg
57+
event: download-macos-arm
4858
- text: Installer
4959
icon: fa fa-download
5060
platform: Intel (x86)
5161
link: https://github.com/dbgate/dbgate/releases/latest/download/dbgate-latest-x64.dmg
62+
event: download-macos-x86
5263
- text: Web
5364
icon: fas fa-globe
5465
items:
5566
- text: Docker
5667
icon: fab fa-docker
5768
link: https://hub.docker.com/r/dbgate/dbgate
69+
event: download-docker
5870
- text: NPM
5971
icon: fas fa-external-link-alt
6072
link: https://www.npmjs.com/package/dbgate-serve
73+
event: download-npm
6174
- text: Source code
6275
icon: fas fa-code
6376
items:
6477
- text: GitHub
6578
icon: fab fa-github
6679
link: https://github.com/dbgate/dbgate
80+
event: download-github

layouts/shortcodes/download.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2>Download DbGate Community</h2>
3333
<div class="columns is-multiline">
3434
{{ range .items }}
3535
<div class="column is-4">
36-
<a class="button is-medium is-primary is-fullwidth" href="{{ .link }}" onClick="{{ .onClick }}">
36+
<a class="button is-medium is-primary is-fullwidth" href="{{ .link }}" onClick="sendDownloadEventToGoatCounter('{{ .event }}')">
3737
<i class="{{ .icon }} mr-2"></i>
3838
{{ .text }}
3939
{{ if .platform }}

0 commit comments

Comments
 (0)