- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
I tried the below code at my end seems is working fine for me with target version 2.7.0.
const el = document.getElementByClassName("hero_btn")[0];
el.addEventListener('click', function (e) {
e.preventDefault();
alert("CTA clicked")
adobe.target.trackEvent({
"mbox": "carouselCTA"
});
setTimeout(function () {
window.open(el.href, '_blank');
}, 1000);
});
I can see there was some issues with version 2.1.0 for trackEvent function however that got fixed in later release so shouldn't be the problem.
If still having problem then it's worth to try to upgrade target version in lower environment and check again.
Hope this helps.