Skip to content

Commit

Permalink
add tier identity
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Nov 14, 2024
1 parent 67e05a7 commit fa1b7b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/src/js/app/embed/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ const sha1 = require('sha1');
message.send('init');
const data = await message.receiveOnce('init');
if (window._umami) {
(await import('../../lib/umami')).init(window, window._umami, {
const umami = (await import('../../lib/umami')).init(window, window._umami, {
referrer: data.referer,
});
umami.identify({
tier: window._tier,
});
}
const c = await check();
if (c) {
Expand Down
1 change: 1 addition & 0 deletions templates/views/embed/get.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{{- if useUmami }}
window._umami = {{ umamiConfig | json }};
{{- end }}
window._tier = "{{ .Claims.Context.Tier.Name }}"
</script>
<style>
body {
Expand Down

0 comments on commit fa1b7b6

Please sign in to comment.