Home >Backend Development >PHP Tutorial >PHP counts user sources by promoting QR codes

PHP counts user sources by promoting QR codes

小云云
小云云Original
2018-03-20 14:39:431837browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn