Event properties and lists

The ask:

Show which reports, by report name, users are selecting on this page. Unfortunately, this is not something i can glean from logs on the backend so i'm trying to do this with Pendo event properties

The situation:

<span id="chkBoxRptList" class="checkbox-list" onclick="javascript:chkboxRedirect()">
<input id="chkBoxRptList_0" type="checkbox" value="reportId|sessionId"/>
<label for="chkBoxRptList_0">Sample Report A</label>
<input id="chkBoxRptList_1" type="checkbox" value="reportId|sessionId"/>
<label for="chkBoxRptList_1">Sample Report B</label>
<input id="chkBoxRptList_2" type="checkbox" value="reportId|sessionId"/>
<label for="chkBoxRptList_2">Sample Report C</label>

I have a page (that the devs are not currently willing to rework for me) where users see a list of checkboxes to select the desired report(s), the report names exist only as labels which are sibling elements directly after the checkbox. To complicate this, the checkboxes and their respective labels all have id attributes, but these id's only indicate the position in the list (it's no better than nth-child), and the list of available reports differs by client meaning that the report in list position 2 may be "Report B" for one user and "Report Q" for another.

The solution/question:

I would like to capture a list of selected reports when the user clicks the "Run Report(s)" button, but the 6 event property limit is insufficient to do this and the lack of a report name attribute on the checkbox element or a selected class on the report label element makes this impossible anyway.

Currently I have a separate feature tag for each checkbox (0-14). Each of these feed the report name from the corresponding <label> element into a single event property named aprvl_report_name (Approval Report Name). From here i run a report against all 15 of these feature tags grouped by event property (aprvl_report_name), then download the CSV and pivot in Excel by the event property.

How can i make this cleaner and get a single feature tag that captures the sibling label of the clicked checkbox? Alternatively,how do i create a single tag that captures the reportId portion of the value attribute (excluding the pipe and sessionId) on the input element?




Please sign in to leave a comment.

Didn't find what you were looking for?

New post