コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards
解決済み

Target "trackEvent()" equivalent for Alloy?

Avatar

Level 2

Greetings!

I'm currently testing the Web SDK (Alloy) to handle everything related to Target.
Most of my activities are written form based and currently I'm struggling to find something similar to the old school "adobe.target.trackEvent()" function to count e.g. simple clicks of a button.

Normally I would write something like this:

 

adobe.target.trackEvent({ 
    "mbox": "click-mbox"
});

 

How would i write the same via Alloy?
I found this in the documentation (https://experienceleague.adobe.com/docs/experience-platform/edge/personalization/adobe-target/web-sd...), but to be honest I don't really get it.

I understand that we are now using

 

alloy("sendEvent", {
 …
});

 

but i couldn't figure out where to pass the "click-mbox" value.

Am I missing something? Thank you in advance! 🙂

1 受け入れられたソリューション

Avatar

正解者
Community Advisor

Hi @chrish75788707 

As per example above "click-mbox" is the mbox name. 

 

When you're using the WebSDK, you can use 

  • decisionScopes: which retrieve specific activities (useful for activities created with the form-based composer) by adding this option to your events.

if you look at the terminology, 

Scope: The scope of the decision. In Target, the scope is the mBox. The global mBox is the __view__ scope.

So in your above example you can add mbox name like below. 

 

 

alloy("sendEvent", {
     renderDecisions: true,
     xdm: { ...},
     decisionScopes: ["click-mbox"]
});

 

 Hope this helps. 

元の投稿で解決策を見る

4 返信

Avatar

正解者
Community Advisor

Hi @chrish75788707 

As per example above "click-mbox" is the mbox name. 

 

When you're using the WebSDK, you can use 

  • decisionScopes: which retrieve specific activities (useful for activities created with the form-based composer) by adding this option to your events.

if you look at the terminology, 

Scope: The scope of the decision. In Target, the scope is the mBox. The global mBox is the __view__ scope.

So in your above example you can add mbox name like below. 

 

 

alloy("sendEvent", {
     renderDecisions: true,
     xdm: { ...},
     decisionScopes: ["click-mbox"]
});

 

 Hope this helps. 

Avatar

Level 2

Hi @Gokul_Agiwal,

thank you very much for your quick reply! I'll take a closer look at the whole thing in the next few days but for now it seems to be working. Thank you for the informations! 🙂

Have a nice day and all the best.

Avatar

Community Advisor

Hi @chrish75788707 

Glad to know that its working. Have a great day and happy targeting 😀  

Avatar

Level 1

Hi @Gokul_Agiwal ,

 

i have used the same code but when I check my target report the conversion data is still showing as 0.

 

I have configured the goal metric as conversion - viewed an mbox 

 

please help me!