Expert: How to Integrate Huawei Ads with GameAnalytics in Unity (Part-2) - Huawei Developers

Introduction
In this article, we will learn GameAnalytics integration in Unity Game.In previous article, we learnt about some of the features provided by the GameAnalytics.In this part-2 we will implement the Huawei Ads kit, will know practivcally how GameAnalytics helps Huawei Ads events like Ad opened, Ad shown, Ad clicked and Ad failed to show, which can be easily recorded by GameAnalytics and also we will look into SourceEvents and Remote configuration, and other useful features of GameAalytics which makes easy to get custom reports on the various filters you desired.
Development Overview
You need to install Unity software and I assume that you have prior knowledge about the Unity and C#
Hardware Requirements
A computer (desktop or laptop) running Windows 10.
Android phone with API Level 21 or latest and USB cable, which is used for debugging.
Software Requirements
Java JDK 1.7 or more installation package.
Unity software version: 2020.1.15f1.4895 or latest installed.
Integration Preparations
Create Unity project.
{
"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"
}
2. Download GameAnalytics plugin.
3. Download HMS plugin.
4. Create project in AG-Console
5. How to integrate Huawei Ads in Unity
6. Choose Assets > Import package > Custom package select GameAnalytics package file and
click OK.
How do I trigger Ads Events?
Ads Events supports only IOS and Android. The GameAnalytics ad event needs to invoke when certain events happen for implemented ad sdk.
An ad sdk has callback methods activating code when certain things like ad show and ad click activated. GameAnalytics makes easy to capture these call-back events to be recorded one has to call GameAnalytics sdk when these delegates called.
The examples below describes how to implement this for the ad-types.
Rewarded video
Interstitial
Bannner
[ICODE]
GameAnalytics.NewAdEvent([URL='https://gaadaction.show/']GAAdAction.Show[/URL], GAAdType.Interstitial,"onAdShow", ad.getAdId());
GameAnalytics.NewAdEvent(GAAdAction.Clicked, GAAdType.Interstitial,"unityad", ad.getAdId());
GameAnalytics.NewAdEvent(GAAdAction.FailedShow, GAAdType.Interstitial, "unity ads failed to load ", ad.getAdId());
[/ICODE]
How do I trigger Impression Events?
Impression events are used to get impression data from different ad networks. Currently the following ad networks are supported:
MoPub
Fyber
IronSource
MoPub
To record impression data from MoPub, add the following code inside the Start function and the SDK will send automatically the impression events for you.
void Start ()
{
GameAnalytics.SubscribeMoPubImpressions();
}
Fyber
To record impression data from Fyber, add the following code inside the Start function and the SDK will send automatically the impression events for you.
void Start ()
{
GameAnalytics.SubscribeFyberImpressions();
}
IronSource
To record impression data from IronSource, add the following code inside the Start function and the SDK will send automatically the impression events for you.
void Start ()
{
GameAnalytics.SubscribeIronSourceImpressions();
}
How do I fetch Remote Configuration value?
GameAnalytics provides remote configuration which allows user to configure key pair values from the remote place and also it allows user to Schedule that is set start date ad end date of the configuration.
String remoteValue = GameAnalytics.GetRemoteConfigsValueAsString("Test");
How can I download reports?
GameAnalytics allows you to various filter option and which makes user to predict and take decision based on the analysis report, you can download various kind of reports as show in the below image.
Result
Tricks and Tips
Make sure you have downloaded latest plugin.
Make sure that GameAnalytics Object is created.
Make sure that required permissions are added in Manifest.
Conclusion
In this article, we have learnt how to integrate Huawei Ads Kit with GameAnalytics in Unity. Which proves you with the ability to create own custom events depending on what you would prefer to capture, remote configuration, Funnel and provides various filter option on report.
Thank you so much for reading, I hope this article helps you to understand the GameAnalytics features in Unity.
Reference
GameAnalytics
GameAnalytics Unity
GameAnalytics Plugin
Check out in forum

is it different from HSM analytics kit?

Related

What Huawei Analytics Offers?

