Skip to content

NoRedInk/analytics.js

 
 

Repository files navigation

NoRedInk/analytics.js

This repo is a custom distribution of segmentio/analytics.js for use with NRI projects.

The following integrations (from segmentio/analytics.js-integration) are included:

  • google-analytics-4
  • customerio
  • mixpanel
  • optimizely
  • pardot

About this repo

Why is this repo needed?

Analytics.js 2 requires using segment's SAAS offering, and the official build of the legacy analytics.js for standalone use is no longer updated and does not include GA4. This repo is a fork of analytics.js that includes the community-supported GA4 integration.

Building

This repo uses nix and direnv to provide build tooling.

direnv allow

npm install

npm run build

Adding an integration

Install the integration via gitpkg:

npm install 'https://gitpkg.now.sh/segmentio/analytics.js-integrations/integrations/<my-integration>?2d65a8eb942c8ff45f29dad908a063b36d7648eb'

Add your new integration to lib/index.js:

const integrations = [
  require("@segment/analytics.js-integration-<my-integration>"),
];

Build the custom distribution:

npm run build

A note about gitpkg

Available integrations are in the segmentio/analytics.js-integrations monorepo.

Neither the monorepo nor the individual integrations are published to npm; for this reason gitpkg is used to install integrations via npm so that we don't have to muck with git submodules or install the entire integrations repo via npm.

Updating the monolith


For more information and usage, please see the upstream documentation.

About

The hassle-free way to integrate analytics into any web application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.5%
  • Nix 1.5%