Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

How to track clicks in Target using web sdk and see clicks in reportings

Avatar

Level 1

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.

 reportings.PNG

 

3 Replies

Avatar

Community Advisor

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

Avatar

Level 1

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?

Avatar

Community Advisor

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