@rangoon/analytics
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

RTX Web Analytics SDK

This SDK is intended for collecting anonymous usage data for campaigns developed by rangoon.tech.

Installation

First, install the library by running the command

npm install @rangoon/analytics

If you're using yarn,

yarn add @rangoon/analytics

Usage

Initialize the SDK by calling the method Analytics.initialize.

import { Analytics } from '@rangoon/analytics';

Analytics.initialize({
  projectId: "<PROJECT_ID>",
});

That's it! The SDK will automatically collect usage information of the website's users.

If you want to collect custom events, you can do so with the function logEvent.

import { logEvent } from '@rangoon/analytics';

// initialize the SDK first
Analytics.initialize({
  projectId: "<PROJECT_ID>",
});

// custom event name with custom payload
logEvent('custom_event', { foo: 'bar' });

Before you log custom events, make sure analytics SDK is initialized first.

Package Sidebar

Install

npm i @rangoon/analytics

Weekly Downloads

1

Version

0.3.3

License

none

Unpacked Size

16.5 kB

Total Files

20

Last publish

Collaborators

  • yatootay
  • ksitkyaw
  • austin-waing