Using data between step attributes
A step triggered event uses only data that is contained in the step in which it is triggered, which is a similar behavior to how hits are triggered.
To use data from step 1 in step 2, you must record the data from step 1 in an event and then reference the event in step 2.
For example, suppose your request data for a single hit looks like:
[appdata]
TLT_URL=/tealeaftarget.php
TLT_CUI_URL= /checkout
[StepAttributes]
{
"type": 4,
"offset": 8063,
"count": 1,
"event": {
"type": "change"
},
"target": {
"id": firstname",
"idType": -1,
"type": "INPUT",
"dwell": 2196,
"currState": {
"value": "MyName"
}
}
},
{
"type": 4,
"offset": 2293,
"count": 2,
"event": {
"type": "click"
},
"target": {
"id": "login:guest",
"type": "INPUT",
"subType": "radio",
"currState": {
"checked": true,
"value": "guest"
}
}
},
In the preceding data:
- [appdata] data is available through standard hit attributes.
- There are 2-step messages:
- Step 1: The first step identifies the change client event, in which the firstname form field is set to MyName.
- Step 2: The second step identifies the click client event, in which the login.guest element is set to guest.
A single step-triggered event cannot use data from both step 1 and step 2 at the same time. For example, you cannot create a step-triggered event that fires on the click message and records the value of the firstname value by using only step attributes.
To capture the value of Step 1 based on the condition of Step 2, you must:
- Create a step attribute to capture firstname's value on Step 1.
- Create an event that records the value of the step attribute for Step 1.
- Create an event that fires on the click for guest and uses the value for the Step 1 event for the guest value.