Custom click properties

Log your own specific data for click tracking.

What properties can you add

The data-recording-click-props attribute can be added to any HTML element. When a click occurs on an element, the DOM tree is traversed from the element up to the body element. The content of each of the attributes is merged into a single object.

The content of the data-recording-click-props attribute is expected to be a JSON object.

<div data-recording-click-props='{"key1":"val1","key2":42,"key3":true}'>
    <a data-recording-click-props='{"key4":"val4"}'>
        Link
    </a>
</div>

📘

Pay attention to the formatting of single and double quotes. Other formatting of quotes is not supported.

When the link is clicked, the click properties contain values from the attributes in addition to other values, such as from the Identify API.

{
   "key1": "val1",
   "key2": 42,
   "key3": true,
   "key4": "val4"
}

Did this page help you?