The problem with mboxes and datalayers

Aug 30, 2017

You would think it would be easy to pass a variable through a datalayer to an mbox as an mbox parameter. But as it turns out, its not that simple and there can be a few problems along the way.

Target can’t directly access the datalayer. You can use php or another server side language to populate mbox parameters before it sends the page to the client. But this is done server side. Target doesn’t have a built in way to access the datalayer or other JavaScript objects.

Can’t I implement it through DTM?

This works sometimes, but can have a problem. Technically, if you are implementing Adobe Target through Adobe DTM, you can set it all up in DTM to get the data from the datalayer and pass it through an mbox as a parameter to Target. DTM has all of the configurations and set up to allow you to do this. You can also do the same thing with Adobe Analytics with the exact same variable. However, when you go to look at what is actually being passed, Analytics will have a value but it will be empty in Target, even though the setup is pretty much exactly the same.

You might have a problem

There is a problem that can occur that has to do with the order of operations in which things are loaded on the page. DTM is loaded very first at the top of the page. DTM then decides when to load the rest of the components on the page. For Target to work properly, DTM needs to load it at the beginning of the page. Analytics, however, loads at the bottom. And your datalayer, usually loads right in between the two. Which means that since the datalayer loads before Analytics, it is available for Analytics to grab and you’ll see it in Analytics. But it loads after Target and so when Target loads, the datalayer doesn’t yet exist and there is nothing for Target to grab. And so you get an empty mbox parameter.

The solution here is to either make sure that the datalayer loads before Target or pass in the parameters as part of your implementation.

From $0 to Independent
Learn to grow a business from the ground up.
Get the Newsletter






Most Recent

  1. Create Adobe Target Audience From A Cookie
  2. Adobe Target Consultant
  3. Prioritize Your Theories
  4. Generate Theories
  5. What a 50 mile bike ride taught me Energy and Efficiency
  6. Perpetual Optimization Process
  7. How to Clear Adobe Target Previews
  8. Stop Using Profile Scripts
  9. Exit Pops that Generate Revenue
  10. Adobe Target Premium Training

Before You Go!

Tell me one thing that you would like to learn more about. I'll write about it and email you when I'm done.

Email Address (Optional but recommended)