DMATRIX support for metadata

I am looking to find out if XGboost support storing any metadata in Dmatrix. Idea is to use this metadata to train model using a different loss function. So 4 segments of training data will train on 4 diffrent loss function/optimizations.

If not where all I need to make changes for xgboost/ DMatrix to support this feature