All Projects β†’ JonnyBurger β†’ tics

JonnyBurger / tics

Licence: other
🎒 Simple self-hosted analytics ideal for Express / React Native stacks

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tics

Analytics
Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
Stars: ✭ 9,469 (+42940.91%)
Mutual labels:  statistics, analytics
Interactive machine learning
IPython widgets, interactive plots, interactive machine learning
Stars: ✭ 140 (+536.36%)
Mutual labels:  statistics, analytics
Promcord
πŸ“Š Analyze your entire discord guild in grafana using prometheus. Message, User, Game and Voice statistics...
Stars: ✭ 39 (+77.27%)
Mutual labels:  statistics, analytics
Analytics.usa.gov
The US federal government's web traffic.
Stars: ✭ 564 (+2463.64%)
Mutual labels:  statistics, analytics
Data Science Live Book
An open source book to learn data science, data analysis and machine learning, suitable for all ages!
Stars: ✭ 193 (+777.27%)
Mutual labels:  statistics, analytics
Umami
Umami is a simple, fast, website analytics alternative to Google Analytics.
Stars: ✭ 9,228 (+41845.45%)
Mutual labels:  statistics, analytics
Github Traffic
Get the Github traffic for the specified repository
Stars: ✭ 77 (+250%)
Mutual labels:  statistics, analytics
Vudash
Powerful, Flexible, Open Source dashboards for anything
Stars: ✭ 363 (+1550%)
Mutual labels:  statistics, analytics
Sparkliner
Sparkliner β€” easy way to make sparkline graph [Sketch plugin]
Stars: ✭ 184 (+736.36%)
Mutual labels:  statistics, analytics
Stats
A well tested and comprehensive Golang statistics library package with no dependencies.
Stars: ✭ 2,196 (+9881.82%)
Mutual labels:  statistics, analytics
Tautulli
A Python based monitoring and tracking tool for Plex Media Server.
Stars: ✭ 4,152 (+18772.73%)
Mutual labels:  statistics, analytics
mongodb-info
MongoDB Info - command line tool to get stats.
Stars: ✭ 13 (-40.91%)
Mutual labels:  mongo, statistics
Stats Maths With Python
General statistics, mathematical programming, and numerical/scientific computing scripts and notebooks in Python
Stars: ✭ 381 (+1631.82%)
Mutual labels:  statistics, analytics
Homer
HOMER - 100% Open-Source SIP / VoIP Packet Capture & Monitoring
Stars: ✭ 855 (+3786.36%)
Mutual labels:  statistics, analytics
Ranalytics18
My work on Analytics and Research in Data Science
Stars: ✭ 378 (+1618.18%)
Mutual labels:  statistics, analytics
Data Science Best Resources
Carefully curated resource links for data science in one place
Stars: ✭ 1,104 (+4918.18%)
Mutual labels:  statistics, analytics
Ig Monitoring
🚨 DISCONTINUED🚨 IGMonitoring - Free, self hosted Instagram Analytics and Stats
Stars: ✭ 283 (+1186.36%)
Mutual labels:  statistics, analytics
Plan
Player Analytics plugin for Minecraft Server platforms (Bukkit/Sponge/Nukkit/BungeeCord/Velocity) - View player activity of your server with ease. πŸ“†
Stars: ✭ 322 (+1363.64%)
Mutual labels:  statistics, analytics
Design Of Experiment Python
Design-of-experiment (DOE) generator for science, engineering, and statistics
Stars: ✭ 143 (+550%)
Mutual labels:  statistics, analytics
Laravel Analytics
A Laravel package to retrieve pageviews and other data from Google Analytics
Stars: ✭ 2,613 (+11777.27%)
Mutual labels:  statistics, analytics

🎒 tics

Simple self-hosted analytics ideal for Express / React Native stacks

πŸš₯ Install

On both your frontend and backend, install the tics library.

npm i tics

πŸ€ΉπŸΌβ€ How it works

You mount an Express.js Router, accept requests to your server and save impressions in your database. tics also provides a frontend library to send impressions.

