Hi,
I am trying to track some CTAs and I am using trackEvent method for that. But when I am clicking on the button, the request goes into 400 status.
The workaround to this I opted is to go for getOffer() method but just curious to see the reason behind failure of trackEvent method. Any help will be much appreciated. thanks!
Below is the code -
el.addEventListener('click', function (e) {
e.preventDefault();
console.log("CTA clicked")
adobe.target.trackEvent({
"mbox": "carouselCTA"
});
// adobe.target.getOffer({
// "mbox": "carouselCTA",
// "success": function (offer) {
// adobe.target.applyOffer({
// "mbox": "carouselCTA",
// "offer": offer
// });
// },
// "error": function (status, error) {
// console.log('Error', status, error);
// }
// });
setTimeout(function () {
window.open(el.href, '_blank');
}, 1000);
});
Target version - 2.3.2
Solved! Go to Solution.
Views
Replies
Total Likes
@Khushboo_Kalia the code seems to be fine. I have seen such issues related to the browser extensions or network settings.
Hope this helps.
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.
@Gokul_Agiwal thanks for your response. I'll try upgrading the version.
@Khushboo_Kalia the code seems to be fine. I have seen such issues related to the browser extensions or network settings.
Hope this helps.
@Gaurav_Singh That seems the issue but I couldn't tackle which extension that will be in my case.
Views
Replies
Total Likes
Hi @Khushboo_Kalia Sometimes Adobe experience cloud debugger (old) browser extension make an issues with so just try disabling and see if that works for you.
Views
Like
Replies