Groupings can only be done on database objects, so you’ll need to convert your list of Tags from an option set to a Datatype.
Alternatively you could use some javascript to establish this, seeing as it’s happening on the client-side anyway.