A case study of HMS In-app Payment Attribution Using Huawei Ads Campaign & Analytics

Wei Chung Chuo
HMS Ecosystem
Published in
10 min readJan 24, 2023
Illustration by fatmawatilauda70555 on vecteezy.com

Introduction

Huawei Mobile Services (HMS) provides an array of powerful features to developers to increase user acquisitions and conversions. Huawei Ads and Analytics Kit are two of the best tools to achieve such a goal. Depending on the revenue goals, developers can combine different HMS SDKs and Huawei Ads to drive user engagement, converting them into paying customers. There is an abundance of online guides to integrate different HMS kits and launch Huawei Ad campaigns, by far we haven’t found any detailed article to explain how to put them together and calculate the user conversion rate attributed to an ad. We think it is important to provide an end-to-end case study to use Huawei Ads for app downloads and installation, use in-app purchases (IAP) to begin premium content trial and payment, attribute the key events, and finally conversion tracking. This document is intended for developers who have technical knowledge of Android app publishing, HMS SDK integrations, ads creation and management, and attribution tracking. You can leverage this knowledge to create your own customized solutions, gauge the effectiveness of Huawei Ad campaigns, analyze data to increase revenues. If you are new to Huawei Ads and HMS kits (IAP, Analytics), you can refer to the introduction at the bottom of the article.

Case Study

Let’s dive into the case study in more detail. We recently supported a developer who has a published AppGallery app with premium features that are available to monthly subscribers. The IAP kit was integrated and a 7-day trial subscription is configured on Product Management (AppGallery Connect > My apps > Operate > Products > Product Management). The user has seven days to try the premium features. If they do not cancel the trial, they will be charged at the end of the trial period through their preferred payment method registered in the Huawei Account.

To promote the app, the developer used Huawei Ads to run ad campaigns such as display ads which direct the new users to app detail page in AppGallery. After the app is successfully installed, the users who are interested in the trial promotion will click through the IAP trial subscription and complete the transaction. Do note that at this point, the developer is not actually generating any purchases because the users are just trying out the features, they can cancel the trial at any time. The actual purchase only happens 7 days after the trial has ended, which the user is charged.

Attribution Requirements

From an operation standpoint, the developer really wants to know how many users started a trial IAP subscription and how many real purchases actually happened. Plainly speaking, the goal is to capture how many users begin the trial and converted into paying subscribers. If the two events can be captured, the conversion rate (number of users who started the trial / number of users who completed the first subscription payment) can be calculated. With this conversion rate, the developer can attribute it to the Huawei ads, analyze the ROI of each campaign (messages, target, time, etc.), optimize future campaigns, and plan the advertisement budgets.

The objective is simple but it is not straightforward to implement due to two challenges:

  1. Huawei Analytic Kit can automatically capture the IAP start trial event but it cannot capture the event when the payment is charged because the event happens at the HMS IAP backend service, not within the app.
  2. Huawei Ads and Huawei Analytics are two separate cloud platforms for different purposes, the start trial and payment events are captured by Analytics platform. Ads platform is responsible for creating and managing ad campaigns. The developer must connect the platforms together to see the conversion numbers attributed to each campaign.

Two Possible Solutions

There are a few solutions to capture the IAP subscription payment event, we suggest the developer to integrate API for Sending Key Order or Subscription Event Notifications via Notification Service. This API is used by the Huawei IAP server to send key event notifications about a subscription to the developer’s app server via HTTPS POST. Upon receiving this request, the payment information can be logged and sent as a custom event to HMS Analytics platform. This method can precisely capture when a trial user successfully converted into a paying customer.

If the developer doesn’t need to capture the exact moment the payment occurred, they can use Analytics SDK in the app to report a custom event when the app confirms that the user’s subscription is active for the first time. Once confirmed, send a custom Analytics event and postback to the Huawei Ads platform.

Connecting Huawei Ads with Analytics For Event Postback

We have learned from a few developers’ feedback that they don’t know how to connect both platforms and have a misconception that they should use the Analytics platform to view the conversion rate. The correct solution is they should use Huawei Ads console for this purpose because Analytics console doesn’t collect the Huawei Ads information, if they use this platform, there is no way to attribute the conversion to the corresponding ad campaigns and analyze the effectiveness of the campaigns. We know how to report the custom payment event to Analytics console, now we need to make sure that Huawei Ads platform receives the same event in order to calculate the conversion rate. Here is an overview of the process.

Please follow the instructions below to connect the analytics data with Huawei ads.

1. Create an association in HUAWEI Ad, go to Tools -> Delivery assistance -> Analytics association

2. Click New association. Choose Drive users to > App, choose your app in the App dropdown, Tool provider > Huawei Analytics.

If you select Smart Tracking, HUAWEI Ads will automatically create a conversion you want, and save the data. A link ID will be generated. Enter the key generated after the association and set the data postback on Huawei Analytics conversion tracking platform.

