dataLayer connector for walkerOS
Made to be used with
walker.js from
walkerOS.
More detailed information and examples can be found in the
documentation.
🤓 Usage
TODOs
- multiple events with one dataLayer.push
- Replace space with underscore in dataLayer event
connectorDataLayer({
elb,
mapping: {
}
});
Mapping
Typical GTM Trigger
event is a static string
data is an object with keys and value as Value for getMappingValue
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' });
gtag('config', 'G-XXXXXXXXXX', { foo: "bar" });
gtag('consent' 'default', { ad_storage: 'denied' });
gtag('consent' 'update', { ad_storage: 'granted' });
gtag('set', 'campaign', { id: "abd" });