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

Custom SPA tracking #133

Open
mxrlkn opened this issue Sep 2, 2024 · 2 comments
Open

Custom SPA tracking #133

mxrlkn opened this issue Sep 2, 2024 · 2 comments
Labels
enhancement New feature or request tracker Related to tracker

Comments

@mxrlkn
Copy link

mxrlkn commented Sep 2, 2024

Be able to include the script, but turn off any automatic tracking and get a way to do it manually.
So I can do something like this:

<script defer src="https://HOST/script.js" notracking></script>
window.medama.track({
	url: "/example",
	event: {}
});
@ayuhito ayuhito added enhancement New feature or request tracker Related to tracker labels Sep 3, 2024
@ayuhito
Copy link
Member

ayuhito commented Sep 3, 2024

I'm not sure if attaching to window might be the best when dealing with ad-blockers.

Thoughts about an API like this instead?

<script defer src="https://HOST/script.js" manual></script>
<script>
  import * as medama from '@medama/browser';

  medama.track({...});
</script>

Related: #13

@mxrlkn
Copy link
Author

mxrlkn commented Sep 3, 2024

Yeah that's much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tracker Related to tracker
Projects
None yet
Development

No branches or pull requests

2 participants