WeChat for Dummies: User data and authorization

Everything you need to know about OpenID, UnionID, WeChat login and the ways you can learn to retrieve user data in WeChat.

Our “WeChat for Dummies” series tries to answer some of the most frequently asked questions we receive about WeChat from our clients and partners. We focus on topics such as User Data, Customer Service, CRM, Payment, Data Security, Data Analytics, and Personalization.

Have another topic or question you’d like us to write about? Get in touch.

What is WeChat Open Platform?

WeChat currently has four platforms to connect its 1 billion users with its business, app, or website:

WeChat Open Platform is a hub for mobile applications, website applications, Mini Programs, Official Accounts (OA) and third-party platforms.

What are OpenID and UnionID?

These are two important parameters mentioned all the time by product people and developers.

OpenID is an unique encrypted WeChat ID for each user of an OA (including Mini Program). Users have separate OpenIDs corresponding to different OAs. In Developer Mode, when subscribed users interact with an OA, the developer can obtain their OpenIDs and use it to get basic user information (gender, photo, location etc.)

UnionID is an unique ID to identify a single user under the same WeChat open platform account. If a developer possesses multiple mobile applications, website applications, and OAs (including Mini Programs), they can use a UnionID to differentiate the uniqueness of users. In other words, UnionID offers a mechanism for developers to acquire a user’s data from multiple platforms and attribute actions back to the specific user.

Open Platform is a hub for apps, OAs, MPs and 3rd party platforms
Open Platform is a hub for apps, OAs, MPs and 3rd party platforms

How to get OpenID and UnionID?

Ways to get OpenID:

  • A user subscribes to your OA
  • A non-follower visits an OA’s web page
  • A user authorizes WeChat access through app
  • A user authorizes WeChat access through Mini Program

Ways to get UnionID:

  • You’ll need OpenID and access_token to obtain UnionID (OA, Mini Program, PC or WeChat browser)

Note: To get access to a user’s UnionID, you first need to complete developer qualification verification and bind your accounts (OA, Mini Program and Applications) on WeChat open platform.

The value of OpenID

With an OpenID, you have access to the following user info:

  • Nickname
  • Profile photo
  • Gender
  • Location (city, province, country)
  • Language
  • Subscribe time (the latest subscribe time)
  • UnionID
  • Remark (set by OA operator)
  • GroupID (set by OA operator)
  • Tags
  • Subscribe source (e.g. OA search, OA migration, OA card share, QR code, payment page)
  • QR code scanning scenario
  • QR code scenario description

A data sample provided by WeChat

Note: Once a user has unsubscribed from your OA, you can’t pull their basic info anymore. To keep your user database up to date, you can set up automatic data synchronization with a certain frequency.

How can individuals and brands benefit from UnionID mechanism?

For individuals, the UnionID mechanism provides a seamless user experience across channels and devices, along with real-time communication and personalized offers:

  • Skip new account registration through WeChat login authorization
  • Instant and personalized customer service
  • Convenient status updates and reminders (e.g. delivery and transactions tracking)
  • Real-time data synchronization across OA, PC web and mobile app
  • Diversified membership benefits and rewards (users can redeem points across brands)
  • Enriched user experience (users can collect/transfer points from one platform to another)
  • Security (users get notified of any unusual activities associated with his UnionID through multiple channels).

For brands, unionID mechanism provides a closed-loop opportunity to understand, approach, convert and retain consumers.

  • Increase user retention rate through smooth onboarding
  • A better way to acquire and manage user data
  • Boost sales through cross marketing and scenario-based promotion
  • Improve data security
  • Accurate customer segmentation and targeted advertising (when a user authorizes WeChat login on a cosmetics app, WeChat can push beauty related ads accordingly)
  • Social commerce
  • Data security (users don’t need to log in with account and password)

How to enable WeChat login authorization?

WeChat login for third-party apps is based on the OAuth 2.0 standard (OAuth 2.0 is the industry-standard protocol for authorization).

After a user has given permission, the OA will receive a special API calling certificate (authorization access_token). Based on this access token, the OA may call APIs and obtain the user’s basic information.

  • Different landing pages for WeChat authorization
  • Different landing pages for WeChat authorization
  • Different landing pages for WeChat authorization

A simplified authorization flow:

  • Step 1: User clicks WeChat login and grants authorization.
  • Step 2: OA gets a temporary code.
  • Step 3: Based on the code, OA gets access_token from server.
  • Step 4: OA obtains users’ basic data with access_token and OpenID.

What is Silent Authorization?

Silent authorization means users will be automatically redirected to the configured business page without an authorization prompt. When the scope is set to snsapi_base, developers can obtain the user’s OpenID under silent authorization mode.

When scope is set to ‘snsapi_userinfo’, the user must first confirm their authorization. After receiving permission, developer can obtain the user’s basic information.

Note:

  • Before implementing WeChat login in your app, you’ll need to register a developer account on the developer portal, have your app approved, and obtain the corresponding AppID and AppSecret. Login functionality will be available after your application has been approved.
  • When users have followed an OA and enter the authorization webpage of this OA via its chat window or custom menu, silent authorization will prevail over manual authorization even when the authorization scope is set to snsapi_userinfo.
data authorization flow, source:RFC 6749
data authorization flow, source:RFC 6749
  • The common user flow of mobile app WeChat login authorization

How to grant the access to third party vendors in grace?

Is it possible to outsource your MP to other vendors without granting your AppID and AppSecret?

Yes!

Ask them to create a third-party platform on WeChat Open Platform. Here is how.

We manage some of our client’s products via thirt-party platform.

Note: If an OA authorizes a third-party to manage its web-based authentication, the OA does not need to change any settings.

Further Reading


Posted on July 05, 2018 in Technology

Share this post

Scan to open in WeChat

Stay tuned

Follow our newsletter or our WeChat account; every other week you'll receive news about what we're up to, our events and our insights on digital products, omnichannel, cross-border ecommerce or whatever the team fancies.

  • Add us on WeChat

  • Subscribe to our newsletter