All Projects → thebarty → analytics-js-without-segment

thebarty / analytics-js-without-segment

Licence: other
A toolset to use Segments open-source analytics library (analytics.js) WITHOUT using the paid Segment service (segment.com). To be used with your favorite analytics-tools like Google Analytics, Mixpanel, Hotjar, etc.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to analytics-js-without-segment

auto-analytics
UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for JavaScript applications.
Stars: ✭ 28 (-40.43%)
Mutual labels:  segment, google-analytics, mixpanel
Trackie
A Chrome extension to enhance debugging of some frequently-used tag management platforms (Google Tag Manager, Tealium, Commanders Act, DTM) in combination with some frequently-used tags (Google Analytics, Google Analytics 4, GA Audiences, Ddm, Criteo, Adobe Analytics/Omniture, Floodlight, Comscore, Facebook, Bluekai, Youbora, Kinesis, Webtrekk, …
Stars: ✭ 23 (-51.06%)
Mutual labels:  segment, google-analytics
Analytics
UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for Meteor
Stars: ✭ 211 (+348.94%)
Mutual labels:  segment, google-analytics
Imaginary Teleprompter
Professional grade, free software, teleprompter app.
Stars: ✭ 157 (+234.04%)
Mutual labels:  standalone, free
analytics.js-integrations
Monorepo housing Segment's analytics.js integrations
Stars: ✭ 107 (+127.66%)
Mutual labels:  segment, analyticsjs
gatsby-plugin-gdpr-cookies
Gatsby plugin to add Google Analytics (V4 is supported), Google Tag Manager, Facebook Pixel, TikTok Pixel and Hotjar in a GDPR form to your site.
Stars: ✭ 88 (+87.23%)
Mutual labels:  google-analytics, hotjar
scripts
Open Source Public Scripts for Simple Analytics
Stars: ✭ 62 (+31.91%)
Mutual labels:  google-analytics, analyticsjs
klog
KLog is a multiplatform free hamradio logger. It runs natively on Linux, macOS and Windows.
Stars: ✭ 31 (-34.04%)
Mutual labels:  free
EscherConverter
A standalone program that reads files created with the graphical network editor Escher and converts them to files in community standard formats.
Stars: ✭ 14 (-70.21%)
Mutual labels:  standalone
startbootstrap-1-col-portfolio
A one column Bootstrap HTML portfolio template - created by Start Bootstrap
Stars: ✭ 60 (+27.66%)
Mutual labels:  free
small-sh
Um encurtador de URL's gratuito e Open source. Torne suas URL's um tanto pequenas forma rápida e gratuita
Stars: ✭ 30 (-36.17%)
Mutual labels:  free
Nebula
Nebula is a WordPress theme framework that focuses on enhancing development. The core features of Nebula make it a powerful tool for designing, developing, and analyzing WordPress websites consistently, yet its deliberately uncomplicated code syntax also serves as a learning resource for programmers themselves.
Stars: ✭ 120 (+155.32%)
Mutual labels:  google-analytics
simplecorp
SimpleCorp free Drupal theme
Stars: ✭ 24 (-48.94%)
Mutual labels:  free
WHMCS-Discord-Notifications
A hook to push a range of different WHMCS notifications instantly to a Discord channel.
Stars: ✭ 52 (+10.64%)
Mutual labels:  free
Axon
Unrestricted Lua Execution
Stars: ✭ 59 (+25.53%)
Mutual labels:  free
AzurLaneAPI
[Project dropped] was a free (Unofficial) Azur Lane API
Stars: ✭ 12 (-74.47%)
Mutual labels:  free
fa5pro-downloader
A tool that allows you to download Font Awesome 5 Pro for free
Stars: ✭ 34 (-27.66%)
Mutual labels:  free
thejsway
The JavaScript Way book
Stars: ✭ 7,660 (+16197.87%)
Mutual labels:  free
wikdict-gen
Generation of bilingual dictionaries from Wiktionary/dbnary data for the WikDict project
Stars: ✭ 32 (-31.91%)
Mutual labels:  free
zanime
Android app to watch anime vod online for free
Stars: ✭ 52 (+10.64%)
Mutual labels:  free

Use analytics.js without Segment (analytics-js-without-segment)

A tool to use (and render) Segments open-source analytics library (analytics.js) WITHOUT using the paid Segment service (segment.com). To be used with your favorite analytics-tools like Google Analytics, Mixpanel, Hotjar, etc.

@Gatsby-users: Use the related gatsby-package.

Features

  • Best-practise loading of analytics.js: This plugin loads Segments analytics.js following best-practises and enables you to easily set options (cdnUrl and services).
  • Unlimited and free: You'll use the free analytics.js and not depend on Segment (which has aggressive pay-or-leave policies, after you hit the 1000 free monthly users)
  • Track events anywhere: You can track custom-events anywhere in your code via analytics.track()
  • Supported integrations: A LOT of analytics-tools are supported. see https://github.com/segment-integrations.
  • Development-mode: In development you'll only see the events in the console. Your events will NOT be forwarded
  • Production-mode: All events will be routed to the services. Check your console for possible errors.

INSTALL

Install via npm

npm install analytics-js-without-segment --save

Usage

In your client, add:

const { renderAnalytics, runAnalytics } = require('analytics-js-without-segment')

const options = {
  cdnUrl: 'https://cdnjs.cloudflare.com/ajax/libs/analytics.js/2.9.1/analytics.min.js',  // host yourself or use cdnjs (https://cdnjs.com/libraries/analytics.js)
  services: {
    // see integration https://github.com/segment-integrations/analytics.js-integration-google-analytics/blob/master/lib/index.js
    'Google Analytics': {
      trackingId: 'UA-XXX-1',
      anonymizeIp: true,
    },
    // see integration https://github.com/segment-integrations/analytics.js-integration-mixpanel/blob/master/lib/index.js
    'Mixpanel': {
      token: 'XXX',
      people: true,
      trackAllPages: true,
    },
    // see integration https://github.com/segment-integrations/analytics.js-integration-fullstory/blob/master/lib/index.js
    'FullStory': {
      org: 'XXX',
      debug: true,
    },
    // ... other service? See supported integrations (that can be loaded via analytics.js) at https://github.com/segment-integrations.
  },
}

// OPTION 1)
// AUTOMATICALLY attach to window.analytics and make global `analytics.*`-object available
runAnalytics(options)  // after running this, `analytics` is globally available

// OPTION 2)
// MANUALLY attach to window.analytics and make global `analytics.*`-object available
const snippet = renderAnalytics(options)
eval(snippet)

Why this package?

The concept of analytics.js is awesome. BUT Segments's free tier (max 1.000 monthly users) might not work for you, if you have a lot of non-paying visitors on your website.

So if you want an easy-to-configure analytics.js-wrapper for your analytics (Google Analytics, Mixpanel, Hotjar, YouNameIt, ...), then this is your go-to! Basically ALL big analytics-integrations are supported.

This solution is open source, unlimited and free forever!

Background (state 2018-10-24): Segment.com has aggressive pay-or-leave policies, which they will apply after you hit the 1000 free monthly users limit. They will lock your account and stop processing your events after a deadline.

WHY using this?

Advantages:

  • You will NOT run out of segments free tier after hitting 1000 MPU (monthly users), because you simply do NOT use it
  • You'll have a single API for tracking analytics (p.e. analytics.page() or analytics.track())

Disadvantages:

  • This does NOT work on server-side
  • It might take a bit more time to configure than using segment
  • You do NOT any of segments other cool features (which you will not need when starting a side-project)

Question: What analytics-services are supported?

You should be able to use ALL services that segment itself supports and has integrations available. You'll have to dig around a bit in segment's code to find the options for each individual tool.

Check out the supported Integrations (that can be loaded via analytics.js) at https://github.com/segment-integrations.

Credits

This is project is based on https://gist.github.com/typpo/5e2e4403c60314e04e8b6b257555f6de and the related blogpost at http://www.ianww.com/blog/2017/08/06/analytics-js-standalone-library/.

Contribute (Development notes)

CLI cheatsheat:

npm run build-watch;  # auto-compile on file-change from /src to / via babel

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