@usertimeline/astro

0.2.0 • Public • Published

@usertimeline/astro

After creating an account and adding the domain (or subdomain) you want to track, you need to add the script to your saas/website.

Create a Usertimeline account

Install

npm install @usertimeline/astro
# or
yarn add @usertimeline/astro
# or
pnpm add @usertimeline/astro

Usage

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.

Disable features

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>
  );
}

Authenticated users

You can track authenticated users on your saas/website in 3 ways:

Using the script

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>
  );
}

Package Sidebar

Install

npm i @usertimeline/astro

Weekly Downloads

12

Version

0.2.0

License

none

Unpacked Size

2.92 kB

Total Files

3

Last publish

Collaborators

  • etc-tiago