All Projects → okgrow → auto-analytics

okgrow / auto-analytics

Licence: MIT license
UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for JavaScript applications.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to auto-analytics

analytics-js-without-segment
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.
Stars: ✭ 47 (+67.86%)
Mutual labels:  segment, google-analytics, mixpanel
Analytics
UNMAINTAINED! - Complete Google Analytics, Mixpanel, KISSmetrics (and more) integration for Meteor
Stars: ✭ 211 (+653.57%)
Mutual labels:  segment, meteor, google-analytics
Meteor Iron Router Ga
Google analytics for Iron Router
Stars: ✭ 76 (+171.43%)
Mutual labels:  meteor, google-analytics
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 (-17.86%)
Mutual labels:  segment, google-analytics
braintree-meteor-example
A simple Meteor and Braintree drop-in integration
Stars: ✭ 25 (-10.71%)
Mutual labels:  meteor
React-Hue
🎨 A Material color palette tool based on Meteor, React, Material UI.
Stars: ✭ 45 (+60.71%)
Mutual labels:  meteor
node-on-fhir
Tech stack for building MACRA and 21st Century Cures compliant webapps.
Stars: ✭ 75 (+167.86%)
Mutual labels:  meteor
Block-Farm
A farming game built upon Ethereum platform.
Stars: ✭ 60 (+114.29%)
Mutual labels:  meteor
hypersubs
an upgraded version of Meteor subscribe, which helps optimize data and performance!
Stars: ✭ 13 (-53.57%)
Mutual labels:  meteor
meteor-devtools-evolved
The Meteor framework development tool belt, evolved.
Stars: ✭ 146 (+421.43%)
Mutual labels:  meteor
redoc
redoc - generate documentation from multiple project repos.
Stars: ✭ 21 (-25%)
Mutual labels:  meteor
grapher-vue
Integrates Vue with Grapher in an easy-to-use way
Stars: ✭ 19 (-32.14%)
Mutual labels:  meteor
KPSmartTabBar
A fully customisable and flexible tab bar controller
Stars: ✭ 37 (+32.14%)
Mutual labels:  segment
meteor-autoform-bs-datetimepicker
Custom bootstrap-datetimepicker input type with timezone support for AutoForm
Stars: ✭ 18 (-35.71%)
Mutual labels:  meteor
meteor-video-chat
Simple id based video calling in meteor
Stars: ✭ 33 (+17.86%)
Mutual labels:  meteor
vue-seo-friendly-spa-template
Vue.js PWA/SPA template initially scaffolded with vue-cli and configured for SEO. Makes use of prerendering and other techniques/packages in order to achieve a perfect "Lighthouse Score".
Stars: ✭ 41 (+46.43%)
Mutual labels:  google-analytics
Meteor-Tutorials
Meteor官方教程(中文翻译)
Stars: ✭ 44 (+57.14%)
Mutual labels:  meteor
mixpanel-react-native
Official React Native Tracking Library for Mixpanel Analytics
Stars: ✭ 69 (+146.43%)
Mutual labels:  mixpanel
android-aop-analytics
Demo application that implements Google Analytics tracking in an aspect-oriented way using AspectJ.
Stars: ✭ 31 (+10.71%)
Mutual labels:  google-analytics
Meteor-logger-mongo
🍃 Meteor Logging: Store application log messages in MongoDB
Stars: ✭ 20 (-28.57%)
Mutual labels:  meteor

Auto Analytics

Automated page tracking (+ more!) with any Analytics service of your choice! 🔥

Use one API, thanks to Segment.io's analytics.js, to easily and automatically record and send data from your JavaScript application to your analytics platforms.

NOTE: The @okgrow/auto-analytics package replaces the now deprecated okgrow-auto-analytics package.

NOTE: This pkg is no longer being actively maintained, if you'd like to maintain this pkg please express interest by opening an issue.

Table of Contents

Background

Auto Analytics 2.0+

With version 2.X we are removing the embedded Segment analytics.js module. With version 2.0.0 and beyond you will need to build your own Segment analytics.js module manually.

NOTE: We have not added the package Segment analytics.js as an explicit dependency because some developers will prefer to add only individual integrations or create a customized analytics.js module in order to keep the weight of the package to a minimum.

Auto Analytics 1.0+

With the first version of this package we basically extracted code from our more Meteor-specific Atmosphere package to create a more generally usable package for the whole JavaScript community.

