How to natively call mboxDefine?

Gold Contributor
Gold Contributor

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

3 REPLIES 3

How to natively call mboxDefine?

Tealium Employee

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

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

How to natively call mboxDefine?

Gold Contributor
Gold Contributor

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

 

How to natively call mboxDefine?

Tealium Employee

@DaveCHChan

2018-02-06_1055.png

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

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Public