πŸŽ› Usage

Backend

const app = require('express');
const tics = require('tics/server');
const db = require('./mongo');

const {impressions, analytics, stats} = tics({
    db: db.collection('impressions')
});

// Use endpoints to receive impressions and retrieve stats
app.use('/telemetry', impressions);
app.use('/analytics', mustBeAdmin, analytics);

// Or use built-in functions to get stats
await stats.activeUsers.daily() // => 29

tics() takes a MongoDB database collection as an argument. Collections from mongodb and then-mongo drivers have been tested.

tics() returns an object with 3 items:

  • impressions is an Express.js router that the frontend can call to collect telemetry data.
  • analytics is an Express.js router that exposes a JSON API with analytics data. You should add some middleware to protect this router with some sort of authentication.
  • stats is an object containing the following methods:
    • stats.dau() returns daily active users
    • stats.wau() returns weekly active users
    • stats.mau() returns monthly active users
    • stats.userCount(filter) counts users. You can add a mongo query to only count a subset of impressions.
    • stats.platforms() returns a breakdown of the different platforms. Example response: [{id: 'ios', count: 1000, id: 'android', count: 2000}]
    • stats.languages() returns a breakdown of the languages of the users devices. Example response: [{id: 'de', count: 1000, id: 'en', count: 2000}]
    • stats.versions() returns a breakdown of the different versions of the app. Example response: [{id: '1.0.0', count: 200}, {id: '1.0.1', count: 400}, {id: '1.1.0', count: 4000}]
    • stats.contents() returns a breakdown of the different contents that the analytics are tracking.
    • stats.breakDown() allows to break down a custom field similar to the breakdowns above
    • stats.activityLevels focus on breaking down the different interactions of one content.
      • stats.activityLevels.byContentType returns a breakdown of the impressions of the different contents. Example: [{id: 'register-screen', count: 1000}, {id: 'article-page', count: '100'}]
      • stats.activityLevels.byContentId(content_id) returns the breakdown of the different interactions with one entity of a content. Example reponse: [{id: 'view', count: 20000, {id: 'click', count: 1000}, {id: 'conversion': 20}}],
    • stats.db provides raw access to make queries yourself

Track from React Native / Expo / Web

import tics from 'tics';

const analytics = tics({endpoint: 'https://jonny.io/api/telemetry'});

tics.impression('https://jonny.io/api/telemetry', {
    content: 'ad',
    content_id: '3240978',
    level: 'view',
    platform: 'ios',
    identifier: '098324',
    language: 'de',
    version: '1.0.0'
})
.then(() => { /* ... */})

Pass as the endpoint parameter the URL where the impressions router is mounted. This is the host of your server plus the route of the impression router.

Returned is an object which contains:

  • impression: Makes an impression request to the server. Terminology:
    • impression.content: Type of content. For example register-screen, ad, product,
    • impression.content_id optional: Allows to distinguish between different entities of the same content type.
    • impression.level: Type of interaction. For example view/ click/ conversion for sales. Or install / register for tracking registration conversion. Default: view
    • impression.platform optional: Operating system of the device. React native client will try to figure it out itself if this option is omitted.
    • impression.identifier optional: Identifying string of the user. Multiple impressions by the same user get removed when calculating number of users. React native client will try to use native identifier when omitted.
    • impression.language optional: Language of user's device
    • impression.version optional: App version number. React Native client will try to find it when this parameter is omitted.

Track sessions

Track sessions using React hooks. Pass a value for isFocused and it will automatically stop tracking if the user navigates away in React Native.

import {useTics} from 'tics';
import {useIsFocused} from '@react-navigation/native';

export const Comp = () => {
    const isFocused = useIsFocused();
    useTics(isFocused, 'https://jonny.io/api/telemetry', {
        content: 'ad',
        content_id: '3240978',
        level: 'view',
        platform: 'ios',
        identifier: '098324',
        language: 'de',
        version: '1.0.0'
    })
    return null;
}

πŸ‘¨πŸ»β€πŸ’» Author

πŸ—’ License

MIT

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].