1) What is analytics? Why is it used?
How your app is used by users? which pages get more traffic?on which page customers leave the app?
If you want to understand that and direct your future developments accordingly
Analytics is just for you. Understanding user’s habits will help you to make your app better.
If your app is at a certain level or you want to move your app and business forward, you need to use analytics.
To date, there are many services that offer solutions for analytics. Huawei handled analytics as a priority on HMS.
So why would I prefer Huawei Analytics?
Easy to integrate and use
It is very easy to integrate and use the analytics dashboard after integrating Huawei Analytics.
Moreover, you can customize your tables on the dashboard as you wish and you can easily see the data you want to see, not imposed on you.
Reach Huawei users
As you know, google services are not used in the latest Huawei devices. When you integrate Huawei Analytics, you will reach all Huawei users and all other devices users. So Huawei Analytics a connective, not a divider.
Power of HMS Core
Analytics gets its power from HMS Core.
It is very easy to reach all the documents you need for integration or usage of dashboard.When there is a technical problem you can find technical support very easily.
Powerful Analysis Capabilities
{
"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"
}
2) How to Integrate Huawei Analytics?
For integrate Huawei Analytics kit to our application, first of all, it is necessary to register in the Huawei developer community
After adding your app to AppGallery Connect, we need to enable Analytics service to usage.
After completing the enabling process, we go to the manage API tab from the project settings, activate the analytics service and add the json file on the project settings page to our project and add HMS SDK Dependencies to your project(Note: The order of these processes is important. You should update your json file in case of any service change.).
Add build dependencies to dependencies.
Code:
implementation 'com.huawei.hms:hianalytics:4.0.0.303'
Then all you have to do is go to the class you want to collect and start collecting the data.
Code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Enable SDK log recording
HiAnalyticsTools.enableLog();
HiAnalyticsInstance instance = HiAnalytics.getInstance(this);
//Or, use context initialization
//Context context = this.getApplicationContext();
//HiAnalyticsInstance instance = HiAnalytics.getInstance(context);
//instance.setUserProfile("userKey","value");
}
You can customize the data to be collected.
Code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Enable SDK log recording
HiAnalyticsTools.enableLog();
HiAnalyticsInstance instance=HiAnalytics.getInstance(this);
//Or, use context initialization
//Context context = this.getApplicationContext();
//HiAnalyticsInstance instance = HiAnalytics.getInstance(context);
//instance.setUserProfile("userKey","value");
}
As you can see, we can write just a few lines of code and connect our project with Huawei Analytics. So where and how do we evaluate the data we collect, let’s look at it
3) Viewing Analytics Data
You have a 4 section in welcome page. Overview, Distirbution Analysis, Operation Analysis and Advance Analysis. By default, the Overview page of an app displays its KPIs in all channels (AppGallery and AppTouch), including App impressions, Details page views, New downloads, and In-app purchase amount.
The Distribution Analysis page displays the app usage and sales data. Use Downloads & installs to measure the installation and usage of your app. Use In-App Purchases and Paid application details to measure the sales of your app.
With Operation Analysis, you can view the financial reports of your application and set up your future strategies based on this.
Advanced Analysis is a platform where you can create personalized tables, filter your users and view them according to categories, and instantly track active users and all other data.
With Event Analysis Gains insight into user behaviour details. Activity analysis providing gains insight into user loyalty. Funnel analysis gains insight the phase in which user lost.
Huawei Analytics gives us uncountable opportunities to do. As you can see here, your limit is your imagination.
Thanks for reading!
Related Links
Thanks to Mehmet Batuhan Ulper

Huawei App Linking : Increase views for your in-app content

