@fabioespindola/tellme
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Tell me

Tell me is a very simple way to get to know more about your user behavior. Know every click in buttons, links or any HTML elements. Register the events and send to storage.

Installation

npm install @fabioespindola/tellme

Usage

import attachClick from '@fabioespindola/tellme'

const selectors = [ '.myClass1', '.myClass2', '#myId1', '#myId2', ... ]
const url = 'api endpoint'
const headers = {
    header1: value1,
    header2: value2
}

attachClick(selectors, url, headers)

You should add a aria-label to identify the element

<button id='#myId1' aria-label='My button'>My button</button>

Then you should receive in your backend something like this

{ 
    event: "click", 
    type: "button", 
    label: "My button",
    url: "element page url", 
    datetime: "2023-06-23 09:00:49" 
}

Package Sidebar

Install

npm i @fabioespindola/tellme

Weekly Downloads

4

Version

1.0.6

License

ISC

Unpacked Size

19 kB

Total Files

12

Last publish

Collaborators

  • fabioespindola