How to Use Adobe Target Regional Mboxes in the VEC
Anyone who has used Adobe Target will be familiar with this screen. The first decision you make for a new A/B test or Experience Targeting activity is the type of composer to use, either the Visual Experience Composer (VEC) or the Form Composer.
The VEC allows a marketer to make changes and implement tests in a WYSIWYG editor without the need for a website code deployment. It’s used by pretty much everyone who has a client-side web implementation of Target. Normally any modifications you make using the VEC are delivered to the page using the global mbox which applies changes to specific CSS selectors.
But what if you also have regional mboxes for specific marketing or messaging areas? Well, here’s a quick trick I’ve never seen anyone else mention to “enable” these in the VEC if you find your regional mboxes are missing:
To make a region of the page appear as a regional mbox in the VEC, add a class in the following format: “mbox-name-[name_of_mbox]”
Yep. That’s all there is to it.
The example below shows what this looks like for three regional mboxes: homepage-secondary-1, 2, and 3.
I used the word “enable” in quotes for a reason. What this trick actually does is simply allows the VEC to highlight specific regions of the page as regional mboxes with the overlay toggle. Any elements with a class starting with “mbox-name-“ are considered regional mboxes for the purposes of VEC overlay.
Once these classes are added, the VEC will allow you to select these regions of the page to make mbox modifications. The VEC automatically converts the class names into the appropriate mbox names.
It’s important to note that the regional mbox overlay and the actual selectors where offers are applied are completely independent. You can add a class in the “mbox-name-“ format to any element you like on the page and it will appear as a regional mbox in the VEC (go ahead, try it with your browser’s dev tools). However, your actual Target implementation may define the regional mbox around a completely different selector when it executes applyOffer() or applyOffers(). For this reason, you should ensure that the class names are added to the exact same selectors used for your regional mboxes. For example:
You may be asking yourself a few questions, such as:
I hope this trick was helpful to Target newcomers and power users alike. In another post we will outline in detail why regional mboxes are still very useful in certain scenarios.
TL;DR
$(“div[data-mbox-id=’homepage-secondary-1′]”).addClass(“mbox-name-homepage-secondary-1”);// Call Target for regional mbox content and apply to the appropriate selector
adobe.target.getOffer({
“mbox”: “homepage-secondary-1”,
“success”: function(offer) {
adobe.target.applyOffer({
“mbox”: “homepage-secondary-1”,
“selector”: “div[data-mbox-id=’homepage-secondary-1′]”,
“offer”: offer
});
},
“error”: function(status, error) {
console.log(‘Error’, status, error);
}
});
// Yes, I know this is missing flicker handling
// … Maybe I’ll do a follow up for advanced flicker handling techniques