Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

yuhuisg
Community Advisor
Community Advisor

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
1 Accepted Solution
yuhuisg
Correct answer by
Community Advisor
Community Advisor

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);

View solution in original post

6 Replies
yuhuisg
Correct answer by
Community Advisor
Community Advisor

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);

View solution in original post

yuhuisg
Community Advisor
Community Advisor

Aside: This forum's code formatting is weird... such a large font for the "500" number... @jantzen_belliston-Adobe 

shelly-goel
Community Advisor
Community Advisor
@yuhuisg Thanks for sharing that adding a delay is preventing the mixing of data between two s.tl() calls. Would like to understand, if clearVars would resolve the issue as well or not and if there would be any other constraints in using it in this case?
yuhuisg
Community Advisor
Community Advisor
@shelly-goel I didn't try the clearVars method. I personally don't like it because it clears out all variables, whereas I want to keep some variables between hits.
jantzen_belliston-Adobe
Community Manager
Community Manager
@yuhuisg - Thanks for the notification. I agree the formatting is a bit odd. I'll ping our developer to see if this is something we can fix with a quick CSS tweak.