Hi Michael,
You can consider creating a data element which captures the value of this variable.
This data element can be referenced in your event based rule or custom code.
Here's some documentation on data elements for your reference.
Feel free to revert in case you have further queries.
Rahul