Introduction
App Linking or deep linking is a technology which enable businesses to provide ease of access for their potential services.
Deep links are links which re-direct users directly to a specific app or application feature instead of a website or store.
They are used to re-direct users straight to in-app locations, saving the users time and energy.
Deep linking does this by specifying a custom URL scheme (iOS Universal Links) or an intent URL (on Android devices) that opens your app if it’s already installed. Deep links can also be set to direct users to specific events or pages.
Huawei App Linking leverage developers/users to create cross platform links which can work as defined and can be distributed via multiple channels to users.
When the user taps the link, it will be re-directed to the specified in-app content.
{
"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"
}
Huawei App Linking has multiple functions:
1. Support for deferred deep links
2. Link display in card form
3. Data statistics
Huawei App Linking supports the link creation in multiple ways:
1. Creating a link in AppGallery Connect
2. Creating a link by calling APIs on the client
3. Manually constructing a link
Use Case
There could be multiple use cases for this capability, however I will throw some light on a use case which is most commonly adapted by the applications with complex UX and high transmission between different in-app pages.
In this scenario one application shares the link between counter applications to re-direct to in-app content of a third application.
We will have an application which shares the app link at one end to another (It can be a simple chat platform capability). At the receiver end, user can click on the link and directly navigate to the specific in-app content.
Working
Following are the steps to develop this scenario
1. Development of news application which will be deployed locally.
2. Development of share application which will be deployed locally.
3. Integration of Huawei App Linking Api’s to receive the link and re-direct to the in-app content of news app.
4. Enabling the App linking service in AppGallery Connect.
5. Creating deep link through AppGallery Connect.
Development Overview
1. Must have a Huawei Developer Account
2. Must have Android Studio 3.0 or later
3. Must have a Huawei phone with HMS Core 4.0.2.300 or later
4. EMUI 3.0 or later
Software Requirements
1. Java SDK 1.7 or later
2. Android 5.0 or later
Preparation
1. Create an app or project in Android Studio.
2. Create an app and project in the Huawei AppGallery Connect.
3. Provide the SHA Key and App Package name of the project for which you want the App Linking to be done (Example: News application)
4. Download the agconnect-services.json file and paste to the app folder of your android studio.
Integration
Add below to build.gradle (project)file, under buildscript/repositories and allprojects/repositories.
Code:
Maven {url 'http://developer.huawei.com/repo/'}
Add below to build.gradle (app) file, under dependencies to use the App Linking SDK.
Code:
dependencies{
// Import the SDK.
implementation 'com.huawei.agconnect:agconnect-applinking:1.4.1.300'
}
News Application
News application is developed with multiple content and complex UX to show the capability of the Huawei App Linking.
I will highlight some of the important code blocks for this application.
Main Activity
This activity is the entry point for the application which will have the navigation tab to handle the multiple news categories.
Also, it receives the App Link, read it and re-direct it to the corresponding content.
Creating a link in AppGallery Connect to directly open the Science tab for the News Application through a link
1. Login to AppGallery Connect.
2. Choose My Projects > NewsWorld(App Linking).
3. Choose > Growing > App Linking>Enable now
More details, you can visit https://forums.developer.huawei.com/forumPortal/en/topic/0204412564790410224

HMS Toolkit Makes Integrating HMS Core Kits Effortless

