and not override it on subsequent requests
Maybe custom dimensions in scope visit help?
We are using custom dimensions with the scope "visit".
However, from the documentation:
Custom Dimensions in scope “Visit” can be sent along any tracking request and are stored in the visit of a specific visitor. If you set different values for a given dimension during the lifetime of a visit, the last value set will be used. A typical example could be any device information or the version of the app the visitor is using.
Got it. You would probably need to set a cookie or something once you set the custom dimension the first time and then make sure it won't be overwritten anymore. However, this may be bit tricky since you won't know when it is a new visit. Eg visitor might visit website and you set custom dimension and cookie. Visitor comes back 40 minutes later => Piwik creates new visit, you would need to set the custom dimension again but the cookie you set would likely prevent this since you cannot know when Piwik creates a new visit.
To solve this, a custom Piwik plugin would be likely needed.
or is there?