- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
02-01-2018 04:51 AM - edited 02-01-2018 05:22 PM
Hi,
Now Using utag.js to load mbox.js in async mode and would like to use native javascript to call mboxdefine and mboxupdate but always receives mboxdefine not present. Thus, would like to ask how to make sure mbox.js loaded before mboxdefine and mboxupdate are called?
Dave
Solved! Go to Solution.
Hi @DaveCHChan
First question is when/where are you trying to access mboxDefine
/ mboxUpdate
is it inline on the page or from an extension or using the mbox extension in iQ? Depending on the situation, we could possibly find you a way of running is.
I would also recommend if you haven't already, bundling the mbox tag and setting the wait flag to false. This will make the mbox.js code become available.
Adrian
02-04-2018 05:44 PM - last edited on 02-05-2018 11:10 AM by kathleen_jo
Thanks for your reply! @adrian_browning, I natively place mboxDefine / mboxUpdate as I would like to have a quick win solution under dynamic condition triggered by backend. At this point, I can't address the solution by using ext like TNT in iQ.
Regarding you mentioned about bundling the mbox tag and setting the wait flag, could you mind showing me how to do so?
Dave
Here's a link to a document explaining these settings: https://community.tealiumiq.com/t5/iQ-Tag-Management/Tag-Configuration-Advanced-Settings/ta-p/13600.
The only other idea I have is to create wrappers around the mboxDefine/mboxUpdate (we do this for the new AT.js tag that is in Beta, we inject them into the utag.sync.js file) and add those as high up as you can. I'm not sure if Pre-Loader will be soon enough for you, but if you are using the utag.sync.js file, then this might be an option.
Adrian
Copyright All Rights Reserved © 2008-2023