I try to use [node:og_group_ref], but that gives me the group node title and I need the GID, I am sure there should be a way to get it but I haven't found it
You can make the
[node:og_group_ref] token output the numerical ID instead of the group name by setting up the "Token" display mode for your content type and choosing the "Entity id" formatter for that field:
As shown in this comment in the issue queue:
- Go to "Structure → Content Types → [your content type] → Manage Display".
- Click "Custom Display Settings" below the field list, enable the "Token" option and save.
- Go to the new "Token" display mode in the horizontal tabs on the top.
- For your
og_group_reffield, set "Format: Entity id" and save.