Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trackPageView doesn't update the url on client side navigation #4

Open
HighPriest opened this issue Mar 2, 2025 · 0 comments
Open

Comments

@HighPriest
Copy link

Hi.

In response to issue #3 , I am trying manual page view tracking, by placing

import { trackPageView } from '@lukulent/svelte-umami';

onMount(() => {
		trackPageView();
})

on individual pages.

Unfortunately, trackPageView does not update the URL after initial page load & keeps on sending the same URL on each & every page navigation. I know I could set the url from page.url, but I don't think this is something a user should come up with on his own & it should happen automagically.

e.g.

  1. user loads in through site.com/blog
    • Umami script sends site.com/blog
  2. user navigates to site.com/blog/post
    • Umami script sends site.com/blog
  3. user navigates to site.com/about
    • Umami script sends site.com/blog

e.g.

  1. user loads in through site.com/blog/post
    • Umami script sends site.com/blog/post
  2. user navigates to site.com/blog
    • Umami script sends site.com/blog/post
  3. user navigates to site.com/about
    • Umami script sends site.com/blog/post
  4. user navigates to site.com
    • Umami script sends site.com/blog/post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant