Adding a custom field to marketingData in orderForm

We want to add a custom field to the marketingData in orderForm. This field should appear in order details page(Admin) inside SALES AND MARKETING section. I tried below code but looks like we are not allowed to add a custom field which will appear in admin.

Adding customer class to order details page

function customData() {

  vtexjs.checkout.getOrderForm().then(function(orderForm) {

    let clientProfileData = orderForm.clientProfileData;

    let customerClass = clientProfileData.customerClass;

    let marketingdata;

    let marketingData = orderForm.marketingData;

    if(marketingData === null) {

        marketingdata = {}

    } else {

        marketingdata = marketingData;

    }

    marketingdata.customerClassField = customerClass;

    return vtexjs.checkout.sendAttachment("marketingData",  marketingdata);

  });

}

$(window).on('load', customData);

$(window).on('haschange', customData);

Hello Suraj,

Unfortunately I believe the only section of the Order Form where you can add custom information and/or fields would be within the customData field itself, as per our documentation on the subject.

To add things to the marketingData field, the only workaround I could think of would be to use an utm.