Home > Article > Backend Development > PHP counts user sources by promoting QR codes
In order to meet the needs of user channel promotion analysis, the public platform provides an interface for generating QR codes with parameters. Using this interface, multiple QR codes with different scene values can be obtained. After the user scans them, the public account can receive event push. When promoting users generate their own promotion QR code, they can bring the user's identity (such as user ID). Then when other people scan the QR code with UID parameters to follow the official account, the official account can obtain The parameters (i.e. UID) in the QR code make it easy to determine and trace the source of the user.
For the generation of QR code with parameters, please refer to the article: WeChat interface generates QR code with parameters
The user scans the QR code with parameters After scanning the QR code, there will be two situations:
1. The scanner is not following, then after clicking to follow, the official account will obtain the user's attention event (subscribe) and take out the parameter scene carried in the event ID (promoter UID), thereby knowing the promoter of the follower;
2. The scanner has already followed, then after scanning, the public account will obtain the scanning event (SCAN), and can also obtain the parameters carried in the event Scene ID (promoter UID).
As for how public accounts obtain events and respond, see the article: WeChat Message Management Passive Reply to User Messages
##
The above is the detailed content of PHP counts user sources by promoting QR codes. For more information, please follow other related articles on the PHP Chinese website!