blowfish/layouts/partials/analytics/seline.html

19 lines
862 B
HTML
Raw Normal View History

2024-07-25 21:17:39 -05:00
<script async src="https://cdn.seline.so/seline.js" data-token="{{ site.Params.selineAnalytics.token }}" data-id="seline-script"></script>
2024-07-25 21:33:50 -05:00
{{ if .Site.Params.selineAnalytics.enableTrackEvent | default false }}
2024-07-25 21:17:39 -05:00
<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 }}