I am having a little problem.Well,I know how to let user share my website link on whatsapp.but can't able to figure out how to ensure that he/she actually shares it on whatsapp.
-
1I don't think there is an event to pick this up. The most you might be able to do is check on click and then once again when your page takes focus but even that, isn't ideal as you'd be assuming it has been shared. – Script47 Mar 04 '19 at 13:17
-
Even if you _could_ check, what would you use it for? If you're tying some reward to that (you get 50 unicorn points if you share…), anyone could just share it "to themselves" on some spam account. – deceze Mar 04 '19 at 13:22
-
Could you provide more details/context to the question? – Sondre Edvardsen Mar 04 '19 at 13:23
-
1@SondreEdvardsen If user has pressed "share on whatsapp" button on my website, he automatically goes to whatsapp but how do I ensure that he/she actually shares my website link with someone or not. – Yash Mar 04 '19 at 13:28
2 Answers
I think you can use some cheking on your url, for example www.yoursite.com/yourUser, when you share that on WhatsApp the App request the site to show some info, there in your code you can check the user agent and look for some whatsapp reference... then if you find it you can do whatever you want with that, but you need on your url something to identify the user to make the action...

- 41
- 5
I don't think there is a perfect solution for this, but we can get close by generating urls with a unique slug/parameter for each user. Then check the user-agent string for WhatsApp when someone requests the url. WhatsApp will probably try to load metadata from the url when the user is about to share. You could also filter out the users own IP address and wait for someone else to see it in WhatsApp to confim it has beed shared.

- 182
- 6