# ui-tracking

> Contains code related to user analytics and tracking

Latest version **0.0.0** (published 2017-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ui-tracking
pnpm add ui-tracking
yarn add ui-tracking
bun add ui-tracking
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2017-02-23 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gilt Groupe |
| Maintainers | gilt-tech |

## Links

- npm: https://www.npmjs.com/package/ui-tracking
- Repository: https://github.com/gilt/ui-tracking
- Homepage: https://github.com/gilt/ui-tracking#readme
- Issues: https://github.com/gilt/ui-tracking/issues
- npm.io page: https://npm.io/package/ui-tracking

## Recent versions

- 0.0.0 (latest) — 2017-02-23

## README

# ui-tracking [![Build Status](https://travis-ci.com/gilt/ui-tracking.svg?token=mXNqsMSpj7G7HWN7buQc&branch=master)](https://travis-ci.com/gilt/ui-tracking)

The ui-tracking repo contains code related to user analytics and tracking with any
number of third-party tracking vendors. It is responsible for:

  - Collecting shared tracking-related information
  - Holding APIs for modules and apps that provide tracking methods
  - Managing third-party tracking code

This code contained within this repository is not meant to be used directly by
the public. Rather, it exists as an open repository to further our open source
initiatives and to share our patterns and practices around user analytics and
behavior tracking.

## Requirements

This repository requires Node 7.3.0 and NPM 4.1.1 or higher. The tooling will
assert the minimum NPM version required.

## Tooling

Tooling is provided by [bosun](https://github.com/gilt-labs/bosun).

For a list of commands, run `gulp help`.

To specify a module to perform a task for, use the `--src` flag. eg.
`--src vendor/waypoints`.

## Contributing

### Publishing Modules

All modules should be published using `npm publish`. No other commands are
necessary. Tests and other tasks will be run as part of the
[prepublish script](https://iamakulov.com/notes/all/npm-4-prepublish/).

Gilt Data Team are the gatekeepers of the repo and primary reviewers. Pull
Requests shouldn't be merged until a member of Data has had a chance to review.

Publishing should be done from the root directory, but should work as long as
the proper path is specified. eg. `npm publish src/vendor/waypoints`.

### Tests

All modules within this repo are required to have assertions to validate their
exports.

All `tracking.*` modules are required to have, at the minimum, tests to
validate their exports, as well as validate all event names being sent through
Gumshoe.

All tests should be authored with [mocha](http://mochajs.org/) and [chai](http://chaijs.com/).

Spies are provided through [chai-spies](http://chaijs.com/plugins/chai-spies/).
Please reference [the github README](https://github.com/chaijs/chai-spies) for
chai-spies, as the plugin page has fallen behind the current state of the project.

### Module Version Metadata

Modules are no longer required to have `$$PACKAGE_VERSION$$` declared in source.
The bosun publish lifecycle will inject a metadata module to the end of each
file in a module's `js` directory, prior to publish.

### Vendor Modules

Vendor modules (vendor.\*) in this repo make use of npm `prepublish`
scripts to automatically wrap the vendor code in `gilt.define`. Vendor code is
stored in a `lib` directory within a module. Output will be rendered to the `js`
directory for a given module directory.

## Module Versions

To query the version of any module published from this repository *within a browser*,
simply require

## Owner

Code ownership is shared; the point of a separate repo is so that people
who are not front-end engineers can review code easily and see changes when
they are made.

## Rationale

The reason for this repo is that managing tracking through pubsub, as we have
done for several years, is not coupled tightly enough to prevent errors from
occurring, and when errors occur, they are painful. Also, it does not provide
for non-engineers to look over code easily.

## Tree

  - tracking
    - contains tracking modules for various parts of the ecosystem
      - component (maps to a component module)
      - web (maps to an application name)
      - [other] (maps to other named modules)
  - common
    - contains modules which share common functions through the ecosystem
  - tracking_api
    - provides API wrapping and mapping to vendor API

The idea is that applications and modules can track at the point where
something occurs, but they are using our own tracking methods and agnostic
as to what is done with the tracking calls after they are made. Once the calls
get to the tracking modules, they can collect the data together with shared
data provided through common.tracking_metadata, and fire off whatever specific
third-party calls are necessary.

---
_Source: https://npm.io/package/ui-tracking · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
