After creating an account and adding the domain (or subdomain) you want to track, you need to add the script to your saas/website.
npm install @usertimeline/astro
# or
yarn add @usertimeline/astro
# or
pnpm add @usertimeline/astro
Add the script to your saas/website.
import UsertimelineScript from '@usertimeline/astro';
export default function Layout() {
return (
<html lang="en">
<body>
{/* replace the YOUR_PROJECT_CODE_HERE with the project code */}
<UsertimelineScript project="YOUR_PROJECT_CODE_HERE" />
</body>
</html>
);
}
That's it! Now you can track users on your saas/website.
You can disable features like page view, click, or both.
import UsertimelineScript from '@usertimeline/astro';
export default function Layout() {
return (
<html lang="en">
<body>
{/* replace the YOUR_PROJECT_CODE_HERE with the project code */}
<UsertimelineScript
project="YOUR_PROJECT_CODE_HERE"
disableFeature="page_view,click"
/>
</body>
</html>
);
}
You can track authenticated users on your saas/website in 3 ways:
You can add one or more of the 3 additional parameters. Remember to replace the parameters with your data.
import UsertimelineScript from '@usertimeline/astro';
export default function Layout() {
return (
<html lang="en">
<body>
{/* replace the YOUR_PROJECT_CODE_HERE with the project code */}
<UsertimelineScript
project="YOUR_PROJECT_CODE_HERE"
externalid="{{YOUR_EXTERNAL_ID_HERE}}"
name="{{YOUR_NAME_HERE}}"
email="{{YOUR_EMAIL_HERE}}"
/>
</body>
</html>
);
}