Hello,
We have a activity only for visitors with a particular profile parameter. But this data point does not exist until several seconds after the page has fully loaded. This means the first pageLoad request made to Adobe Target (at.js 2.x) is missing these parameters - and the visitor fails to qualify for the test.
We have some code that will scrape the DOM for all the necessary data points, so we want to make a second request to the Adobe Target servers. This time with all the parameters in order to fetch the activity and then apply it.
For A4T to work correctly all calls to Adobe Target should use the same supplemental ID as the original Adobe Analytics Page track supplemental ID. This works fine for the default first pageLoad request.
But when we try to make this second request using adobe.target.getOffers and a hardcoded supplementalDataId it is ignored, and instead a new supplementalDataId is created.
How can we ensure the supplementalDataId isn't randomly recreated, and instead uses what we set it to?
adobe.target.getOffers({
request: {
experienceCloud: {
analytics: {
supplementalDataId: "4A3B4159AD0B6F95-7F996DA189DD5694" // hardcoded to test if this gets passed to Adobe Target
}
},
execute: {
pageLoad: {
parameters: {
level: 'advanced'
},
profileParameters: {
score: 2 // example parameter that we scraped from DOM several seconds after page loaded
}
}
}
}
})
.then(response => adobe.target.applyOffers({ response: response }))
.then(() => console.log('Success'))
.catch(error => console.log('Error', error));
We have manually ran the above code snippet in the console, and expected the network tab to show the same supplementalDataId as we have hardcoded. But it wrongly showing as '7F3635E16781A866-10994B8473BC3DE7'
References;
https://developers.adobetarget.com/api/delivery-api/#operation/execute
Solved! Go to Solution.
There should be 'marketingCloudVisitorId' present as well for A4T. Having said that, with pageLoad a new hit is generated and so a new sdid (there would be another analytics call too having same new sdid).
I would rather suggest to delay setting target parameters and so the global mbox call until the profile parameter (score) is available so that a single page load event is generated (with the experience) once all params are available. No additional getoffer() and applyoffer() would be required.
If it's not feasible to delay page body load then it would be better to create a different local mbox (which can be retrieved with getoffer in execute:mboxes) than global mbox (which is specifically for experiences on page load, default content would have been already rendered).
If you still want to keep global mbox and same sdid, you can rather control the analytics call client side (logging:client_side).
There should be 'marketingCloudVisitorId' present as well for A4T. Having said that, with pageLoad a new hit is generated and so a new sdid (there would be another analytics call too having same new sdid).
I would rather suggest to delay setting target parameters and so the global mbox call until the profile parameter (score) is available so that a single page load event is generated (with the experience) once all params are available. No additional getoffer() and applyoffer() would be required.
If it's not feasible to delay page body load then it would be better to create a different local mbox (which can be retrieved with getoffer in execute:mboxes) than global mbox (which is specifically for experiences on page load, default content would have been already rendered).
If you still want to keep global mbox and same sdid, you can rather control the analytics call client side (logging:client_side).
Thank you @shelly-goel
Just tried with a local mbox and a new sdid is being generated. Would also rather avoid using logging:client_side
It seems the sdid is decided by a function called getSupplementalDataID - and there are two in circulation at any one time (stored in visitor._supplementalDataIDCurrent or visitor._supplementalDataIDLast). If I override those values I can force my getOffers request to use the sdid of my choosing (the same one that was used for pageLoad and Adobe Analytics page view call).
Is there a limit on the number of times a sdid can be used?
For example;
Will Adobe be able to sync that all together on the server so I can use Adobe Analytics as reporting source?
Views
Replies
Total Likes
@shelly-goelThank you for the links. After a bit more searching of the documentation: to solve this, when using getOffers I had to set the consumerId key to a unique value (it was defaulting to 'undefined' even if I was request regional mboxes). That value is used to determine whether the API should generate a new SDID or if it reuses the SDID already available on the page.
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies