Activity Map skips a hit when sending consecutive s.tl() hits in the same page

Avatar

Avatar

yuhuisg

MVP

Avatar

yuhuisg

MVP

yuhuisg
MVP

27-11-2020

I have a situation where in one page, we have multiple buttons that open the same overlay within the page. However, each button has been coded as a DIV element, with a click event added to it.

I've added "s_objectID" to each of these DIVs. When I click all of them, I expect Activity Map to record that particular DIV's s_objectID. Each DIV click also sends a s.tl() Custom Link hit with a name for that DIV.

Here's what I've found:

  1. Click first DIV:
    1. s.tl() is sent with correct DIV name.
    2. Activity Map is set with that DIV's s_objectID.
  2. Click second DIV:
    1. s.tl() is sent with correct DIV name.
    2. Activity Map is NOT set!
  3. Click third DIV:
    1. s.tl() is sent with correct DIV name.
    2. Activity Map is set with the second DIV's s_objectID!
  4. Click fourth DIV:
    1. s.tl() is sent with correct DIV name.
    2. Activity Map is set with the third DIV's s_objectID!
  5. etc.

I think this behaviour occurs because Activity Map expects that after clicking a link that sets Activity Map, the next hit should be a s.t() Pageview hit. But that is clearly not the case here, because the user can close the overlay, but then click another button to open the same overlay without going to another page nor without a page refresh.

This behaviour also happens when it's a combination of DIV and A elements. As long as there are consecutive s.tl() hits and all of them are expected to set Activity Map, then Activity Map always skips the 2nd one, and then subsequent s.tl() hits have the previous Activity Map data.

I think that this tracking behaviour is a bug, not a feature, of Activity Map. I think Activity Map should track the current clicked element's data, regardless if a pageview hit (or some other condition that I'm not aware of) has occurred.

Is there a workaround for this Activity Map bug?

Activity Map Adobe Analytics Analytics

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

yuhuisg

MVP

Avatar

yuhuisg

MVP

yuhuisg
MVP

29-11-2020

Got this solution from Frederik Werner: add a delay when firing s.tl().

E.g.

// delay s.tl() call for 500 ms
setTimeout(function() {
  ...
  s.tl(this, 'o', '...');
}, 500);

Answers (1)

Answers (1)

Avatar

Avatar

shelly-goel

MVP

Avatar

shelly-goel

MVP

shelly-goel
MVP

28-11-2020

@yuhuisg  I think clearVars or variable override (4th parameter) should solve this issue. Please refer:

https://helpx.adobe.com/analytics/kb/how-to-ensure-that-variable-event-values-do-not-prevail-in-anal...

Hope this helps.