W
W
WebDev2019-12-23 16:33:46
API
WebDev, 2019-12-23 16:33:46

How to track that a user has subscribed to a page on a social network?

I have seen many times how sites offer some kind of service for a subscription to social networks. For example, "follow us on VK and get a promotional code." And here is a link to the page in VK. That is, a person must go to the social network, subscribe there, return to the site and receive a promotional code.
How is this implemented? How do they track what I subscribed to?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-12-23
@kirill-93

There is a VK API method groups.getMembers Using it, we get an array of user IDs, look for the desired user there (it is assumed that we know who should have subscribed), then, depending on whether the user is subscribed or not, we perform certain actions. 5e00c85f36c7c668150887.png
There is also the groups.get method here we get the list of communities of the specified user. I think here you will guess how to use it yourself) 5e00c86680f9c502676552.png
+ Callback API
Allows you to receive data about various events in the group.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question