Automatic Tag Creation on logon

Is it possible to create a tag and group, then assign that tag to a group on logon if the tag does not exist?