Curious about how to integrate HMS Core kits into your apps? Or how to convert your apps integrated with third-party mobile services? Want the quickest and simplest way to release them on HUAWEI AppGallery?
Introducing HMS Toolkit.
This IDE plugin provides tools such as Getting Started, Configuration Wizard, and Repository and is designed for every stage of development: creation, coding, debugging, testing, releasing, and quality analysis. Armed with HMS Toolkit, you too can develop your own HMS Core-integrated apps in Android Studio and release them at lower cost and higher efficiency.
{
"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"
}
Every development phase, faster and easier
Getting Started demonstrates each HMS Core kit.
Configuration Wizard walks you through all the necessary settings, so no more looking up the manual or switching tools. Configure multiple kits at the same time, for different scenarios, so no more four-hour jobs – now just 5 minutes.
Repository shows you SDK version, package size, and usage to make integration and version a one-stop-shop. Automatically add an SDK library dependency after you select the library, get the latest SDK version, and upgrade the SDK with just one click.
Coding Assistant offers HMS Core API descriptions and sample code and templates by scenario. Drag and drop to generate and configure code, and get automatic issue warnings and recommendations.
Convertor helps you move from third-party APIs to HMS APIs. Convert your source code either with Add HMS API (add code to call HMS APIs to match third-party APIs so both can be called as needed), or To HMS API (replace code to call third-party APIs with code to match HMS APIs so only HMS APIs can be called).
Cloud Debugging uses a remote real device to quickly locate and resolve problems. Currently, choose from various Huawei devices if you're in the Chinese mainland, Russia, Asia Pacific, and West Europe. Quickly access the nearest site for single-step or ADB debugging. Drag and drop to upload files, zoom in and out onscreen, and toggle definitions between smooth, SD, and HD on the remote real device as needed.
Cloud Testing tests your app in one click to quickly detect problems on any device. Get screenshots for compatibility, stability, performance, and power consumption.
Publish to AppGallery Connect makes uploading easier to do from the IDE. Choose to upload either the packaged APK of the current project (default) or a local package, and its parameters will be checked against the release requirements. Once it's uploaded, you'll be prompted to access the HUAWEI AppGallery Connect release page.
HMS Toolkit also allows you to generate an API or demo project in one click for quickly verifying and calling the image classification model in your app.
Easy to install
Start Android Studio, go to File > Settings > Plugins > Marketplace, search for HMS Toolkit, and click Install. Or sign in and get it on the HUAWEI Developers official website.
HMS Toolkit will continue to be optimized to help you and other developers around the world create a smart life for users.
If you have any questions, please submit a ticket. Huawei technical support will reply to you as soon as possible.
For more information about HMS Toolkit, go to >>
For how to quickly integrate each kit using HMS Toolkit, go to >>
For more operation tutorials, go to >>
For more details, you can go to:
l Our official website
l Our Development Documentation page, to find the documents you need
l Reddit to join our developer discussion
l GitHub to download demos and sample codes
l Stack Overflow to solve any integration problems
Original Source
HMS Tool kits supports all GMS services?

Web Page Conversion Tracking in HUAWEI Ads and DTM (Part 1)

More and more advertisers are using HUAWEI Ads to promote their apps or web pages in order to attract more users and increase revenue. This article introduces how to track clicks and conversion rates of ads delivered using HUAWEI Ads. HUAWEI Ads works with Dynamic Tag Manager (DTM) to help you easily track conversions on web pages, as well as ad performance.
First of all, what is ad conversion tracking?
Let's use Huawei Vmall as an example. Ads for Vmall are served by HUAWEI Ads. After a user clicks such an ad to access Vmall, user actions, such as adding products to the shopping cart and purchasing products, on one or more in-app pages in a given period (30 days in general) will be tracked.
Now, let's take a look at ad conversion.
When a user clicks an ad to access Vmall and purchases a product in Vmall, this is considered as an ad conversion because a user has been converted into a paying user.
Next, let's see how to configure conversion tracking for web pages in DTM.
You can configure conversion tracking for landing pages, across web pages, or across domains and select an appropriate tracking mode for each scenario in DTM. The configuration involves the following steps:
1. Configuration preparations
2. Conversion tracking for landing pages
3. Cross-page conversion tracking for a single domain
4. Cross-domain conversion tracking
First, you need to perform the following operations before configuring conversion tracking:
1. Register a HUAWEI ID.
2. Register a HUAWEI Ads account.
3. Embed the JavaScript code obtained from DTM into the web page to be tracked.
Procedure:
Step 1 Access AppGallery Connect and register a HUAWEI ID.
Step 2 Access HUAWEI Ads and register an account.
You can use your HUAWEI ID to register a HUAWEI Ads account.
Step 3 Embed the JavaScript code obtained from DTM into the web page to be tracked.
1. Add a web app.
Sign in to AppGallery Connect, select My projects, click Add project, enter a project name, and click OK.
{
"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"
}
Click Add app. On the page displayed, select Web for Platform, set App name, and click OK.
2. Create a configuration in DTM.
In AppGallery Connect, go to Grow > Dynamic Tag Management.
Click Enable Dynamic Tag Manager. In the dialog box displayed, set Configuration name and URL, and click OK. Embed the generated JavaScript code snippet into all web pages to be promoted. The code needs to be embedded only once and will be valid indefinitely.
Step 4 Use Google Tag Manager (GTM) to embed the DTM-Web tracking code snippet.
During version development, it is unpractical to modify the code snippet and release it to the live network immediately. So, how can the code snippet be embedded into web pages without version release?
As many web pages integrate GTM, you can use it to embed the DTM code. The detailed configuration process is as follows:
1. Sign in to GTM and select the container corresponding to the web page to track.
2. Create a tag.
Go to Tags > New. On the page displayed, set Tag Type to Custom HTML and copy the DTM code snippet to the HTML area. Set Firing Triggers to Page View, enter a tag name, and click Save.
3. Create and release a version.
Click Submit. On the page displayed, select Publish and Create Version, enter a version name, and click Publish.
You have now completed the necessary preparations for configuring conversion tracking for web pages.
To learn more, please visit:
HUAWEI Developers official website
Development Guide
Reddit to join developer discussions
GitHub or Gitee to download the demo and sample code
Stack Overflow to solve integration problems
Original Source

