@yingduo-liu as far as I know, you cannot do it with wixMembers_onMemberCreated. You should capture the id on the frontend.
import wixLocation from 'wix-location';
const recommenderId = wixLocation.query?.recid;
Now, if you’re using custom registration it’s pretty easy, run the registration function and when it’s got returned save the value to your collection.
If you’re not using a custom registration, you should write some code, so onLogin if there’s recommenderId check the Members/PrivateMembersData collection if the _createdDate of this member is equal to the lastLogin value (which means this login event is also the registration event) and then save the recommenderId to your collection (the collection where you manage the score).
See also: