Refactor tracker.
This commit is contained in:
@@ -11,6 +11,12 @@ export default function Test() {
|
||||
return <h1>No id query specified.</h1>;
|
||||
}
|
||||
|
||||
function handleClick() {
|
||||
window.umami('Custom event');
|
||||
window.umami.pageView('/fake', 'https://www.google.com');
|
||||
window.umami.pageEvent('pageEvent', 'custom-type');
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -20,7 +26,7 @@ export default function Test() {
|
||||
</Head>
|
||||
<Layout>
|
||||
<p>
|
||||
Here you can test if your umami installation works. Open the network tab in your browser's
|
||||
Here you can test if your umami installation works. Open the network tab in your browser
|
||||
developer console and watch for requests to the url <b>collect</b>. The links below should
|
||||
trigger page views. Clicking on the button should trigger an event.
|
||||
</p>
|
||||
@@ -40,6 +46,10 @@ export default function Test() {
|
||||
>
|
||||
Button
|
||||
</button>
|
||||
<h2>Manual trigger</h2>
|
||||
<button id="manual-button" type="button" onClick={handleClick}>
|
||||
Button
|
||||
</button>
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user