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

0.1.0 • Public • Published

dataLayer source for walkerOS

Made to be used with walker.js from walkerOS.

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

🤓 Usage

API Commands

Typical gtag API commands like config, get, set, event, and consent are all translated to objects. Command parameters are added to data. For the event command the second parameter is used as the event name. For consent both granted and denied values are translated to either true or false.

gtag('event', 'foo', { bar: 'baz' }); // { event: "foo", data: { bar: "baz" }}
gtag('config', 'G-XXXXXXXXXX', { foo: "bar" }); // { event: "config G-XXXXXXXXXX", data: { foo: "bar" }}
gtag('consent' 'default', { ad_storage: 'denied' }); // { event: "consent default", data: { ad_storage: false }}
gtag('consent' 'update', { ad_storage: 'granted' }); // { event: "consent update", data: { ad_storage: true }}
gtag('set', 'campaign', { id: "abd" }); // { event: "set campaign", data: { id: "abc" }}

Package Sidebar

Install

npm i @elbwalker/source-datalayer

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

77 kB

Total Files

40

Last publish

Collaborators

  • alexanderkirtzel