1

What is dynamic tag management?

Tag (Dynamic Tag Manager, referred to as "DTM"), allows developers to quickly configure and update measurement codes and related code fragments, can easily analyze and configure measurement codes based on the Web interface, complete dynamic tracking of specific events and Send data to a third-party analytics platform to track marketing data on demand. In this issue, we will introduce to you: how to integrate DTM Android SDK from scratch. The content is mainly divided into two parts:

  1. Register as a developer on the Huawei developer website and add apps;
  2. Integration of DTM Android SDK.

first part:

Before integrating the HMS Core SDK, you need to register as a developer and add your own projects and applications.

First, visit Huawei developer's official website, click on HUAWEI MOBILE SERVICES, enter Huawei mobile services developer site ; click management center , enter login page ; click Register button , enter Huawei account registration page , enter Register with relevant information.

After the account registration is successful, the next step is to add an item: first log in to Huawei developer website , enter the username and password , after the login is successful, click " AppGallery Connect ", enter the Connect page 7, click " ", click " to add project ", enter " project name ", click " to confirm " to add the project.

After the project is added successfully, the next step is to add an application: click "Add Application", select the platform, currently DTM supports Android, iOS and Web platforms, select the supported device, fill in the application name and application package name, select the application category and default language, click "Confirm" to add the app.

the second part:

Next, we learn how to integrate the DTM Android SDK:

1. APPGallery Connect environment preparation.

Step 1: Enable Huawei Analytics Service: Select Dynamic Tag Management. If the " Open Analysis Service " button is not displayed, the analysis service has been opened. Click "Enable Analysis Service" to jump to the Huawei analysis page; click " start analysis service ", select the data processing location and time zone; click " to complete " button, and wait for the analysis service to complete.

Step 2, open DTM service: click " to activate service ", fill in the configuration name; click " to confirm ", DTM service is successfully . So far, the APPGallery Connect environment preparation has been completed.

2. Android Studio project configuration.

Step 1: Add the agconnect-service.json file of the current application. Click " Project Settings ", in the "Application" area of the General" page, download the json configuration file ; copy the json file to in the application-level root directory.

Step 2: Configure the project's bulid.gradle file. Open the Android Studio project-level "build.gradle" file, add the Huawei agc plugin to , and add the Maven warehouse address of the HMS Core SDK .

Step 3: Configure the application's bulid.gradle file. the application-level "build.gradle" file, add the agc plugin, and add the compilation dependencies of Analytics and DTM SDK .

Step 4: Configure the obfuscation script. Open the application-level obfuscation configuration file and add the obfuscation configuration .

3. SDK initialization.

Because the initialization of the DTM SDK is done by the Analytics SDK, you only need to call the initialization method of the Analytics SDK.

4. SDK integration verification.

Open the page of Android Studio, filter the "HMS-DTM" log with 16232ffa5778aa, run your APP , you can check the version number of DTM in the log, and if "initialize dtm core#success" appears in , it means that the SDK has been initialized successfully . So far, DTM Android SDK integration is complete.

For more details of HMS Core dynamic tag management service, please refer to:
https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/introduction-0000001050043907?ha_source=hms1

Huawei Developer Alliance official website

Get the development guidance document

participate in the developer discussion, please go to the Reddit community

download the demo and sample code, please go to Github

solve integration problems, please go to Stack Overflow

for more details >>

Visit Developer Alliance official website
Get development guidance document
Huawei Mobile Services open source warehouse address: GitHub , Gitee

us and know the latest technical information of HMS Core for the first time~


HarmonyOS_SDK
596 声望11.7k 粉丝

HarmonyOS SDK通过将HarmonyOS系统级能力对外开放,支撑开发者高效打造更纯净、更智能、更精致、更易用的鸿蒙原生应用,和开发者共同成长。