Why are tracking callbacks executing twice? | Community
Skip to main content
Jacob-DDdev
Level 6
September 29, 2020
Solved

Why are tracking callbacks executing twice?

  • September 29, 2020
  • 3 replies
  • 2987 views

I'm registering a callback using s.registerPostTrackCallback() . In particular, within the console I'm testing with

s.registerPostTrackCallback(function(){console.log('test text')};

On the page, I click an object that sends an s.t() beacon and the network calls show that only one beacon fired, but the console is displaying

 

 

test text test text

 

 

 What else could be executing this callback causing it to duplicate the expected output?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MSchoenmakers-Signify

Hi jkm-disco,

 

I've seen this before too, and I came to the conclusion this occurs as soon as the data is being sent in a POST request instead of a GET request. At that point, the XHR is triggering the request for a second time.

I've reported this about a year ago at Adobe (via customer care), but after some disscussion I gave up and implemented a hotfix myself instead of waiting for Adobe engineers to fix the bug.

 

Maybe, since you are facing it too, it is time to re-address to issue to Adobe...

 

Regards,

Martijn

3 replies

MSchoenmakers-SignifyAccepted solution
Level 2
September 29, 2020

Hi jkm-disco,

 

I've seen this before too, and I came to the conclusion this occurs as soon as the data is being sent in a POST request instead of a GET request. At that point, the XHR is triggering the request for a second time.

I've reported this about a year ago at Adobe (via customer care), but after some disscussion I gave up and implemented a hotfix myself instead of waiting for Adobe engineers to fix the bug.

 

Maybe, since you are facing it too, it is time to re-address to issue to Adobe...

 

Regards,

Martijn

Level 2
November 3, 2020
Hi @jacob-dddev, FYI: I just received confirmation that the Adobe engineering team has identified this as a bug and will create a fix in a future release. I don't have any information on when we can expect this to be fixed.
Level 2
September 30, 2020

Hi @jacob-dddev,

for what's worth: the work-around I use is based on the asumption it being highly unlikely that two succeeding pixels are alike.

Therefore in my callback function I keep track of the last payload (from the parameter) and compare that to the last received. If they are equal, the call is ignored.

 

Furthermore: I see if I can get my Customer Care ticket reopened and will refer this topic.

Jacob-DDdev
Level 6
September 30, 2020

As per @mschoenmakers-signify mention of the bug, the workaround that I'm using is as follows:

 

On Library Load, I'm updating the s.t() function.

 

var tempTrack = s.t.bind({}); s.t = function(e,t,justInCaseParam,justInCaseParam2){ tempTrack(e,t,justInCaseParam,justInCaseParam2); someOtherPostBeaconCode(); }

 

 

Seems to be sufficient to just add on to the existing track function, but played it safe, in case new parameters are added to the s.t() function in the future. Similar code can be replicated for s.tl() as well.