@elbwalker/tagger
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

Tagger

Made to be used with @elbwalker/walkerOS.

More detailed information and examples can be found in the documentation.

🤓 Usage

Start by installing the tagger with npm:

npm i --save @elbwalker/tagger

Import, instantiate and use the tagger

import Tagger from '@elbwalker/tagger';

const tagger = Tagger();
tagger.entity('promotion'); // { "data-elb": "promotion" }

tagger.action('visible', 'impression'); // { "data-elbaction": "visible:impression" }
tagger.action({ click: 'add', load: 'view' }); // { "data-elbaction": "click:add;load:view" }

tagger.property('promo', 'text', 'hey'); // { "data-elb-promo": "text:hey" }
tagger.property('promo', { id: '1', text: 'hey' }); // { "data-elb-e": "id:1;text:hey" }

tagger.context('test', 'a'); // { "data-elbcontext": "test:a" }
tagger.context({ test: 'a', pos: 'hero' }); // { "data-elbcontext": "test:a;pos:hero" }

tagger.globals('language', 'en'); // { "data-elbglobals": "language:en" }
tagger.globals({ language: 'de', pagegroup: 'shop' }); // { "data-elbglobals": "language:de;pagegroup:shop" }

Contribute

Feel free to contribute by submitting an issue, starting a discussion or getting in contact.

Package Sidebar

Install

npm i @elbwalker/tagger

Weekly Downloads

1,135

Version

2.0.2

License

MIT

Unpacked Size

15.8 kB

Total Files

10

Last publish

Collaborators

  • alexanderkirtzel