Expand my Community achievements bar.

[mboxCreate()] document.currentScript is missing or not supported/Track event request failed

Avatar

Level 2

Using this to Generate a mbox on click of element , but Getting error in the console.

$(document).ready(function() {

       mboxCreate('mboxClickTrack_showRegister');

    

       var hits = 1; //->variable

       // Everything below this line is called "binding" a handler to an event (click event)

       $('#element_1').click(function() { // --> handler or listener

           if (hits === 1) //for only first hit.

           {

               // do Something over here for hits = 1

               console.log('hits_numbers ' + hits);              

               adobe.target.trackEvent({

                   'mbox': 'mboxClickTrack_showRegister',                  

               });

           } else { // for hits +1

               adobe.target.trackEvent({

                   'mbox': 'mboxClickTrack_showRegister',                  

               });

               console.log('hits_numbers ' + hits);

           }

           hits++;

           return false;

       });

   });
I can see that new mbox is getting Generated on the click through

Adobe Experience Cloud Debugger BETA

But Receiving error in the console.

[mboxCreate()] document.currentScript is missing or not supported.

If I am not using mboxCreate, I am getting this error:

Track event request failed {mbox: "mboxClickTrack_showRegister", params: {…}, timeout: 15000, success: ƒ, error: ƒ} {status: "error", error: "abort"}

1 Reply

Avatar

Level 4

Hi Robin,

Can you confirm if you are running mboxCreate from console??

mboxCreate is not supposed to be run from the console, as it tries to detect the DOM element it was called from (which in case of the console call is nonexistent). The recommended way is to use mboxCreate in inline scripts.

Hope this helps.

Thanks

Pranav