Skip to content

Commit

Permalink
πŸ“ Update document
Browse files Browse the repository at this point in the history
  • Loading branch information
ldslds449 committed Apr 1, 2024
1 parent b058600 commit 35fe493
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions web/overrides/partials/integrations/analytics/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ config.extra.analytics.GA_id }}');
</script>
<!-- umami -->
<script defer
src="{{ config.extra.analytics.umami_host }}" data-website-id="{{ config.extra.analytics.umami_id }}">
src="{{ config.extra.analytics.umami_host }}"
data-website-id="{{ config.extra.analytics.umami_id }}"
data-auto-track="false">
</script>
<script>
/* Wait for page to load and application to mount */
document.addEventListener("DOMContentLoaded", function() {
location$.subscribe(function(url) {
const idx = url.lastIndexOf('/')
const real_url = url.substring(idx);
umami.track(props => ({ ...props, url: real_url }));
})
let path = window.location.pathname;
let real_path = path.replace("{{ config.site_url }}", "");
umami.track(props => ({ ...props, url: real_path }));
})
</script>

0 comments on commit 35fe493

Please sign in to comment.