spx-data

The spx-data attribute is a special attribute that can be used to pass data references to page states. The attribute uses an XML type syntactical structure and will parse the provided values into an object which will be made available in SPX events and session state.

Use Case

The spx-data directive is ideal for usage with third-party integrated solutions like analytics. A good appropriation use-case would be integrating something like a meta tracking pixel, wherein you’d use the spx-data structure to pass references to the pixel without needing to re-evaluate injected scripts.


Example

The spx-data attribute can be annotated on <a> link elements and uses a colon notation structure:

The above code sample would result be converted from kebab-case to camelCase


Usage

Each event will pass the data values in page state.