# tamacoge

> Tag Manager Code Generator

Latest version **0.0.2** (published 2018-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install tamacoge
pnpm add tamacoge
yarn add tamacoge
bun add tamacoge
```

## 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.2 |
| Published | 2018-09-28 |
| First published | 2018-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jake Burden |
| Maintainers | jekrb |
| Keywords | tag, manager, code, generator |

## Links

- npm: https://www.npmjs.com/package/tamacoge
- npm.io page: https://npm.io/package/tamacoge

## Dependencies (1)

- [dedent](https://npm.io/package/dedent.md) ^0.7.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2018-09-28
- 0.0.1 — 2018-09-28

## README

# TAMACOGE

![Stability Experimental](https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square)

> **TA**g **MA**nager **CO**de **GE**nerator

Give it a selector, an event listener, and a payload object for Google Tag Manager, and it outputs the code to add to your website.

## Usage

```js
var tamacoge = require('tamacoge')

var code = tamacoge('main > section .btn', 'click', {'event': 'click'})
```

outputs

```js
dataLayer = window.dataLayer || []
var el = document.querySelector('main > section .btn')
el.addEventListener('click', function () {
  dataLayer.push({"event":"click"})
})
```

## API

```js
var tamacoge = require('tamacoge')
```

### var code = tamacoge(selector, eventType, payload))

Output `String` of code that can be used to push the payload after the passed event type is triggered on the selector.

- `selector` (required) - Selector or path to selector. String.
- `eventType` (required) - Type of event to listen for on the selector. String.
- `payload` (required) - Data to push to Tag Manager's dataLayer.


## Install

With [npm](https://npmjs.org/) installed, run

```
$ npm install tamacoge
```

## License

MIT

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