New Version of Analytics Kit: Even More Functions

In 2021, HMS Core Analytics Kit experienced 9 iterations, and released 11 new event tracking templates with related analysis reports, as well as paid traffic, channel, and uninstallation analysis models, helping developers a lot in growing users with convenient data analysis. The 6.4.0 version, released this year, delivers even more functions.
Here's what's new:
Released SDKs for new platforms (such as for quick games), enabling you to analyze data from more platforms.
Added the deletion and batch deletion functions to data export tasks for fast and efficient data export.
Released the server Python SDK and Node.js SDK for quick API use.
Added the function of sending back quick app conversion events for targeted ad placement.
Optimized analysis models such as real-time overview and page analysis for a better user interaction experience.
1. SDKs for New Platforms, to Comprehensively Analyze User Data on More Platforms
Following the release of SDKs for platforms such as quick apps and WeChat mini-programs, we added SDKs for new platforms like quick games in the new version. With simple integration, you can gain in-depth insights into the in-app journey of your users.
{
"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"
}
2. Streamlined Data Export Page, Displaying Key Tasks Clearly
The data export function enables you to download event data so that you can import data into your own analysis system to perform your analysis. As you may need to carry out multiple export tasks at once, we have improved the data export list, to allow you to quickly search and find tasks. Now, you can filter and name tasks, as well as delete, or even batch delete, historical export tasks that you no longer need.
3. Python SDK and Node.js SDK, for More Choices to Use APIs
In addition to the SDKs for new platforms, the release of the Python SDK and Node.js SDK on the server side gives you more choices when using APIs. By integrating the server SDKs, you can use APIs easily and conveniently.
4. Sending Back Quick App Conversion Events for Optimal Ad Placement
As the cost of acquiring traffic increases, more and more advertisers hope to obtain high-quality user conversion through precise ad placement. The new version allows quick app conversion events to be sent back at low costs. On HUAWEI Analytics, you can configure conversion events that need to be sent back to HUAWEI Ads, such as app launch, registration, adding products to the shopping cart, making payment, retaining, re-purchasing, rating, sharing, and searching, to optimize the ad placement.
5. Improved Analysis Models for a Better User Interaction Experience
To improve user experience, we have optimized some analysis models to improve usability and display. For example, we have added the page grouping function to page management, allowing you to manage pages on the same tab page by page groups. We have also optimized real-time overview by adjusting the sequence of the selection boxes and supporting fuzzy search to quickly identify target users. Meanwhile, the layout of the attribute distribution card has also undergone improvements.
Moreover, we have changed the former Session path analysis page to the Event path page, and combined it with the Page path analysis page to a new Session path analysis page. We have also added the OS attribute to the filter criteria, which enables you to perform comparison analysis based on different OS versions.
* This data is from a test environment and is for reference only.
To learn more about the updates, refer to the version change history. Click here to get the free trial for the demo, or visit our official website to access the development documents for Android, iOS, Web, Quick Apps, HarmonyOS, WeChat Mini-Programs, and Quick Games.

Categories

Resources