seline && umami enableTrackEvent

This commit is contained in:
Weaxs 2024-07-26 10:33:50 +08:00
parent bcc26c11b8
commit 91d24e626e
4 changed files with 10 additions and 6 deletions

View file

@ -135,10 +135,11 @@ disableTextInHeader = false
# websiteid = "ABC12345"
# domain = "llama.yoursite.com"
# dataDomains = "yoursite.com,yoursite2.com"
# enableTrackEvent = false
[selineAnalytics]
# token = "XXXXXX"
# enableTrace = false
# token = "XXXXXX"
# enableTrackEvent = false
[buymeacoffee]
# identifier = ""

View file

@ -134,10 +134,11 @@ smartTOCHideUnfocusedChildren = false
# websiteid = "ABC12345"
# domain = "llama.yoursite.com"
# dataDomains = "yoursite.com,yoursite2.com"
# enableTrackEvent = false
[selineAnalytics]
# token = "XXXXXX"
# enableTrace = false
# token = "XXXXXX"
# enableTrackEvent = false
[buymeacoffee]
identifier = "nunocoracao"

View file

@ -1,6 +1,6 @@
<script async src="https://cdn.seline.so/seline.js" data-token="{{ site.Params.selineAnalytics.token }}" data-id="seline-script"></script>
{{ if .Site.Params.selineAnalytics.enableTrace | default false }}
{{ if .Site.Params.selineAnalytics.enableTrackEvent | default false }}
<script type="text/javascript">
document.querySelector('script[data-id="seline-script"]')
.addEventListener('load', function () {

View file

@ -10,6 +10,7 @@
</script>
{{ end }}
{{ if .Site.Params.umamiAnalytics.enableTrackEvent | default false }}
<script type="text/javascript">
document.querySelector('script[data-id="umami-script"]')
.addEventListener('load', function () {
@ -18,4 +19,5 @@
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
umami.track(type + ':' + title, {'url': url});
});
</script>
</script>
{{ end }}