Hi everyone!
We're in the process of deploying Target using Adobe Launch. The suggested method in the documentation of loading the library at the top of the page and setting all the profile parameters and recommendations data at the same time is not suitable as the values aren't always available at the top of the page. For instance, profile parameters are populated by data layer values which aren't there until the DOM is ready and for recommendations data, the site needs to query a database to deliver the latest price.
In DTM we used custom code that fired after the page load (using getOffer and applyOffer code) to set the profile and recommendations data, but this method now causes the 'global mbox is not allowed in mboxes' error. Firing another 'Add params to page load request' rule doesn't work either because it causes the mbox SDIDs to not match which messes up Analytics for Target reporting.
I've been told by Client Care that there should only be one Target call on the page but looking at other sites I can see this isn't the case with a number of calls being made to Target. They're sometimes mboxes with different names but I can't see a way to add another mbox via Launch with a different name that we could use to deploy tests to as in Target there can only be one specified global-mbox.
I can't imagine that I'm the only person who has had this challenge and it's stressing me out. We need to be able to set all our profile parameters and then deliver the necessary content, whilst ensuring it doesn't mess with our Analytics for Target integration.
Any help or advice would be greatly appreciated.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Managed to achieve this using the adobe.target.getOffers() and adobe.target.applyOffers methods in the at.js 2.0 API.
Code example:
// Set up object to send parameters into Target
var paramsObj = {
"profile":{
// Key-value pairs for profile parameters
},
"global" : {
// Key-value pairs for other parameters
}
};
adobe.target.getOffers({
request: {
"execute" : {
"pageLoad" : {
"parameters" : paramsObj.global,
"profileParameters" : paramsObj.profile
}
},
"experienceCloud": {
"analytics": {
"supplementalDataId" : _satellite.getVar("sdid") // Data element containing last SDID value
}
}
}
})
// Apply any offers based on parameters
.then(function(response){
adobe.target.applyOffers ({
response: response
})
})
}
Views
Replies
Total Likes
Hi Philip,
Could you elaborate on what happens when you Load Target on Library Loaded and Add Parameters with Fire Global Mbox on DOM Ready?
Could you share the custom code you are referring to?
Views
Replies
Total Likes
Views
Replies
Total Likes
Philip,
Just in case, the pre-hiding snippet should be hardcoded in the HTML code, it should not be added via Launch.
The page may remain blank unless Target returns the offer or the timeout is triggered.
Views
Replies
Total Likes
Managed to achieve this using the adobe.target.getOffers() and adobe.target.applyOffers methods in the at.js 2.0 API.
Code example:
// Set up object to send parameters into Target
var paramsObj = {
"profile":{
// Key-value pairs for profile parameters
},
"global" : {
// Key-value pairs for other parameters
}
};
adobe.target.getOffers({
request: {
"execute" : {
"pageLoad" : {
"parameters" : paramsObj.global,
"profileParameters" : paramsObj.profile
}
},
"experienceCloud": {
"analytics": {
"supplementalDataId" : _satellite.getVar("sdid") // Data element containing last SDID value
}
}
}
})
// Apply any offers based on parameters
.then(function(response){
adobe.target.applyOffers ({
response: response
})
})
}
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies