Hi,
I want to track the number of clicks on the Add-to-Basket CTA via custom events. How can I achieve this using JS code, and how should I set up my reporting so I can see the number coming? Below is the screenshot of my reporting, I have tried different code examples but none of them are working.
Views
Replies
Total Likes
Hi @ArslanNa ,
In case of WebSdk, On click of the Add-to-Basket CTA, you can try firing the JS code given below :
window.alloy("sendEvent", {
"renderDecisions": false,
decisionScopes: ["buy-now"],
"xdm": {
"web": {
"webPageDetails": {
"paramName": "buttonClicked"
}
}
}
})
In the Adobe Target Activity, your setup of the goals and settings section in the screenshot looks correct. (Make sure you track the same mbox that you fire in the JS code.)
I hope it helps.
Best regards,
Vaibhav Mathur
Thanks @Vaibhav_Mathur ; if I use the above code, will the reporting automatically pick the events or there is something extra I need to setup in Target in order to capture events?
Views
Replies
Total Likes
Yes @ArslanNa ,
The reporting events should work correctly. You'll just need to specify your mbox name in the goals and settings section of the activity.
Best regards,
Vaibhav Mathur