Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Are DCR event details unique?

ng772
Level 1
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
evolytics_brian
Correct answer by
Community Advisor
Community Advisor

@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
evolytics_brian
Correct answer by
Community Advisor
Community Advisor

@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

ng772
Level 1
Level 1
@evolytics_brian 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
evolytics_brian
Community Advisor
Community Advisor
@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?)