I have a few follow-up questions about what you are trying to accomplish, but perhaps I can provide a few different answers to possible scenarios.
Updating the Profile
If you are hoping to store the variable with the user's profile, this can be accomplished "profile scripts." Profile scripts allow you to apply logic on top of any call to our system (see documentation here) and store the value within the user's profile. Example use-case: every time a customer purchases, increment their total_dollars_spent value within their profile.
The logic you will want to apply is to save a particular value when the conversion event fires. A conversion event can be identified looking for any call with one of the following parameters: orderId, orderTotal, or productPurchasedId (see documentation here).
Writing a dynamic values in your offer
You can pass information about the activity, the experience, the user's profile, and more by following the instructions here. This would allow you to (1) register the conversion, (2) run JS logic on the conversion event and write a value to the user's profile, (3) return a value from the activity, the experience, or the user's profile directly to the page (or server).