summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/partials/analytics/seline.html
diff options
context:
space:
mode:
authorChristoph Cullmann <christoph@cullmann.io>2024-08-28 22:54:34 +0200
committerChristoph Cullmann <christoph@cullmann.io>2024-08-28 22:54:34 +0200
commit8f3d03b1888fed23e6aa07d6077045e673357481 (patch)
treea914b8f43b8486380ccc1c35721b28da2ff7986a /themes/blowfish/layouts/partials/analytics/seline.html
parent8db6bd0e555dca050d7d885582100c5ca5ba3aa2 (diff)
sync themeHEADmaster
Diffstat (limited to 'themes/blowfish/layouts/partials/analytics/seline.html')
-rw-r--r--themes/blowfish/layouts/partials/analytics/seline.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/themes/blowfish/layouts/partials/analytics/seline.html b/themes/blowfish/layouts/partials/analytics/seline.html
new file mode 100644
index 0000000..955d40a
--- /dev/null
+++ b/themes/blowfish/layouts/partials/analytics/seline.html
@@ -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.enableTrackEvent | default true }}
+<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 }}