mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
support seline analytics
This commit is contained in:
parent
18ed67b2e6
commit
bcc26c11b8
4 changed files with 29 additions and 0 deletions
|
@ -136,6 +136,10 @@ disableTextInHeader = false
|
||||||
# domain = "llama.yoursite.com"
|
# domain = "llama.yoursite.com"
|
||||||
# dataDomains = "yoursite.com,yoursite2.com"
|
# dataDomains = "yoursite.com,yoursite2.com"
|
||||||
|
|
||||||
|
[selineAnalytics]
|
||||||
|
# token = "XXXXXX"
|
||||||
|
# enableTrace = false
|
||||||
|
|
||||||
[buymeacoffee]
|
[buymeacoffee]
|
||||||
# identifier = ""
|
# identifier = ""
|
||||||
# globalWidget = true
|
# globalWidget = true
|
||||||
|
|
|
@ -135,6 +135,10 @@ smartTOCHideUnfocusedChildren = false
|
||||||
# domain = "llama.yoursite.com"
|
# domain = "llama.yoursite.com"
|
||||||
# dataDomains = "yoursite.com,yoursite2.com"
|
# dataDomains = "yoursite.com,yoursite2.com"
|
||||||
|
|
||||||
|
[selineAnalytics]
|
||||||
|
# token = "XXXXXX"
|
||||||
|
# enableTrace = false
|
||||||
|
|
||||||
[buymeacoffee]
|
[buymeacoffee]
|
||||||
identifier = "nunocoracao"
|
identifier = "nunocoracao"
|
||||||
globalWidget = true
|
globalWidget = true
|
||||||
|
|
|
@ -7,3 +7,6 @@
|
||||||
{{ with site.Params.umamiAnalytics.websiteid }}
|
{{ with site.Params.umamiAnalytics.websiteid }}
|
||||||
{{ partial "analytics/umami.html" }}
|
{{ partial "analytics/umami.html" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ with site.Params.selineAnalytics.token }}
|
||||||
|
{{ partial "analytics/seline.html" }}
|
||||||
|
{{ end }}
|
18
layouts/partials/analytics/seline.html
Normal file
18
layouts/partials/analytics/seline.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<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 }}
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.querySelector('script[data-id="seline-script"]')
|
||||||
|
.addEventListener('load', function () {
|
||||||
|
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
|
||||||
|
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
|
||||||
|
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
|
||||||
|
|
||||||
|
seline.track("user:" + type + ':' + title, {
|
||||||
|
type: type,
|
||||||
|
title: title,
|
||||||
|
url: url
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{{ end }}
|
Loading…
Reference in a new issue