All Projects → Swizec → web-session-counter

Swizec / web-session-counter

Licence: MIT license
Utility to count a user's web sessions based on the definition GA uses.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to web-session-counter

WaWebSessionHandler
(DISCONTINUED) Save WhatsApp Web Sessions as files and open them everywhere!
Stars: ✭ 27 (+22.73%)
Mutual labels:  localstorage, session
Redux React Session
🔑 Simple Session API storage for Redux and React
Stars: ✭ 140 (+536.36%)
Mutual labels:  localstorage, session
mst-persist
Persist and hydrate MobX-state-tree stores (in < 100 LoC)
Stars: ✭ 75 (+240.91%)
Mutual labels:  localstorage, session
ng2-storage
A local and session storage wrapper for angular 2.
Stars: ✭ 14 (-36.36%)
Mutual labels:  localstorage
reinvent-planner
Plan your AWS re:Invent 2019 sessions by visualizing it in a calendar.
Stars: ✭ 109 (+395.45%)
Mutual labels:  localstorage
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (+13.64%)
Mutual labels:  momentjs
elm-storage
Unified interface for accessing and modifying LocalStorage, SessionStorage and Cookies
Stars: ✭ 13 (-40.91%)
Mutual labels:  localstorage
react-google-calendar
A react-big-calendar implementation that pulls events from Google calendars
Stars: ✭ 82 (+272.73%)
Mutual labels:  momentjs
moment-recur-ts
Conversion of the moment-recur library into TypeScript.
Stars: ✭ 17 (-22.73%)
Mutual labels:  momentjs
h5webstorage
Web Storage for Angular 2
Stars: ✭ 38 (+72.73%)
Mutual labels:  localstorage
python-pytest-harvest
Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.
Stars: ✭ 44 (+100%)
Mutual labels:  session
egg-weapp-sdk
Egg的微信小程序登录会话管理SDK
Stars: ✭ 111 (+404.55%)
Mutual labels:  session
redux-tab-sync
open this twice and play around
Stars: ✭ 22 (+0%)
Mutual labels:  localstorage
storage
A library to use Web Storage API with Observables
Stars: ✭ 43 (+95.45%)
Mutual labels:  localstorage
relative.time.parser
Moment.js Plugin for parsing Relative Time Strings
Stars: ✭ 13 (-40.91%)
Mutual labels:  momentjs
PHP-Session
PHP library for handling sessions.
Stars: ✭ 54 (+145.45%)
Mutual labels:  session
app
Aplus Framework App Project
Stars: ✭ 338 (+1436.36%)
Mutual labels:  session
speechly expense tracker project
This is a code repository for the corresponding video tutorial
Stars: ✭ 285 (+1195.45%)
Mutual labels:  localstorage
kesho
store cache any data type string, boolean, jsonObject, jsonArray, .....
Stars: ✭ 19 (-13.64%)
Mutual labels:  localstorage
framework
Aplus Full-Stack Framework
Stars: ✭ 172 (+681.82%)
Mutual labels:  session

Web Session Counter

What do you do if your boss comes up to you and asks "So how many times must a person come to our app before they give us $500?"

As an engineer you might not care, but this is the stuff that keeps your CEO and growth lead and head of product up at night. A business owner that can answer that 👆 question reliably is god amongst men.

You can use this repo :)

How to use

$ npm install --save web-session-counter
import WebSessionCounter from 'web-session-counter';

// Do this on user activity
WebSessionCounter.update();

// To get the total count of sessions
const count = WebSessionCounter.count;

.update() is called automatically every time you import WebSessionCounter. I recommend calling .update(), if you have a single page app that doesn't perform a lot of refreshes. Calling .update frequently, ensures your code will correctly detect every 30 minute period of inactivity.

What is a session

We use the same definition as Google Analytics. The tl;dr is that a new session starts after every:

  • 30 minutes of inactivity
  • midnight
  • utm_campaign query change

Enjoy.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].