Why don't you use the username to store the profile in a certain dir? That can be done with the %U option.
%g is the groupname of the process, which is the Samba server, which is root. You should use %G if you want the group name of the user (%U). The config is case sensitive.
%U = Username
%G = Groupname
%D = domain name
I hope this helps you, btw I got this from man smb.conf, you can use testparm to see which config defaults samba chooses for things you did not specify in you smb.conf.