Skip to content

Umami makes it easy to collect, analyze, and understand your website data — so you can focus on growth

License

Notifications You must be signed in to change notification settings

Yakima-Teng/umami-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

umami-sdk

logo

Umami is a simple, fast, privacy-focused alternative to Google Analytics.

This is a browser client SDK for umami, writing in Typescript.

Before using

Before using this client sdk, please ensure that you have added your tracking code in your frontend project. It is something like this:

<html lang="en">
<head>
  <title>umami.js</title>
  <!-- ... -->
  <script async defer data-website-id="<your-website-id>" src="<https://your-website.com>/umami.js"></script>
  <!-- ... -->
</head>
<body>
<!-- ... -->
</body>
</html>

For more information, please refer to the official documentation.

How to use

First, install the package:

npm install -S umami-sdk

Then you can use it like this:

import { trackEvent } from 'umami-sdk'

// just report a custom event name
trackEvent('header-login-button')

// or together with some event data
trackEvent('header-login-button', { hello: 'world' })

License

MIT.

About

Umami makes it easy to collect, analyze, and understand your website data — so you can focus on growth

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published