Scan event push


Scan event push

微信扫一扫


#Event push

It will be triggered when the user opens the product homepage, the user follows the product homepage or enters the public account, etc. Event push. The event will be pushed to the URL filled in by the merchant (log in to WeChat public platform => Developer Center settings). Developers can complete data statistics, user identification and other operations through event push to achieve more accurate operations.

If the WeChat server does not receive a response within five seconds, it will disconnect and reinitiate the request, retrying three times in total. Regarding retrying message duplication, it is recommended to use FromUserName CreateTime to deduplicate messages. If the server cannot guarantee to process and reply within five seconds, you can directly reply with an empty string. The WeChat server will not do anything with this and will not initiate a retry.

Open the product homepage event push

When the user opens the product homepage, whether by scanning the QR code or from other sources When the scene (conversation, collection or circle of friends) is opened, WeChat will push the event to the URL filled in by the merchant. The content pushed includes basic user information and code information corresponding to the product homepage.

Push XML example

<xml>
 <ToUserName><![CDATA[gh_4e47c9c9ecad]]></ToUserName>
 <FromUserName><![CDATA[okkeXs1nI-xU4ql8-5BXkv1f0gDo]]></FromUserName>
 <CreateTime>1438250110</CreateTime>
 <MsgType><![CDATA[event]]></MsgType>
 <Event><![CDATA[user_scan_product]]></Event>
 <KeyStandard><![CDATA[ean13]]></KeyStandard>
 <KeyStr><![CDATA[6901481811083]]></KeyStr>
 <Country><![CDATA[中国]]></Country>
 <Province><![CDATA[广东]]></Province>
 <City><![CDATA[揭阳]]></City>
 <Sex>1</Sex>
 <Scene>2</Scene>
 <ExtInfo><![CDATA[123]]></ExtInfo>
</xml>

Push parameter description

ParametersDescription
ToUserNameThe original id of the merchant’s public account.
FromUserNameThe user’s openid.
CreateTimeMessage creation time (integer).
MsgTypeMessage type, event.
EventEvent type, user_scan_product is the event to open the product home page.
KeyStandardCommodity coding standard.
KeyStrProduct code content.
CountryThe country set by the user in WeChat.
ProvinceThe province set by the user in WeChat.
CityThe city set by the user in WeChat.
SexThe user's gender, 1 is male, 2 is female, 0 means unknown.
SceneThe scene to open the product homepage, 1 is for scanning the QR code, and 2 is for other opening scenes (such as conversation, collection or circle of friends).
ExtInfoThe extinfo passed in when calling the "Get Product QR Code Interface" is the identification parameter.

Follow the public account event push

When the user follows the public account on the product homepage, WeChat will push the event to the merchant to fill in URL. The content pushed includes the basic information, time, attention scenes and corresponding code information of the following users.

Push XML example