Quick Start

npm install --save @okgrow/auto-analytics
import { initAnalytics } from '@okgrow/auto-analytics';
// NOTE: You must build your own analytics.js, see Creating Segment's analytics.js for details.
import analytics from './your-custom-build/analytics.min.js';

// Add your analytics integrations and their tracking ids + config options here.
const settings = {
  analytics,
  integrations: {
    'Google Analytics': { 'trackingId': 'Your tracking ID' },
    'Mixpanel': { 'token': '...', 'people': true },
  },
  options: {
    // Segment options to be passed to initialize() from analytics.js-core
  },
  autorun: true, // Defaults to true if not provided.
};

initAnalytics(settings);

Creating Segment's analytics.js

If you wish to keep using the same analytics.min.js bundle (file size: 244kb) from v1.0.6 you can find it here. To reduce bundle size or to add Analytic integrations previously not supported then follow the below process.

Recommended process

  1. Clone this example repo down git clone https://github.com/okgrow/analytics.js.git
  2. cd analytics.js
  3. npm install && npm run build
  4. The build will output these two files: analytics.js and analytics.min.js

Too reduce the final bundle size, remove any integrations that you are not using. To do that:

  1. Open up the lib/integrations.js file and remove all the integrations that you will not use.
  2. Now re-run npm run build
  3. Your analytics.js and analytics.min.js will only contain the integrations you are using.
  4. Copy the analytics.min.js file to your project so that @okgrow/auto-analytics can use it.

Not Recommended: Use Segment's example analytics.js Package

Segment's analytics.js package offers a large number of integrations with various analytics providers. Installing their example package will give you all of their supported integrations(very large bundle size):

npm install --save analytics.js

However it is recommend that you build your own analytics.js with only the integrations you need. You can see all possible analytics.js-integrations here.

Integrations Config

The service names and API key-names provided in the integrations section are specific to each platform. Make sure to use the correct service name and key shown for the platform you're adding.

There are other options which are not documented in the example above. To find them search for your specific integration in this file and look at the options and their defaults that are set with .option(...).

Package Usage

Page views

Compatible with any router, this package will log page views automatically. Each page is logged with the follow parameters:

  • path: path part of the URL
  • title: the page's title
  • url: hostname + path
  • search: the URL's query string, if provided. blank otherwise
  • referrer: hostname + old path, if coming from a previous route

To disable automatic page view tracking add autorun: false to your settings object when configuring then manually log a page view by calling analytics.page('page name'):

Event tracking

Track any event by simply calling the analytics.track() function:

analytics.track("Bought Ticket", {
  eventName: "Wine Tasting",
  couponValue: 50,
});

Check Segment.io's analytics.js track documentation for a full description of track() and all the other functions available in this package.

Debugging

When adding your platforms and setting events to track you may want to keep debug on locally. This will log all the analytics package's activity to the console.

To turn on debugging, in the console:

> analytics.debug()

Turn debugging off, in the console:

> analytics.debug(false)

Ad-blocker

If you, or your users, are running an ad blocker in their browser and the analytics package is not bundled into a single JavaScript file to the browser (i.e., downloads as analytics.js or something similar) the browser's ad blocker may prevent analytics tracking. This can happen during development mode when all JavaScript files are typically not bundled together.

To solve this problem with a Meteor application, for example, you can run the application in production mode like this:

meteor run --production --settings settings.json

NOTE: If an Ad-blocker is enabled the expected behaviour is that your analytic events will not be received. You will see an error message in your console reporting the events being blocked.

Example React Router Application

This package includes an examples directory containing a simple (Meteor) application using react-router with a analytics.min.js containing only the Google Analytics and Mixpanel integrations. This is just an example with a common router and doesn't imply this plugin only works with this router or only with Meteor. This application can be run from its directory with:

meteor --settings settings.json --production.

Maintainers

This is an open source package. We hope to deal with contributions in a timely manner, but that's not always the case. The main maintainers are:

@okgrow

Feel free to ping if there are open issues or pull requests which are taking a while to be dealt with!

Contributing

Issues and Pull Requests are always welcome.

Please read our contribution guidelines.

If you are interested in becoming a maintainer, get in touch with us by sending an email or opening an issue. You should already have code merged into the project. Active contributors are encouraged to get in touch.

Please note that all interactions in @okgrow's repos should follow our Code of Conduct.

License

Released under the MIT license © 2017 OK GROW!.

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