Hello, I'm implementing some custom events on my site using the gas function and the DAP Code v7.0 Capabilities and Reference says that the action parameter (the 4th) is optional but the code ( else if ("event" === b.toLowerCase() && void 0 !== d && "" !== d) full context pasted below) clearly checks that it is there before triggering the event. I'm not sure which is incorrect (docs or code); but my suspicion is that the code should be checking the 3rd parameter (not 4th).
function gas(a, b, c, d, f, e, h) {
if (
void 0 !== a &&
"" !== a &&
void 0 !== b &&
"" !== b &&
void 0 !== c &&
"" !== c
)
if ("pageview" === b.toLowerCase())
try {
_sendPageview(c, void 0 === d || "" === d ? document.title : d);
} catch (n) { }
else if ("event" === b.toLowerCase() && void 0 !== d && "" !== d)
try {
var g = !1;
void 0 !== h &&
"boolean" === typeof _cleanBooleanParam(h) &&
(g = _cleanBooleanParam(h));
_sendEvent("dap_event", {
event_category: c,
event_action: d,
event_label: void 0 === f ? "" : f,
event_value: void 0 === e || "" === e || isNaN(e) ? 0 : parseInt(e),
non_interaction: g,
});
} catch (n) { }
Hello, I'm implementing some custom events on my site using the gas function and the DAP Code v7.0 Capabilities and Reference says that the action parameter (the 4th) is optional but the code ( else if ("event" === b.toLowerCase() && void 0 !== d && "" !== d) full context pasted below) clearly checks that it is there before triggering the event. I'm not sure which is incorrect (docs or code); but my suspicion is that the code should be checking the 3rd parameter (not 4th).