Best practices for integrating WeChat mini game subscription messages
Mini games are a hot spot in today's game industry, and more and more game companies are entering the mini game market.
Mini games are game products built on mini programs. They require no download and can be played instantly. Compared with app games, they have clear advantages: low development investment, incremental users, and user acquisition dividends.
WeChat subscription messages support personalized push by calling APIs, and can also connect to the AE Engage module for personalized and refined operations.
This article describes best practices for using the AE Engage module in mini game operations.
1. What are WeChat subscription messages
Built on WeChat's notification channels, WeChat provides developers with subscription messages that reach users efficiently, helping close the service loop and deliver a better experience.
Developers can ask users to subscribe to messages in the game. Developers need to record on their own backend whether a user subscribed successfully and how many times.
After a user subscribes to specific message content in a mini game, the developer can send a template message to the user from the backend through the message sending API. The user receives it in WeChat's Service Notifications.
Each time a user subscribes successfully, the developer can send that user one template message at a time the game considers appropriate.
2. Prepare the WeChat mini game backend
2.1 Prerequisites
Register a WeChat Mini Program and complete ICP filing and verification
Mini Program Service Category = Games
2.2 Get the APP ID and APP Secret
They are important identifiers and keys that keep mini programs and apps secure and stable
- Appid: The unique identifier of the app, mainly used for development and debugging in WeChat DevTools. It's generated automatically by the system, which ensures that each mini program or app is unique and makes it easy to index in databases for quick lookup and management.
- Appsecret: The secret key of the app, mainly used for operations such as data encryption and decryption. Like a password, it keeps data secure and accurate and improves system reliability and availability. The appsecret is generated according to general password security requirements to ensure its strength and security.
Developers must keep their Appid and Appsecret safe to prevent unauthorized access and data leaks, and to keep the mini program or app secure and stable.
2.2.1 How to get them
In the WeChat Mini Program admin console, go to [Development] - [Development Management] - [Development Settings]. When you log in for the first time, you can get the system-generated APPID and APPSecret
The APPSecret is not stored in plaintext by default. Store the secret safely after you get it for the first time
2.2.2 How to update them
The APPSecret is shown in plaintext only when it's first generated. If you forget or lose it, click Reset to get a new secret.
Only admins have permission to reset the secret.
Each account has a total of 10 reset opportunities per month, shared between Reset API call quota and this API. Each effective reset uses one opportunity;
⚠️ Note: When you reset the secret, update the secret of the corresponding channel in the AE Engage module and reconnect it. Otherwise, related operation tasks will stop working.
2.3 Set up templates
2.3.1 How to create templates
In the WeChat Mini Program admin console, go to [Subscription Messages] - [Public Template Library] to view the templates in the library. The WeChat mini game backend provides a huge library of subscription message templates. Select a template that fits your push scenario, choose the keywords you need, and click Submit to generate a custom template.
2.3.2 My templates
After you select and submit templates from the public template library, you can view all the templates that the current mini game can push as subscription messages in [My Templates].
The WeChat SubscribeMessage channel in the AE Engage module can pull and update all templates of the corresponding mini game.
Open the [Details] of a template to view the Template ID and the template parameters and their data types.
3. Connect to the AE third-party platform channel
3.1 Report the OpenID
To push template subscription messages to users through the AE push channel, you need to report the WeChat Mini Program OpenID to AE and bind it to a user property, so that operation tasks can push WeChat subscription messages. For technical details, see WeChat subscription message integration guide
3.2 Create a WeChat subscription message channel
3.2.1 Authorize the application
Use the Application Authorization entry to authorize calls to the WeChat Mini Program's template information.
The same mini program shares one APP ID and APP Secret, so you only need to authorize it once.
For how to get the secret, see:
Click Application Authorization in the upper-right corner of the Third-party Platform channel to open the page shown below. You can customize the Application Name and enter the APP ID and APP Secret of the mini program that you got in step 2.2.
If the information is correct, click Save and Connect, and the system shows Connected.
Once the AppID and AppSecret are verified, the access_token is automatically refreshed every two hours to keep the application connected.
3.2.2 Create a channel
Click + Create channel in the upper-right corner of Third-party Platform - WeChat SubscribeMessage to open the subscription message channel creation page.
-
Channel Name: The name of the WeChat subscription message channel
-
Select Authorized Application: When you create a channel, you can select an application whose connection is normal, and the channel automatically pulls all available subscription message templates from that application's WeChat backend. If the application's connection is abnormal, check it in Application Authorization first.
-
User OpenID: The ID type of the target users who receive the message. You can select a User Properties item (numeric or string property). Users whose push ID is empty are filtered out when the audience size is estimated. For how to report the OpenID, see the technical documentation.
-
Mini-program Settings: Settings for the mini program page that opens when users click the subscription message card. These are channel-level parameters and can be overridden at the task level.
- Mini-program type: formal (release version), developer (development version), or trial (trial version). Defaults to the release version if left blank
- Mini-program language: zh_CN (Simplified Chinese), en_US (English), zh_HK (Traditional Chinese), or zh_TW (Traditional Chinese). Defaults to zh_CN (Simplified Chinese) if left blank
- Redirect URL: The page that opens after users click the template card. It must be a page within this mini program. Parameters are supported (for example, index?foo=bar). If left blank, the template doesn't redirect.
-
Content Template:
Push messages for WeChat mini games can be delivered to users' WeChat messages only after users subscribe successfully.
After the application is authorized and connected, the channel can use the token to fetch all subscription message templates created in the WeChat backend at once. You can save the templates you need in the channel and select them in operation tasks.
Click Refresh template list to call the API again and get the latest template list for the channel.
- All types supported by content template parameters
The data types of template parameters are defined by the WeChat message template. The parameter types pulled from WeChat prevail.
| WeChat parameter category | WeChat data type | Mapped Engage input method | Description | Parameter length limit |
|---|---|---|---|---|
| thing.DATA | Thing | Dynamic text | Any combination of Chinese characters, digits, letters, or symbols | 20 |
| number.DATA | Number | Numeric | Digits only, decimals allowed | 32 |
| letter.DATA | Letter | Text | Letters only | 32 |
| time.DATA | Time | Time | 24-hour time format (year, month, and day can be added). Time periods are supported; join the two points in time with "~" | |
| date.DATA | Date | Date | Year-month-day format (24-hour time can be added). Time periods are supported; join the two points in time with "~" | |
| symbol.DATA | Symbol | Dynamic text | Symbols only | 5 |
| amount.DATA | Amount | Text | 1 currency symbol + up to 10 digits, decimals allowed, can end with the Chinese character for yuan | 11 |
| phone_number.DATA | Phone number | Text | Digits, symbols | 17 |
| car_number.DATA | License plate | Text | Up to 8 characters. The first and last can be Chinese characters; the rest are letters or digits | 8 |
| name.DATA | Name | Text | Up to 10 Chinese characters only, or up to 20 letters or symbols only | Chinese characters: 10 Letters: 20 |
| phrase.DATA | Chinese phrase | Text | Up to 5 Chinese characters | 5 |
3.2.3 Manage channels
-
Turn a channel on or off
- After you turn on the channel switch, the channel status is Connected if the application connects successfully. Otherwise, it's Abnormal.
- After a channel is turned on, you can select it when creating new tasks;
- After a channel is turned off, it can't be selected for new tasks (it doesn't appear in the drop-down). Running tasks end automatically, and tasks pending approval are withdrawn automatically.
-
Edit or delete a channel
You can edit or delete a channel only after it's turned off.
3.3 Create an operation push task
Select the WeChat SubscribeMessage channel to create a task
Select the Channel Type and Select the channel are two steps of the same dialog: click the WeChat SubscribeMessage card, the dialog switches directly to the channel list, select an enabled channel, and click Confirm to open the task editing page
In the push content, select the template you want and fill in the content to send
Save and submit. After approval, the operation task goes live.
3.4 Send Test
Test method 1:
At the bottom of Message Configuration on the task editing page, click Send Test to send a test message to the corresponding account without creating a task. The button is grayed out until all template parameters are filled in. In the dialog, enter the push ID corresponding to the channel's User OpenID property:
Test method 2:
Launch a real operation task and select target test accounts in the audience selection to push only to them. Other users won't receive it.
4. How the number of sendable subscription messages works
4.1 Scenario
When you send a test through a WeChat mini game channel, the first send may succeed while the second fails, with the message: user refuse to accept the msg.
4.2 Cause
WeChat mini games currently support only "one-time subscription messages". Each subscription allows only one message to be sent.
Subscription message types
(1) One-time subscription: After a user subscribes, one corresponding service message can be sent at any time with no time limit. Each subscription allows only one message.
(2) Long-term subscription: After a user subscribes once, multiple messages can be sent over a long period. Long-term subscriptions have very high qualification requirements. Currently, long-term subscription messages are open only to offline public services such as government services, healthcare, transportation, finance, and education, and will gradually be extended to other offline public services.
Each subscription allows only one message, but a user's subscription count can accumulate.
Example: Bind the subscription code of WeChat mini game template A to the "Gift Pack" button (each time the gift pack is opened, the template registration logic is called once)
Then each click on the gift pack button adds one to the user's subscription count
- The number of subscription messages a user can receive depends on how many times the user triggers the subscription mechanism in the game.
- For the same template message, user A may receive it multiple times (having accumulated multiple subscriptions), while user B may receive it only once (having accumulated only one subscription)
4.3 Recommendations
- For the same WeChat subscription message, active players receive more messages, while new or inactive users receive relatively fewer. You can combine it with other operation strategies to increase subscriptions in the mini game so that users receive more push messages.

