Thanks a lot.
Hi @Michael_Soprano - before we go into the technical solution, let me try to understand the expected behaviour when a customer clicks "Decline". Will such customers be excluded from showing any personalised experience, including AB tests? In other words, will they be part of any experience driven by Adobe Target?
It is for the demo purposes so it does not matter yet a lot but it is definetely food for thought for me and I will also prepare this scenario in my list of use-cases.
1. Pass a flag corresponding to which button customer clicked as an mbox-parameter through trackEvent() method, by adding following code to buttons' event-listener:
I implemented code like this:
<script type="text/javascript">
let x = document.createElement('div');
x.setAttribute('id', 'cookie');
x.innerHTML = `
<div class='cookie'> someHTML ... </div>
`;
document.body.append(x);
let accept = document.querySelector('.accept');
accept.addEventListener('click', () => {
console.log('accepted');
adobe.target.trackEvent({
"mbox": "track_customer_preference",
"params": {
"preference": "accepted" //or declined
}})
x.style.display = 'none'
});
</script>
Banner shows up but I cannot close it. If I would like to close the banner this error shows up....

It looks like adobe global function is not available. How to resolve this bug?