Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss: Data Elements' runtime evaluation cannot handle dynamic data element values #125

Open
yuhui opened this issue May 25, 2021 · 2 comments

Comments

@yuhui
Copy link

yuhui commented May 25, 2021

Expected Behaviour

Data elements with values that are dynamic will return the same value when the user's desired action has executed.

Actual Behaviour

Data elements with values that are dynamic are evaluated when components that use them are executed, which may not correspond with the user's desired action.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

For both of the following examples:

  1. Create a data element of Core > Random Number type. Leave the data element configuration with its default values. Do not set any default value. Leave its Storage Duration to "None". Save it as the data element "random number"
  2. Create a rule with a Core > DOM Ready event. No other events are required. No conditions are required. Actions will be added in the below examples.

Using the Adobe Analytics extension as an example:

  1. In the extension configuration, set a global variable, e.g. "Page Name", and set its value to %random number%.
  2. In the "DOM Ready" rule, add a "Set Variables" action. Add a variable, e.g. "eVar1", and set its value to %random number%.
  3. In the same "DOM Ready" rule, add a "Send Beacon" action to send a s.t() (pageview) beacon.

Using the Facebook Pixel extension as an example:

  1. In the extension configuration, set the "Pixel ID" field to %random number%.
  2. In the "DOM Ready" rule, add a "Send Lead Event" action, and set its "Value" field to %random number%.

Platform and Version

All

Sample Code that illustrates the problem

See this attached Launch container: container.js.txt.
This container contains both of the above examples together.

Live demo at https://jsfiddle.net/yd0a9zLx/2/

Logs taken while reproducing problem

NA

Issue Elaboration

(Using Adobe Analytics as an example.)

A Launch user could expect that, when an Adobe Analytics beacon is sent, the variables that are sent will be evaluated at the moment when that beacon is sent. So when his variables can have different values at different moments (i.e. "dynamic"), he would expect that the "final" value is the one that is sent in the beacon.

This is the problem: If that dynamic data element had been used to set a global variable in Adobe Analytics' extension configuration, then Adobe Launch evaluates that data element's value at the moment when the configuration module's code is executed. (FWIW this is documented at the developer documentation at https://experienceleague.adobe.com/docs/launch/using/extension-dev/web/views.html?lang=en#replacing-data-element-tokens.) Then, when the "Send beacon" action is run, the global variable will be tracked with that old value, instead of whatever value the data element could have evaluated to at that action's runtime moment.

This might not be obvious to the Launch user who is unaware of the inner technical workings. As a result, what he expects -- dynamic data elements are evaluated when the beacon is sent -- is different from reality -- dynamic data elements are evaluated when the corresponding module is run.

Related story from Jennifer Kunz.

Possible Solution

Introduce a component-level setting, "Evaluate data element at runtime", that can have a true or false value.
If true (default value): the current behaviour is used, i.e. data elements are evaluated when that component's module runs.
If false: data elements are not evaluated when that component's module runs. Instead, Launch leaves it as the data element reference. I.e. instead of evaluating %data element% to the current value, it leaves its value as %data element%.

One complication of this is that extensions do not have component-level settings. So this will need to be a new feature, if this solution is accepted.

@thebenrob thebenrob added this to Incoming in Reactor Open May 26, 2021
@thebenrob
Copy link

thebenrob commented May 26, 2021

@adobe export issue to Jira project PDCL as Story

@github-jira-sync-bot
Copy link

github-jira-sync-bot commented May 26, 2021

Jira issue PDCL-6137 is successfully created for this GitHub issue.

@thebenrob thebenrob moved this from Incoming to Backlog in Reactor Open Jun 9, 2021
@github-jira-sync-bot github-jira-sync-bot changed the title Web properties: Data Elements' runtime evaluation cannot handle dynamic data element values Discuss: Data Elements' runtime evaluation cannot handle dynamic data element values Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants