We ran into something similar with click tracking mboxes in target.
our solution was to override the onclick and href values of the element clicked, then in the success AND error states of the click tracking call, we then created a new dom a tag on the fly, added the href back for the next piece of js to use the window.location change.
works well, kinda hacky, but that's what we had to do in order to deal with the window.location changes
better way is to not do the window.replace and instead rely on native browser element functionality for changing the location. depends on your setup. we aren't on a SPA site with angular, but we have a lot of ajaxy reqs.
``` code
var clickTrack = function(click){
adobe.target.trackEvent({
'mbox':'mboxClickTrack',
'preventDefault': true,
'params': {
'menuClick': click
},
'success': function(){
jQuery(this).attr('href', href);
location.href = jQuery(this).attr('href');
},
'error': function(){
jQuery(this).attr('href', href);
location.href = jQuery(this).attr('href');
},
'timeout': 750
});
```