The primary reason we recommend using this method is that it separates the declaration of information from the execution of the actual tracking. This can help both at implementation time and during any debugging/maintenance periods. In the initial roll out, clients are able to insert code to capture any information deemed necessary into custom-named (read: meaningfully-named) context data variables. They do not need to know about eVars, props and events as the contextData variables can be translated in the s code. Result: code that client development team can understand, implement and maintain.
During the execution of the s_code, we now have a lot more saint kitts and nevis email list 10828 contact leads flexibility in what we can do with information before assigning it an eVar, prop or event.
Detecting the presence of a contextData variable is simply a case of using the type of operator to ensure it has been set (unset variables will return “undefined”). Once detected, we can combine it with other present variables and session conditions before deciding what SiteCatalyst should actually record.
Secondly, new versions of s_code just don’t seem to like randomly created properties attached to the s object. In the past, we would create custom s properties such as s.userId, however more recent versions of the SiteCatalyst libraries will destroy a lot of these properties during the loading and initialisation of the s_code object. The contextData object is treated more carefully, and gets retained throughout these processes.
Finally, the contextData paradigm is used across non-web platforms such as when using SiteCatalyst in a mobile application. Knowing how it works makes it easier to understand the requirements of these types of implementation.
Example: Tracking multi-stage forms
Tracking user progression through forms is usually done with a combination of eVars, props and events, which can be a lot for client developers to get their head around.
To simplify their workload, we simply get them to write out 2 contextData variables on each page of the form process:
Something to identify the current form (eg: s.contextData[“form.id”]).
A description of the current step (eg: s.contextData[“form.step”]).
The s_code file then contains some logic, usually in the form of a switch statement, that detects the presence of these particular values and assigns relevant values to eVars, props and events.