Track User Referrals

Balamurali Govindan Posted in General Discussion 3 years ago

Is there a way in the DB to find out from which user referral/invite did his/her friend join?

If UserA invited UserB, and if UserB registered, do we know in the system that UserB joined because of UserA?

Please help. We need some reporting, so users who invite get rewarded.

Replies
Hungarian Tamás Varga Replied 3 years ago

Excellent work, congratulations!

in Balamurali Govindan Replied 3 years ago

Thanks a lot Z-Man. Awesome. I will test this and let you know. Thanks Again. You made my day!

in Balamurali Govindan Replied 3 years ago

Thanks a lot Z-Man. Nice of you.

German Michael Zülsdorff Replied 3 years ago

Balamurali, you are right, I forgot that. ;)
That's accomplished by

ossn_register_callback('user', 'created', 'ossn_invite_addfriends');

Thus you can develop a new component which is using the same callback like

ossn_register_callback('user', 'created', 'invited_members_counter');

and your invited_members_counter function with a similar logic in the beginning as ossn_invite_addfriends.

Instead of creating new friend relations, your function needs to create/update a new member attribute (entity record) named like 'invited_members' or alike.
That's for the database part.
Next would be adding some code to display that count on the member's profile, the About page, wherever ...

Hungarian Tamás Varga Replied 3 years ago

This also interests me because it would be an excellent development.

in Balamurali Govindan Replied 3 years ago

Thank You for the reply.

However, when someone uses the link and they join (userB), I believe they automatically become the friend of the invited user (userA). So we don't need to capture the emails but on the registration of the userB when it adds the relationship friend to userA, is there a way to add/track this?

Please let me know. Sorry for asking crazy requirements. Any help would be greatly appreciated.

Thank You.

German Michael Zülsdorff Replied 3 years ago

Currently, none of these e-mail addresses are saved on inviting. And even if you would: It's not guaranteed that the invited user would use the same address on registering.