Group by custom variable

Hi there,

I am working on a ecommerce project which tracks product sharing action (using custom events) . Would I be able to group the event by merchant ID (passed by custom variable)?

Thanks.