<xml>
  <ToUserName><![CDATA[gh_fbe8a958756e]]></ToUserName>
  <FromUserName><![CDATA[otAzGjrS4AYCmeJM1GhEOcHXXTAo]]></FromUserName>
  <CreateTime>1433259128</CreateTime>
  <MsgType><![CDATA[event]]></MsgType>
  <Event><![CDATA[subscribe]]></Event>
  <EventKey><![CDATA[scene|keystandard|keystr|extinfo]></EventKey>
</xml>

Push parameter description

ParametersDescription
ToUserNameThe original id of the merchant’s public account.
FromUserNameThe user’s openid.
CreateTimeMessage creation time (integer).
MsgTypeMessage type, event.
EventEvent type, subscribe is to follow the official account event.
EventKey" segmentation. ①scene represents the scene: scanbarcode is the code scanning scene, scanimage is the cover (image) scanning scene. ②keystandard represents the product coding standard: barcode is the barcode . ③ keystr represents the product coding content. ④ extinfo represents the extinfo passed in when calling the "get product QR code interface", which is the identification parameter.

Enter the official account event push

When the user enters the official account session from the product homepage, WeChat will push the event to the merchant Fill in the URL. The content pushed includes the user's basic information, time, scene of interest and corresponding barcode information.

Push XML example

<xml>
  <ToUserName><![CDATA[gh_fbe8a958756e]]></ToUserName>
  <FromUserName><![CDATA[otAzGjrS4AYCmeJM1GhEOcHXXTAo]]></FromUserName>
  <CreateTime>1433259128</CreateTime>
  <MsgType><![CDATA[event]]></MsgType>
  <Event><![CDATA[user_scan_product_enter_session]]></Event>
  <KeyStandard><![CDATA[ena13]]></KeyStandard>
  <KeyStr><![CDATA[6954767461373]]></KeyStr>
  <ExtInfo><![CDATA[]]></ExtInfo>
</xml>

Push parameter description

ParametersDescription
ToUserNameThe original id of the merchant’s public account.
FromUserNameThe user’s openid.
CreateTimeMessage creation time (integer).
MsgTypeMessage type, event.
EventEvent type, user_scan_product_enter_session is the official account entry event.
KeyStandardCommodity coding standard.
KeyStrProduct code content.
ExtInfoThe extinfo passed in when calling the "Get Product QR Code Interface" is the identification parameter.

Asynchronous push of geographical location information

When a user opens the product homepage, WeChat will asynchronously push the user’s real-time geographical location information The event form is pushed to the URL filled in by the merchant. Merchants can use this information for data analysis to form differentiated operation plans or guide production.

The geographical location information pushed is at the "province" level, such as Guangdong Province. Due to the user's network speed, the response speed of asynchronous push may be slower.


Push XML example

<xml>
  <ToUserName><![CDATA[gh_fbe8a958756e]]></ToUserName>
  <FromUserName><![CDATA[otAzGjrS4AYCmeJM1GhEOcHXXTAo]]></FromUserName>
  <CreateTime>1434541327</CreateTime>
  <MsgType><![CDATA[event]]></MsgType>
  <Event><![CDATA[user_scan_product_async]]></Event>
  <KeyStandard><![CDATA[qrcode]]></KeyStandard>
  <KeyStr><![CDATA[lincolntest2]]></KeyStr>
  <ExtInfo><![CDATA[123]]></ExtInfo>
  <RegionCode><![CDATA[440105]]></RegionCode>
</xml>

Push parameter description

ParametersDescription
ToUserNameThe original id of the merchant’s public account.
FromUserNameThe user’s openid.
CreateTimeMessage creation time (integer).
MsgTypeMessage type, event.
EventEvent type, user_scan_product_async is an asynchronous event.
KeyStandardCommodity coding standard.
KeyStrProduct code content.
ExtInfoThe extinfo passed in when calling the "Get Product QR Code Interface" is the identification parameter.
RegionCodeThe user’s real-time geographical location information (currently only accurate to the provincial level), the corresponding details can be found on the National Bureau of Statistics website: http:// www.stats.gov.cn/tjsj/tjbz/xzqhdm/201504/t20150415_712722.html

Product review result push

#Submit the product for review. After the review is completed, WeChat will push the review results in the form of an event Go to the URL filled in by the merchant.

Push XML example

<xml>
 <ToUserName><![CDATA[gh_404e58ec528e]]></ToUserName>
 <FromUserName><![CDATA[od_ikt8qi21-hVTtYgm8xSfTLH5w]]></FromUserName>
 <CreateTime>1450429257</CreateTime>
 <MsgType><![CDATA[event]]></MsgType>
 <Event><![CDATA[user_scan_product_verify_action]]></Event>
 <KeyStandard><![CDATA[ean13]]></KeyStandard>
 <KeyStr><![CDATA[6901481811083]]></KeyStr>
 <Result><![CDATA[verify_ok]]></Result>
 <ReasonMsg><![CDATA[]]></ReasonMsg>
</xml>

Push parameter description

ParametersDescription
ToUserNameThe original id of the merchant’s public account.
FromUserNameScan the review system.
CreateTimeMessage creation time (integer).
MsgTypeMessage type, event.
EventEvent type, user_scan_product_verify_action is the audit result event.
KeyStandardCommodity coding standard.
KeyStrProduct code content.
ResultReview results. verify_ok means the audit passed, verify_not_pass means the audit failed.
ReasonMsgThe reason why the review failed.