You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed with Benedikt Wedenik, for events that depend on data in the state that isn't provided by the event payload, when the event listener is registered late, it is impossible to recover how exactly the state was at the moment of the event.
In following example, see how there's no easy way for the "test" event listener to know that at the moment of the event x was equal to 1:
If the event listener could have been registered before the other push, then this.getState() would have returned {x: 1, y: 1}, but this is often not possible as the event listeners get registered asynchronously, via Adobe Launch for example.
It would be nice if events that get registered late had a chance to access the full state as it was at the moment of the event, like by passing it as a parameter to the event:
adobeDataLayer.push(function(){this.addEventListener("test",function(event,state){console.log(state);});});// Console output would then be: {x: 1, y: 1}
Or, if that's too much of a performance concern, then we should have a way to optionally request the full event for specific events:
As discussed with Benedikt Wedenik, for events that depend on data in the state that isn't provided by the event payload, when the event listener is registered late, it is impossible to recover how exactly the state was at the moment of the event.
In following example, see how there's no easy way for the
"test"
event listener to know that at the moment of the eventx
was equal to1
:If the event listener could have been registered before the other
push
, thenthis.getState()
would have returned{x: 1, y: 1}
, but this is often not possible as the event listeners get registered asynchronously, via Adobe Launch for example.It would be nice if events that get registered late had a chance to access the full state as it was at the moment of the event, like by passing it as a parameter to the event:
Or, if that's too much of a performance concern, then we should have a way to optionally request the full event for specific events:
The text was updated successfully, but these errors were encountered: