Add tracker to React Router App
1. Include the UXWizz tracking snippet in your index.html file
You should now be able to use UST
in your application. If you use TypeScript, you can declare UST
as any. TypeScript typings for the tracker will be released soon.
2. Track pageviews
By default, being a SPA, only the entry pageview will be tracked.
To track all consequent pageviews, include a new UXWizzPageview.ts in your app
Then, in your main App component, include UXWizzPageview
.
UXWizz will automatically track the initial page-load (when the tracker file is loaded).
We added a check, to avoid tracking the initial page-load again.
If you don't use TypeScript, you can simply remove the typings replace this line:
with
Last updated