Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

Are DCR event details unique?

Avatar

Level 1

Hello!

 

When you call a Direct Call Rule (DCR) with Additional Parameters, as showcased in this post, is all of this information added to the same event details object? Meaning, if two DCRs are called at the same time, and both DCRs pass additional information and then use that to set eVars/props using event.detail, will each DCR set the correct information? Or will the data in event.detail be replaced with whatever DCR was fired last?

 

My addon to this would be whether or not it's possible to access the additional information passed in data elements via event.detail?

1 Accepted Solution

Avatar

Correct answer by
Level 8

@ng772  - The extra information you pass should be unique to each call. If you call two DCRs in rapid succession, and each DCR has a unique payload (event.detail), the values available to each DCR will come from their respective payload, setting the correct (expected) values.

 

For your last question, anything passed in as the second argument in the _satellite.track() call will be accessible to you inside the DCR. Consider the example below:

 

 

 

var payload = {
  make: "Honda",
  model: "Civic",
  color: "Purple"
}
_satellite.track("getCarInfo", payload);

 

 

 

In the DCR, you would be able to specify event.detail.make, event.detail.model, and event.detail.color to gather the car information and map to props/eVars/etc.

 

If you're asking if it's possible to collect/build a history of everything passed in over the course of several calls to _satellite.track(), that's a solution you'd have to custom build.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 8

@ng772  - The extra information you pass should be unique to each call. If you call two DCRs in rapid succession, and each DCR has a unique payload (event.detail), the values available to each DCR will come from their respective payload, setting the correct (expected) values.

 

For your last question, anything passed in as the second argument in the _satellite.track() call will be accessible to you inside the DCR. Consider the example below:

 

 

 

var payload = {
  make: "Honda",
  model: "Civic",
  color: "Purple"
}
_satellite.track("getCarInfo", payload);

 

 

 

In the DCR, you would be able to specify event.detail.make, event.detail.model, and event.detail.color to gather the car information and map to props/eVars/etc.

 

If you're asking if it's possible to collect/build a history of everything passed in over the course of several calls to _satellite.track(), that's a solution you'd have to custom build.

Avatar

Level 1
@Brian_Johnson_ if a javascript variable data element referenced `event.detail.make` and it was added to the "getCarInfo" DCR, would it pick up the correct information? Or would that have to be set on the DCR as you mentioned

Avatar

Level 8
@ng772 You can only reference event.detail properties in the direct call rule itself, and the values are specific to each time the DCR is called. (Is that what you were asking?)