How can I replicate the trackEvent from at.js behaviour with webSDK? | Community
Skip to main content
Level 2
February 28, 2024
Solved

How can I replicate the trackEvent from at.js behaviour with webSDK?

  • February 28, 2024
  • 1 reply
  • 2836 views

Hello community, 

 

I´ve recently moved an adobe target setup to webSDK but one feature i´m struggling to replicate in webSDK. 

 

In at.js I had some custom goals deployed with the function trackEvent and I used that as conversion goals for some activities (viewed an mbox). But in webSDK I´m not finding out how to do the same thing. I have reviewed documentation and found that I need to send a normal alloy("sendEvent) request with some options but that does not work in my case or I´m not doing it right. Also I found the documentation quite ambiguous in this aspect. 

 

How can I deploy the same event tracking capabilities in webSDK setups? What I want to achieve is to send an event when for example some process is completed (I cannot use URL) and use that event as a "viewed an mbox" goal for my activities. 

 

For extra information: I do not have Adobe Tags so I have implemented Target with Google Tag Manager and alloy.js.

 

Thank you a lot!

Thank you a lot!

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by alexbishop

I'm guessing you've seen this example already? A more simplified version of that example, if my event tracking mbox is called "conversionTest", could look something like this:

 

 

alloy("sendEvent", { xdm: {}, decisionScopes: ['conversionTest'] }).then(function(result) { var propositions = result.propositions; if (propositions) { for (var i = 0; i < propositions.length; i++) { var proposition = propositions[i]; if (proposition.scope === "conversionTest") { alloy("sendEvent", { xdm: { eventType: "decisioning.propositionDisplay", _experience: { decisioning: { propositions: [{ id: proposition.id, scope: proposition.scope, scopeDetails: proposition.scopeDetails }] } } } }); } } } });

 

 

 

 

1 reply

alexbishop
Adobe Employee
alexbishopAdobe EmployeeAccepted solution
Adobe Employee
February 28, 2024

I'm guessing you've seen this example already? A more simplified version of that example, if my event tracking mbox is called "conversionTest", could look something like this:

 

 

alloy("sendEvent", { xdm: {}, decisionScopes: ['conversionTest'] }).then(function(result) { var propositions = result.propositions; if (propositions) { for (var i = 0; i < propositions.length; i++) { var proposition = propositions[i]; if (proposition.scope === "conversionTest") { alloy("sendEvent", { xdm: { eventType: "decisioning.propositionDisplay", _experience: { decisioning: { propositions: [{ id: proposition.id, scope: proposition.scope, scopeDetails: proposition.scopeDetails }] } } } }); } } } });

 

 

 

 

Level 2
February 28, 2024

Thank you alexbishop,

 

I have tried that function but I have a follow up question: 

 

When I execute the function, I see an "interact" request in the network tab. That call I assume is from the first alloy sendEvent but then I was thinking I should see a second call from the second alloy sendEvent that signals the "propositionDisplay" event. The thing is that this second call is not showing.

 

Also for now I´m not seeing that "conversionTest" mbox inside Target. I believe this is due to the missing second call. 

 

Can you help with that? 😕😕

 

Thank you!

alexbishop
Adobe Employee
Adobe Employee
February 28, 2024

Thank alexbishop,

 

Now I´m seeing the two interact requests, the second with the event type "decisioning.propositionDisplay"

 

Now I need to wait if that add to the total mbox count of my activity. 

 

Thank you!


Great, that's working as expected then, at least in terms of the two interact requests. Typical latency is around 4mins for the metric to update in the reporting UI