6.8.0 • Published 1 month ago

@studyportals/datalake-event-tracker v6.8.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

Datalake Event Tracker

The datalake event tracker is a package which uses the JS-Tracker to track data to Redshift. The goal of this package is to have a uniform way of tracking events. The tracker enforces naming conventions that will make it possible to automate the creation of dashboards, procedures, and further analytics.

Table of Contents

Setup & commands

The following commands can be used to setup and run a local environment for developing the modal component. Also, we're using husky to run unit tests before a git push is done. This could be by-passed (if absolutely necessary) by running git push --no-verify.

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm start

# build for production with minification
npm run build

# run unit tests
npm run unit

Usages

The "datalake event tracker"(hereby further referred to as "tracker") needs to be constructed with a valid Product as argument. Valid options are available in @studyportals/datalake-event-tracker/src/enums/product .

After constructing a new instance of the datalake event tracker the tracker will collect the JS-Datatracker from the window. After collecting the JS-Datatracker the event 'DatalakeEventTrackerLoaded' is dispatched and window'DatalakeEventTrackerLoaded' = true; is set. This way you will be able to collect or wait for the tracker.

After initiating the tracker you will be able to track events by using the tracker.TrackStructuredEvents method:

import { Product, Action, Tracker } from "@studyportals/datalake-event-tracker";

const category = Product.BESTFIT_OVERVIEW;
const tracker = new Tracker(category);

const trackingData: object = {
	action: Action.CLICK,
	label: 'label_example',
	property: 'property_example',
	value: 420
}

tracker.trackStructuredEvent(trackingData);

Product & Action

The category(product) and action need to exist as an enum. This way we won't have conflicting names or variations. Additions to these enumerations might be done within this repository.

You can import the available product and action enumerations like so:

import { Product } from "@studyportals/datalake-event-tracker";
import { Action } from "@studyportals/datalake-event-tracker";

naming convention

The following naming convention will be enforced. An error will be thrown when an event is not valid according to the agreed upon convention. category(product): PascalCase action: snake_case label: snake_case property: snake_case value: decimal

how to name

The following rule-set can be applied to all the events to track:

  • Category: Define the product associated to the tracking
  • Action: Define the global action for this event. The action doesn't contain any specific information about the action itself. e.g. click, impressions, non_interactive, popup_open
  • Label: Define a label associated to the action e.g. If you track a 'click' event you should specify the target clicked as the label: 'button_x'. To specify more information, for example, the location of the button you use the '@' symbol: 'button_x@location_y'
  • Property: Define a detail which has context to the event. e.g. StudyId, PremiumLevel, Wishlisted
  • Value: Define a value associated to the event. e.g. Bestfit score, Search position, recommendation precision
6.8.0

1 month ago

6.8.0-beta.0

1 month ago

6.7.0

2 months ago

6.7.0-3

2 months ago

6.7.0-2

2 months ago

6.7.0-1

2 months ago

6.6.5

3 months ago

6.6.2-1

3 months ago

6.6.2-3

3 months ago

6.6.4

3 months ago

6.6.2

3 months ago

6.6.1

3 months ago

6.6.1-1

3 months ago

6.6.1-3

3 months ago

6.6.0

4 months ago

6.5.0

4 months ago

6.5.0-beta.1

4 months ago

6.5.0-beta.3

4 months ago

6.5.0-beta.2

4 months ago

6.5.0-beta.0

5 months ago

6.4.0

5 months ago

6.1.0

8 months ago

6.0.1-0

8 months ago

5.0.0

10 months ago

6.2.0

7 months ago

5.1.1-0

8 months ago

4.4.1-0

10 months ago

4.4.1-1

10 months ago

6.2.0-3

7 months ago

6.2.0-1

7 months ago

6.2.0-2

7 months ago

5.1.3

8 months ago

5.1.2

8 months ago

5.1.1

8 months ago

5.1.0

8 months ago

6.3.0

6 months ago

5.0.1-2

8 months ago

6.0.0

8 months ago

6.3.0-0

6 months ago

4.4.0

11 months ago

4.3.2-0

11 months ago

4.3.2-1

11 months ago

4.3.4-0

11 months ago

4.3.4-1

11 months ago

4.2.1-2

12 months ago

4.3.1-0

12 months ago

4.2.1-3

12 months ago

4.3.2

11 months ago

4.3.1

12 months ago

4.3.3

11 months ago

4.3.0

12 months ago

4.3.1-1

12 months ago

4.2.1-0

12 months ago

4.2.1-1

12 months ago

4.2.0

1 year ago

4.1.0

1 year ago

3.0.0

2 years ago

4.0.0

2 years ago

3.0.0-beta.3

2 years ago

3.0.0-beta.2

2 years ago

4.0.0-beta.1

2 years ago

4.0.0-beta.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.4

2 years ago

2.2.4-beta.1

2 years ago

2.2.0-beta.1

2 years ago

2.2.0-beta.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.2

2 years ago

2.1.3

2 years ago

2.2.0-5

2 years ago

2.2.0-4

2 years ago

2.2.0-3

2 years ago

3.0.0-beta.1

2 years ago

2.1.1-0

2 years ago

2.1.1-1

2 years ago

2.0.2

2 years ago

2.0.0-4

2 years ago

2.0.0-3

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.1.1

2 years ago

2.0.3-2

2 years ago

2.0.3-1

2 years ago

2.0.3-0

2 years ago

2.1.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.7-7

2 years ago

2.0.0-2

2 years ago

1.0.7-2

2 years ago

2.0.0-1

2 years ago

1.0.7-3

2 years ago

1.0.7-9

2 years ago

1.0.7-11

2 years ago

1.0.7-10

2 years ago

1.0.7-13

2 years ago

1.0.7-12

2 years ago

1.1.4-0

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.2-rc.14

3 years ago

0.0.2-rc.13

3 years ago

0.0.2-rc.12

3 years ago

0.0.2-rc.11

3 years ago

0.0.2-rc.8

3 years ago

0.0.2-rc.9

3 years ago

0.0.2-rc.6

3 years ago

0.0.2-rc.7

3 years ago

0.0.2-rc.10

3 years ago

0.0.2-rc.4

3 years ago

0.0.2-rc.5

3 years ago

0.0.2-rc.2

3 years ago

0.0.2-rc.3

3 years ago

0.0.2-rc.0

3 years ago

0.0.2-rc.1

3 years ago

0.0.1

3 years ago