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:
- Register as a developer on the Huawei developer website and add apps;
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
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~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。