3

As a developer I try to integrate Sitecore CDP API what ends up with sending many duplicated requests in very short time. Some of them are user related and I need to reset the session to test the user paths correctly. To do it faster I would like to end the user session on the Sitecore CDP side on demand without waiting until CDP ends it. Is it possible to send a request that will finish the session on CDP side?

1 Answer 1

5

Yes, it is possible to finish the session on demand. To achieve it, you must send request looking like this one:

_boxeverq.push(function(){
    var viewEvent = {
      "type" : "FORCE_CLOSE",
      "browser_id" : _boxever.getID(),
      "channel" : "WEB",
      "page" : window.location.href,
      "pos" : "Sygnity",
      "_bx_extended_message" : "1"
    };
    _boxever.eventCreate(viewEvent, function(data){},"json");
  });

The crucial thing here is the type : FORCE_CLOSE

1
  • 2
    It is important to note, the FORCE_CLOSE event it not completely supported in the production environments, it is not as reliable as the timeout for the session end, especially in higher volumes. It is best to use this for demo and PoC work only.
    – Richard Seal
    Commented Feb 15, 2022 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.