{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Ads are everywhere and we can't escape them. They're on road billboards, shops, buses and buildings. If a world filled with ads sounds daunting and you want to hide indoors, just beware that ads will even jump out at you from your TV, computer, or phone.
It's likely that ads will be around with us for forever. Ads are often seen as annoying, but they can in fact be very helpful. If you are looking for a job, want to go somewhere fun, or are not sure what special thing you can get for your other half's birthday, ads may in fact provide some inspiration to you.
Nowadays, ads are transforming in appearance and purpose. Ads are becoming more intuitive as they are able to target specific audiences. For example, ads about quick fashion will target young adults, while some ads are typically pushed to males. This is an advanced advertising mechanism for brands, media, and users, where all can benefit. Someone gets traffic, someone makes money, and someone gets what they needed. Under ideal conditions, ads, under control and without harmful information spread, mean a lot for us.
As an app developer, I have been trying for a long time to request ads in my app to monetize the traffic and increase revenue. Recently, I encountered some obstacles with the ad traffic monetization data of my own app, and I have been searching for tools to obtain data and analyze ad performance. Collecting such data and then deciding how to analyze ad performance was no easy task, and this was complicated by the many tools and plugins needed to do so. I have used some of the tools found in the industry, but their performance rarely satisfied me.
But I eventually came across a very useful tool, the Publisher Service Reporting API of Ads Kit provided by HMS Core. The traffic monetization service helps me display various ad formats, such as banners, native ads, and rewarded ads, to my users. Routine data tracking is crucial for me to boost revenue. What's more, the Reporting API is key to obtaining ad monetization data, including ad requests, returned ads, impression rate, and click-through rate. I can analyze ad performance based on this data and adjust my monetization strategies accordingly.
But how did I acquire traffic monetization data? Here I'll tell you how I did it.
Implementation Procedure1. Obtain the client ID and key.
Before obtaining the monetization data, prepare an OAuth 2.0 client ID and key, which are needed for generating the access token passed for calling the Reporting API.
Note that the client ID and key are not those in App information (shown in the following red box) in AppGallery Connect, instead, the client ID and key of the server app created under HMS API services > Credentials on HUAWEI Developers.
a. Register as a developer and complete identity verification.
b. Sign in to the console, choose HMS API Services > Credentials, and create a project. If you already have a project, directly select it.
Click the drop-down arrow at the top, click New project, fill in the project name and alias, and click OK.
Select the project you created and click OK.
c. Choose OAuth 2.0 client ID.
If an OAuth 2.0 client ID and key already exist in your project, you can check whether the product type is server app by clicking Edit in the Operation column of the project. If so, skip step d.
If your product is not a server app, you should create an OAuth 2.0 client ID.
d. Select Server app from Product type, set Product name, App type, and Default language, and click Create. In the Note dialog box that displays Client ID and Key, click Confirm.
e. Go to HMS API services > My APIs, ensure that the project is the one you created, and click Add API from library.
f. Click Publisher Service Reporting API under App Services.
g. On the page displayed, click Enable to enable the API. Then you can call the API.
If you disable it and then enable it again, the setting does not take effect in real time due to page cache, for example. The setting will take about 6 to 10 minutes to take effect. If you have waited for longer time, try again.
2. Call the Publisher Service Reporting API.
a. Obtain an access token.
Call this API:
POST https://oauth-login.cloud.huawei.com/oauth2/v3/token
Request example:
Code:
POST /oauth2/v3/token HTTP/1.1
Host: oauth-login.cloud.huawei.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&
client_id=<Client ID>&
client_secret=<Client secret>
Screenshot:
Note that again: the client ID and key are those of the server app but not those of the mobile app created.
b. Call the Reporting API.
POST https://ads.cloud.huawei.com/openapi/monetization/reports/v1/publisher
If you are in Russia, call this API:
POST https://ads-drru.cloud.huawei.ru/openapi/monetization/reports/v1/publisher
Request example:
Code:
POST /openapi/monetization/reports/v1/publisher HTTP/1.1
Content-Type: application/json
Authorization: Bearer ***
Accept: application/json
Content-Length: 233
{
"start_date": "2022-06-01",
"end_date": "2022-06-28",
"filtering": {
"currency": "CNY"
},
"time_granularity": "STAT_TIME_GRANULARITY_DAILY",
"page": 1,
"page_size": 10
}
Screenshot:
As shown in the preceding figure, the data is successfully returned. For more request parameters and response parameters, click here.
In addition, I can customize data display formats to suit my specific app scenarios.
Some Problems You May EncounterWhy was message "access forbidden" returned during the API calling?
Some Problems You May EncounterWhy was message "access forbidden" returned during the API calling?
Possible causes:
You have not enabled the Reporting API.
You have not been authorized to call this API, or your permission has not taken effect yet.
The client ID and key used for obtaining the access token are not those of your server app.
My solutions:
1. Click Add API from library under My APIs and enable the Reporting API.
2. If you disabled and enabled the API again, you may need to wait for 6-10 minutes before the setting takes effect.
3. Check whether your client ID and key belong to a server app when you obtain the access token. To find out it, check the app type on the Credentials page. If it is not a server app, create one and use its client ID and key to request an access token.
ConclusionIf you also think obtaining ad monetization data and dealing with ad issues are annoying as me, you can try this tool to help you in daily work to obtain data and help you in subsequent operations. Hope that my procedure and experience can help more guys and you can also find out more useful methods.
Related
This article is from HUAWEI Developer Forum which you can obtain latest news about Huawei products
Forum link: https://forums.developer.huawei.com/forumPortal/en/home
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
AppGallery Connect is a one-stop open service platform for the entire app lifecycle, designed to facilitate enhanced, and accelerated app building and running, giving you a leg up on the competition. AppGallery Connect 10.5, the platform's latest version, provides for a wholly optimized user experience, including a home page with futuristic visual effects, cross-platform app management capabilities, and access to a broad array of services, such as App Messaging, Cloud Storage, and Auth Service. These updates give you the tools to better build and operate your apps.
Brand-new home page
The home page has assumed a fresh new, user-friendly layout. The My projects entry enables you to manage apps of different platforms; Hot services provides a glimpse at trending services, and More services displays a brief overview of all available services. Service cards also provide direct access to corresponding services, sparing you the hassle of having to search for a desired service, and find it from a lengthy list.
Visit https://developer.huawei.com/consumer/cn/service/josp/agc/index.html to try out the new version now. You'll notice that AppGallery Connect has designed a unique icon for each service, making it easier than ever to identity them.
App Messaging
This service provides invaluable assistance for refined operations, by sending contextual messages to active users when specific events are triggered, boosting user engagement and stickiness. In-app messages can work in tandem with your app's activities. For instance, if you have a shopping app, it can display a message instructing the user to claim coupons upon repeated taps on an item by a user when authorized or after message subscription by the user. Or if you have a reading app, the app can automatically display messages to intensive users who have read for more than half an hour in a single session, offering a 20% discount off of subscriptions. These types of messages can successfully boost your app's conversion rate.
You have the option of using a pre-set style, or customizing the display of your in-app messages. Image messages are recommended if the content in the message is relatively simple.
Banner messages contain a thumbnail, with the message title and body, and are displayed at the top of the screen. Users only need to tap on the banner message to be directed to the corresponding page.
Pop-up messages are recommended for richer, and more complex content, as they consist of an image, title, and body, as well as up to two buttons. Examples of each message type are shown below:
Cloud Storage
Cloud Storage incorporates a treasure trove of premium storage, upload, and download functions for a wide range of different objects, including images, videos, and audio files. The Cloud Storage capability is bolstered by the following attributes:
1. Airtight protections, enabled by declarative security and automatic encryption mechanisms;
2. High degree of stability, thanks to the implementation of resumable transfer and intelligent network acceleration;
3. Autoscaling, to provide for automatic resource scheduling and enterprise-level storage.
These characteristics allow for you to focus single-mindedly on improving the quality and user experience within your app – reserving all of the hassles associated with developing, deploying, maintaining, and expanding capacity for storage servers, or monitoring server indicators to ensure availability, reliability, and durability – for AppGallery Connect.
Enhanced Auth Service
Building a user authentication system is both challenging and costly.
Auth Service makes the construction of a secure and reliable user authentication system, a hassle-free and cost-effective process. Authentication capabilities are provided as services, meaning that you can assemble all of the services you need in code for your app, with minimal O&M work.
The new and improved Auth Service supports a wider range of authentication modes, including mobile numbers, email accounts, and Apple IDs, and can be integrated into iOS apps. If you opt to integrate Auth Service before August 1st, 2020 , You will be eligible to receive the following benefits:
1. 30,000 free SMS verification messages every month
2. Dedicated technical support during service integration
3. An opportunity for broad-based exposure, as a successful case study
The free quota of SMS verification messages applies only to the mobile number + verification code authentication mode. If you are interested, please send your information in the following format to [email protected]: [Company name + App ID].
AppGallery Connect also comes with a version history management function, which allows you to query and download the app versions you had previously developed, as well as an interaction center that provides for direct communication with the platform. We think that you'll agree that AppGallery Connect 10.5 is chock-full of surprises. Just sign in to explore a pioneering new version for app development!
You can also click the link below, to learn more about Auth Service, Billing, Version history, Interaction center, and other services.
https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-introduction
Introduction
Huawei Cab Application is to explore more about HMS Kits in real time scenario, use this app as a reference to CP during HMS integration, and they can understand easily how HMS works in real time scenario, refer previous articles:
Part1 (Login Module with Account Kit and AGC Auth Service)
Part2 (Dashboard Module with Map, Site, Location Kits and TomTom API)
Subscription Module
In-App Purchase Kit: Subscription page allows a Huawei cab user to subscribe the product from the product list and based on subscription products like Silver, Gold and Diamond. User will get benefits like remove the ads on the app, get priority support and also user will get top drivers and cars during cab booking.
Native Ad: Native ads displayed in-between cab booking history list items and removed the ads, once the user subscribes the product.
Analytics Kit: Report the subscription event details to Huawei analytics.
App Messaging: Sending promote offer for the subscribed users through app messaging.
HMS Kits Covered in Subscription Module:
1. Huawei In-App Purchase Kit
2. Huawei Native Ads
3. Huawei Analytics
4. AGC App Messaging
App Screenshots
Subscription
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
App Messaging
Native Ads
Huawei IAP Kit
In-App Purchases aggregates global mainstream payment methods and supports users to buy various types of virtual products and services within an app. IAP provides users with a convenient and high-quality experience and also helps developers to continuously earn revenue and create more business value globally.
Huawei IAP provides a product management system (PMS) for managing the prices and languages of in-app products (including games) in multiple locations.
Sandbox Testing
Sandbox testing allows you to complete end-to-end testing without real payments when you connect to Huawei IAP for joint commissioning. You can configure test accounts in the AppGallery Connect and allow these testers to perform sandbox testing.
Before testing, you need to add test accounts, which are real HUAWEI IDs, under Users and permissions in the AppGallery Connect. For details, refer to Managing Tester Accounts.
Huawei Native Ads
The Native Ad API allows you to build a customized experience for the ads you show in your app. When using the Native Ad API, instead of receiving an ad ready to be displayed, you will receive a group of ad properties such as a media content, ad title, ad source, call to action, and you will have to use them to construct a custom view where the ad is shown.
You will also get dislike this ad, rating, etc.
Huawei Analytics Kit
Huawei Analytics Kit is a one-stop data analysis platform for mobile app developers that utilizes data to drive daily app operations, bringing out dynamic details in a comprehensive, timely, and efficient manner. These cutting-edge solutions inspire out-of-the-box app service innovations, helping developers and operations personnel grow revenue and expand the reach of their apps.
Events: An event refers to the behaviour of a user with regard to a product, or in other words, a specific event is something that a user completes at a specific time point, place, and manner.
Real Time Example: Take the process of browsing for a typical item on a cab booking platform, as an example. Corresponding events can include tapping the registration button, accessing the product details app, and exiting the page. Therefore, event monitoring is, in essence, the detailed study of user behaviour within an app.
Huawei In-App Messaging
Huawei In-App Messaging is one of the simplest tools, but it is super useful to keep your active users. The service promotes them to keep using the app by sending messages that enhance or promote certain features of your app.
Note: Merchant Service
1. Choose Console > Developer center > Settings > Merchant Service.
2. You need to activate the IAP service for the first time, Huawei will ask for your bank account information and tax information for the payment.
3. Finally click submit. Verification of this information will take approximately 1-2 days.
Integration Preparations
You must complete the following preparations to Integrate Huawei IAP, Analytics, Ad Kits and AGC App Messaging.
Create an app in the AppGallery Connect.
Create a project in Android Studio.
Generate a signing certificate.
Generate a signing certificate fingerprint.
Configure the signing certificate fingerprint.
Add the app package name and save the configuration file.
Add the AppGallery Connect plug-in and the Maven repository in the project-level build.gradle file.
Configure the signature file in Android Studio.
Configuring the Development Environment.
Enabling Huawei IAP, Analytics, Ad Kits and App Messaging
1. Sign in to AppGallery Connect, select My apps, click an app, and choose Develop > Overview > Manage APIs.
2. Choose Earning > In-App Purchases. If it is the first time that you use Huawei In-App Purchases (IAP), click Settings.
3. Once configuration is successful, the page displays the public key used for subsequent payment signature verification and a parameter for configuring the subscription notification URL.
4. Choose Huawei Analytics > Project overview and Enable Analytics Service.
5. Choose Growing > App Messaging and Enable.
Configuration
1. IAP: Configure Product Information. Click the Operate tab. Choose Product Operation > Product Management from the navigation tree on the left, click the Products tab, and click Add Product.
Select Default currency and Default price (tax included) of the product and Save.
Activate the product in operation column from the product list.
2. Creating an App Message. Choose Growing > App Messaging > New.
Enter Name and Description for your in-app message.
Select Type as Image and Provide Image URL.
Select the App package and select sending target. This section is used to set conditions for matching target users.
For more information, you can visit https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0202367598227240326&fid=0101187876626530001
Conversion tracking can help you evaluate how effective your advertisements are, by analyzing whether user ad taps are converted into actions (such as browsing, registration, and purchase) that have tangible value to your business. It can also help you compare different channels and ad types, ensuring that you optimize ad placement, and improve the corresponding Return on Investment (ROI).
Here demonstrates how can we combine Dynamic Tag Manager (DTM) with HUAWEI Ads to provide next-level conversion tracking for ad landing pages.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
1. Creating a Conversion on HUAWEI Ads
Sign in to HUAWEI Ads, select Toolbox > Lead tracking, and click Add to create a conversion. Landing URL, Conversion goal, and DTM Conversion Name are all mandatory fields on the page that is displayed.
Notes:
l Landing URL: Enter the landing page URL to be tracked, which must be the same as that for your promotional task.
l Conversion goal: Select only one of the following conversion goals: Conversion and lifecycle, Form, Consulting, Other leads, Landing page performance, Game, Finance, and Social interaction.
l DTM Conversion Name: Enter a name related to the conversion tracking.
After entering the relevant information, click Submit to generate a conversion ID (saved for future use). Then click Using the Huawei Trace Code Manager to go to the DTM portal.
2. Configuring Tracking Tags Through DTM
If this is your first time using DTM, you can complete all necessary preparations by following the instructions in the Development Guide. After doing so, you'll be able to configure the tracking tags via DTM.
Click Create configuration, set the Configuration name and URL, and click OK. The JavaScript code will be generated. Copy the code and embed it to all web pages to be promoted (embedding is one-off and remains valid).
* Screenshots are from the test app.
Before managing related configurations, make sure that you know how to use DTM. Here is an example to help familiarize you with the operations. Let's assume that you want to track the number of user taps on the shopping cart button. You'll need to configure the conversion tracking for HUAWEI Ads into DTM. The trigger condition for the tracking is that the user taps the shopping cart button to go to the payment page. In this case, the following configurations should be implemented:
l Trigger condition: The user taps the shopping cart button, which triggers the tag to send the conversion tracking information.
l Tag: Use the built-in HUAWEI Ads conversion tracking tag and enter the conversion ID. When the trigger condition is met, the tag will be triggered to send the conversion information to HUAWEI Ads.
The detailed operations are as follows:
(1) Managing variables
l Click Variable > Configure preset variable on the DTM portal. Then select Page element > Element Text. For more information, please refer to Variable Management.
(2) Managing conditions
Click Condition > Create on the DTM portal. In the dialog box displayed, set Type to All elements, Trigger to Some clicks, Variable to Element Text, Operator to Equals, and Value to shopping cart. For more information, please refer to Condition Management.
(3) Managing tags
Configure the destination to which data is sent, after configuring the conditions for sending data. You can set HUAWEI Ads as the destination.
Click Tag > Create on the DTM portal. In the dialog box displayed, set Extension to HUAWEI Ads, Tracking ID to the above-created conversion ID, and Trigger condition to Clickshoppingcart, so that you can track the number of shopping cart button taps. For more information, please refer to Tag Management.
Conversion tracking is ready to go as soon as you have released a new configuration version. When a user taps the shopping cart button, an event will be reported to HUAWEI Ads, on which you can view the conversion data.
The evaluation of the ad conversion effects includes but is not limited to checking whether users place orders or make purchases. All expected high-value user behaviors, such as account registrations and message consulting, can be regarded as preparations for conversion. You can also add trigger conditions when configuring tags on DTM to suit your needs.
In addition, if the data provided by HUAWEI Ads does not end up helping you optimize your ad placement, after an extended period of time with an ad, you can choose to add required conditions directly via the tag management page on the DTM portal to ensure that you have a steady stream of new conversion data. This method provides for unmatched flexibility, and spares you from the need to repeatedly add event tracking. With the ability to add tracking events and related parameters via visual event tracking, you'll enjoy access to a true wealth of data.
The above is a brief overview for how DTM can help you track conversion data for landing pages. The service endows your app with powerful ad conversion tracking function, without even requiring the use of hardcoded packages.
To learn more about DTM, please visit:
l HUAWEI Developers
l Development Documentation
l Reddit to join the developer discussion
l GitHub to download the demo and sample code
l Stack Overflow to resolve integration-related issues
Have you ever encountered the following problems when serving ads:
You allocate a large ad budget but you don't know how well your ads are performing and whether you're getting the most out of your ad spend.
You don't know what valuable actions users take when they view your ads.
You don't know whether ad serving policies such as the ad serving channel and ad type need to be adjusted.
To resolve the aforementioned problems, you'll need to track your ad conversion.
What is ad conversion tracking?
Conversion tracking is a critical part of serving ads. It is a process of reporting important conversion information (such as OAID, timestamp, conversion action, and action parameters) that advertisers care about to the ads analytics platform in order to generate reports. These reports help you quantify the performance of your ads and track the quantity and quality of users acquired by different platforms and ad types, and their corresponding conversion effects, thus helping you find ways to improve how you serve ads.
For example, when using HUAWEI Ads to serve ads, you can use HUAWEI Dynamic Tag Manager (DTM) to set conversion tracking to track ad conversion channels and analyze conversion effects with ease.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
DTM is a tag manager system (TMS) that allows you to dynamically update tracking tags on a web-based UI to track specific events and report data to analytics platforms and ad attribution platforms. Visual event tracking in DTM is now the tool of choice for HUAWEI Ads web advertisers to track conversions on web pages.
Once you have integrated the DTM JavaScript code snippet or SDK into your app, simply configure a tracking code snippet for your web pages to collect conversion information. DTM has the following advantages when used for conversion tracking:
Fast setup: Getting DTM up and running is quick and easy: simply configure rules and add visual events to be tracked on the DTM web portal to quickly obtain data. This greatly shortens the configuration time compared with the traditional method of configuring tracking code for web pages.
High flexibility: If you need to adjust the ad serving policy or data to be collected after serving ads, all you need to do is to add related conditions on the tag management page on the DTM portal, which is more flexible and convenient because you don't need to repeat complex tracking code configuration or release an app update.
Multi-platform tracking: DTM supports conversion tracking for apps across different platforms, such as the Android and web platforms.
To configure HUAWEI Ads conversion tracking using DTM, perform the following operations. (Conversion tracking for web pages is used as an example.)
Obtain the tracking code snippet on the DTM portal and embed the code snippet into the pages to be promoted.
1. Create a conversion in HUAWEI Ads.
2. Configure conversion events in DTM and send them to HUAWEI Ads.
3. The procedure is as follows:
(You can click here to view the detailed procedure. Note that if the registration place of your ad account is in China, you need to submit a ticket online to apply to be added to the trustlist before using conversion tracking.)
A. Sign in to AppGallery Connect, obtain the tracking code snippet on the DTM portal, and embed the code snippet into the pages to be promoted.
a. In AppGallery Connect, click My projects and then Add project, enter a project name, and click OK. Then, click Add app, set Platform to Web and enter an app name, and click OK.
b. Go to Grow > Dynamic Tag Manager, click Enable Dynamic Tag Manager, enter a configuration name and URL to be promoted, and click OK. On the Install web page tracking tag page displayed, copy the code snippet and embed it into all pages to be promoted (including those on mobile phones). The code snippet needs to be embedded only once and will be valid permanently.
B. Create a conversion in HUAWEI Ads.
a. Sign in to HUAWEI Ads, go to Tools > Delivery assistance > Conversion tracking, click New conversion, select Lead tracking and then DTM, and click Continue. Set conversion information, such as Conversion actions, Conversion name, and Click attribution window.
b. Click Next. A conversion is created and its ID is generated. Record the conversion ID because it will be used for tag configuration in DTM later.
c. Configure conversion events in DTM and send them to HUAWEI Ads.
Sign in to AppGallery Connect, go to Grow > Dynamic Tag Manager, and create variables, conditions, and tags to generate a configuration or quickly complete configuration by adding visual events.
After completing configuration, you can release a configuration version for conversion tracking. Then, you can view related conversion events and data in a report in HUAWEI Ads.
In summary, DTM makes ad conversion tracking more efficient. In addition, DTM can be used for anti-fraud analysis and operations efficiency improvement. If you have any questions or would like to know more about the service, feel free to leave a message below.
To learn more about DTM, please visit:
>> DTM official website
>> DTM development guide
>> DTM codelab
If you have any questions, please submit a ticket online.
Does it support only web or both Android and Ios?
Basavaraj.navi said:
Does it support only web or both Android and Ios?
Click to expand...
Click to collapse
Hi, DTM SDK supports Android, IOS and web
HMS Core In-App Purchases can be easily integrated into apps to provide a high quality in-app payment experience for users. However, some developers may find that the payment screen of In-App Purchases cannot be opened normally. In this article, I will explain possible causes for this and provide solutions.
Scenario 1: In-App Purchases has been enabled on the Manage APIs page in AppGallery Connect, and the created product has taken effect. However, error code 60002 is recorded in logs.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Cause analysis
The payment public key is required for verifying the SHA256WithRSA signature of the In-App Purchases result. However, the developer has not configured a payment public key.
Solution
Check the following items:
(1) In-App Purchases has been enabled on the Manage APIs page. (The setting takes around half an hour to take effect.)
You can visit the official website to see how to enable the service.
(2) The public key switch is toggled on, and the public key is used correctly.
(3) The corresponding product category has been configured on PMS in AppGallery Connect, and has been activated successfully.
Scenario 2: Error 60051 is reported when the developer opens the subscription editing page in the member center.
According to the official website, error code 60051 indicates that a non-consumable product or subscription cannot be purchased repeatedly.
Cause analysis
After a subscription is completed, there is a refresh action when going back to the member center. An error will be reported if the subscription button is tapped again before the refresh occurs. The product can only be successfully subscribed to if the subscription button is tapped after the refresh. This is because if the refresh action is not triggered in time, cached data of the previous subscription will still exist. If another product is subscribed to immediately after a product is subscribed to, the ID of the previously subscribed product will be passed to the system instead of the newest product. As a result, an error is reported and the subscription editing page cannot be displayed due to product ID mismatch.
Solution:
Modify the timing for triggering the refresh action to prevent product subscription from occurring before the refresh.
Scenario 3: Error code 60003 is reported when a Huawei phone is used for payment debugging, but the product ID is correctly configured on PMS.
Cause analysis
Generally, error code 60003 indicates that the product information configured on PMS is incorrect. You can sign in to AppGallery Connect, click the desired app, go to Operate > Product Management > Products, and check that the corresponding product exists and mandatory information (such as the name, ID, price, type, and status of the product) is configured correctly.
In addition, you can check whether the product ID is correctly configured in the client code and consistent with that in AppGallery Connect. In particular, check that the field passed to the client code is correct.
Check whether the service region of the HUAWEI ID signed in on the Huawei phone supports In-App Purchases. To do this, call the Task<IsEnvReadyResult> isEnvReady() method.
Solution
After troubleshooting, the developer finds that the error is reported because the product ID passed to the client code is inconsistent with that in AppGallery Connect. After correcting the product ID in the client code, the issue is resolved.
Scenario 4: The payment screen is opened successfully when the checkout start API is called for the first time. However, after the payment is canceled, the payment screen fails to open when the API is called again.
Cause analysis
After a consumable product is purchased, the product can be purchased again only after the purchased product is consumed. Otherwise, error codes such as 60051 will be reported.
Solution
Redeliver the consumable product.
You need to trigger the redelivery process when:
The app launches.
Result code -1 (OrderStatusCode.ORDER_STATE_FAILED) is returned for a purchase request.
Result code 60051 (OrderStatusCode.ORDER_PRODUCT_OWNED) is returned for a purchase request.
Result code 1 (OrderStatusCode.ORDER_STATE_DEFAULT_CODE) is returned for a purchase request.
If the refund callback URL configured in the In-App Purchases configuration page is incorrect, reconfigure it correctly. You can click here for details.
In addition to the payment screen opening failure problem, another common problem is how to determine whether the sandbox environment is entered.
Scenario 5: A sandbox account is used for testing but no sandbox environment popup is displayed. How to check whether a sandbox environment is entered?
Cause analysis
Generally, a popup similar to the following will be displayed when the sandbox environment is entered.
The two mandatory conditions of the sandbox environment are met but still no sandbox environment popup is displayed. Does this mean that the sandbox environment is not entered?
The screenshot below shows relevant logs for the isSandboxActivated method.
According to the logs, the two mandatory conditions of the sandbox environment are met, which are:
The currently signed in HUAWEI ID is a sandbox account.
The version code is greater than that of the online version on AppGallery. (The APK has not been released to AppGallery. Therefore, the version code returned by AppGallery is 0.)
Theoretically, the sandbox environment has been entered. Are there other methods to check whether the sandbox environment is entered?
Solution
Check whether the sandbox environment is entered successfully using the following methods:
a) Check the returned purchase data, as shown in the screenshot below.
If the Huawei order ID specified in payOrderId begins with SandBox, the order is generated in the sandbox environment.
b) Check the payment report.
Check whether the payment report contains this order. If not, the order is generated in the sandbox environment. (Note: Data on the payment report is not updated in real time. If the order is placed on the current day, the developer can check the payment report on the next day to ensure accuracy.)
c) Clear the HMS Core (APK) cache.
You can try to clear the HMS Core (APK) cache. The system determines whether to display the sandbox environment popup based on relevant fields, which may not be updated in time due to the cache. You can go to Settings > Apps & services > Apps > HMS Core on the device to clear the cache.
References
In-App Purchases official website
In-App Purchases development guide