3. A new association key (aka HMS Analytics Link ID) will be generated. Please copy/save this key and add it to Huawei Analytics conversion tracking platform later to enable event postback.

4. Create a conversion tracking in HUAWEI Ad, go to Tools -> Delivery assistance -> Conversion tracking.

5. Click New conversion, fill in Conversion name, App, Conversion action > Payment (HMS) and click Submit.

6. Enable Report ad identifier in HMS Analytics: Go to AGC -> My project (select an app) -> Huawei Analytics -> Management -> Analysis settings: enable Report advertising ID.

7. Create custom events: Go to Management -> Events -> Event management tab. Click New -> Custom (create a custom event) -> Save to the custom event.

8. Go to Huawei Analytics -> Management -> Events. On the Event management tab page, enable Mark as conversion event for the events you want to send back. You can enable or disable Event switch for an event. After being disabled, the event will not be analyzed or included in reports like audience analysis or funnel analysis reports.

9. Go to Huawei Analytics -> Management -> Events. Click the Conversion event configuration tab, click Add.

10. In the Configure tab, for Platform select Huawei Ads, on App select your app, on Link ID (the key obtained after the advertiser links HUAWEI Analytics in HUAWEI Ads) enter the key obtained from HUAWEI Ads (step 3 above).

In Configure panel — Lists all conversion events of the app, as well as the corresponding HUAWEI Ads event IDs and descriptions to link both platform events together. For example, to track conversion between a user completed IAP trial subscription and successfully paid after the trial ends, select $InAppPurchase, select the mapped event definition “A user start” and event ID “startTrial” in HUAWEI Ads. Then select custom event “purchasePayment”, select the mapped event definition “A user pays” and event ID “paid” in HUAWEI Ads.
Note: You need to manually report custom event to Huawel Analytics.

Please note that Huawei Ads conversion event definitions are different from Huawei Analytics, do refer to Conversion data ID and definitions in Huawei Ads document to map Analytics events to the “Indicators” in Huawei Ads. If you cannot find the correct indicators, please map the exact predefined or custom events in Huawei Analytics. Here are some examples:

Huawei Ads Conversion Data

Display and Calculate the Conversion Rate

Here are the steps to show the conversion data columns for the ad campaigns.

1. Click Customize columns.

2. Search for “Trial use start” (startTrial) & “Payments” (paid) and add them to the Campaigns columns (the search box is case-sensitive).

After the ad campaign is completed, the developer can calculate the conversion rate by dividing “Payments” by “Trial use starts”, in this example it is 35.4% (35 / 99). Based on the conversion rate attributed to the ad campaign, the developer can decide if they are going to continue similar campaigns or revise the messaging, budget, etc. to improve the revenue.

Conclusion

Through this article, you have learned how to capture the IAP trial subscription start and payment events, report to Analytics platform, postback to Huawei Ads, use Ads console to display the conversion data and calculate the conversion rate, ROI for each ad campaign. You can apply similar techniques to capture more insights about user behaviors, and understand which advertisement messaging works best for each market. Through the Huawei HMS SDK integrations and Huawei Ads, you can gather valuable insights and grow your app revenues.

Reference:
Huawei Analytics in Huawei Ads App Tracking
Overview of App Tracking and conversion in Huawei Ads
Conversion data ID and definitions in Huawei Ads

Huawei Ads is a paid presentation service for developers to advertise their apps. Many global top developers have already integrated Huawei Ads, which support display ads, search ads, and ads shown on Huawei AppGallery. With over 730+ million monthly active users, 220+ global markets, 83+ million premium users, you can effectively target users who have demonstrated an especially high level of engagement and convert them into paying customers. You can sign up an account here to begin creating ad campaigns to target the users. Please click here to learn more about ad management, optimization and billing. You can also visit the Huawei Ads Classroom to watch free video courses.

HMS In-App Purchases (IAP) Kit allows you to sell digital products and content right inside your app. All you need to do is to integrate the IAP SDK, and execute its API call to launch the EMUI IAP checkout screen. The system purchase user interfaces will guide the user to complete the purchase. Upon successful purchase callback, you just need to handle the logic to allow users to begin using your products or premium content. You can offer consumables, non-consumables and subscription products in your app. This document will focus on the trial subscription product use case. Head over here to read more about SDK integration and setting up your IAP product information in AppGallery Connect.

HMS Analytics Kit is an SDK and cloud analytic platform for mobile apps, web apps, quick apps, quick games, and mini-programs. The SDK collects user behavior and event data, sends them to Analytics platform and it can generate data dashboards and analysis reports on user retention, users, user behavior, user lifecycle, device info, etc. It also offers intelligent analysis so the developer and their marketing personnel can optimize their ad campaigns, improve user experience and drive business growth. You can learn more about Analytics kit here.

--

--

Wei Chung Chuo
HMS Ecosystem

Futurewei Technologies PWABuidler contributor. W3 Immersive Web Working Group participant.