[Huawei Developers] Freemind R:
More information like this, you can visit HUAWEI Developer Forum​

Original link: https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0202333697950470040&fid=0101187876626530001

Introduction

Dynamic Tag Manager allows the developers to deploy and configure information securely on web-based UI. It helps to track the user activities.

Use cases

1. Deliver an ad advertising app to the ad platform.

2. When user taps the ad download app and use.

3. Using DTM configure the rules and release configuration.

4. Automatically app updates the configuration.

5. Daily monitoring reports.

Advantages

1. Faster configuration file updates.

2. More third-party platforms.

3. Free-of-charge

4. Enterprise-level support and service

5. Simple and easy-to-use UI

6. Multiple data centers around the world

Steps

1. Create App in Android.

2. Configure App in AGC.

3. Integrate the SDK in our new Android project.

4. Integrate the dependencies.

5. Sync project.

Dynamic Tag Manager Setup

1. Open AppGallery Connect, select DTM Application and select Dynamic Tag Manager.

Choose My Projects > Growing >Dynamic Tag Manager

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821042241.53882424440814547365555829562579:50510901080510:2800:31F1C574E95995DEFBD9E077A8885106C1ADC886A6C51567DA10FBD7C6EFE0C5.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821042241.53882424440814547365555829562579:50510901080510:2800:31F1C574E95995DEFBD9E077A8885106C1ADC886A6C51567DA10FBD7C6EFE0C5.png[/IMG]

2. Click Create Configuration, enter required information in displayed dialogue-box and click OK.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821042514.36985984182605023157205649836449:50510901080510:2800:BA3AE5B92B5F2ABB25E5194D2D222E51A7D1FEEEABEB3487FFD495BD40ABB611.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821042514.36985984182605023157205649836449:50510901080510:2800:BA3AE5B92B5F2ABB25E5194D2D222E51A7D1FEEEABEB3487FFD495BD40ABB611.png[/IMG]

3. Click Configuration name.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821044057.99684913593631304015108285009844:50510901055403:2800:2FFAC650ABAE8A222258505DB5AB92533ADD41A8EE6185DD5859EC2E4F52D29F.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821044057.99684913593631304015108285009844:50510901055403:2800:2FFAC650ABAE8A222258505DB5AB92533ADD41A8EE6185DD5859EC2E4F52D29F.png[/IMG]

4. Click Configure, enter required details in Preset variables and Custom variables.

Click Name and click Variable tab to find Preset variables and Custom variables nodes.

Note: Preset variables is predefined variables and Custom variables is user defined variables.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045322.25309759137664947245560087751232:50510901055403:2800:63CB900CFE701A8AA589947098EBEAA06A8246B26CA8EB05358868C04F79F978.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045322.25309759137664947245560087751232:50510901055403:2800:63CB900CFE701A8AA589947098EBEAA06A8246B26CA8EB05358868C04F79F978.png[/IMG]

5. A condition is the prerequisite for triggering a tag when the tag is executed. Click Create Condition tab, click Create to enter Name, Type and Trigger, and then click Save.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045526.01118015533970993908146117236835:50510901055403:2800:C7AB88C9DF8A16A5F2A3D39CFA55308D0EE16BB8EF31B637F98408D2B2F736E9.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045526.01118015533970993908146117236835:50510901055403:2800:C7AB88C9DF8A16A5F2A3D39CFA55308D0EE16BB8EF31B637F98408D2B2F736E9.png[/IMG]

6. Click Create, enter the Name, Extensions and Operation in Configure tab.

Note: Tag is used to track events

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045619.57070143830417821928897010821763:50510901055403:2800:CD93A65478E8F3B821D93DB68500D9B6D3A801D0CFFE8A95FC4EBAD64534B03D.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045619.57070143830417821928897010821763:50510901055403:2800:CD93A65478E8F3B821D93DB68500D9B6D3A801D0CFFE8A95FC4EBAD64534B03D.png[/IMG]

7. Click Version tab and click Create.

Enter Name and Description, and then click OK.

Note: A version is a snapshot of a configuration at a time point, it can be used to record different phases of configuration.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045946.08489217219370074238266253088448:50510901055403:2800:73AA7D70C149BE09F5A8FF2DB31F45932D4CA5154F7E661BD16138F48EC0B113.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821045946.08489217219370074238266253088448:50510901055403:2800:73AA7D70C149BE09F5A8FF2DB31F45932D4CA5154F7E661BD16138F48EC0B113.png[/IMG]

8. Click a version in Version tab, to find Version details such as Overview and Operation records.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051037.01332761724136717982933559786186:50510901055403:2800:3340190CC17044D67D941BCC97DC4BD354FBC0067A5A975D445EE8BFCF190880.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051037.01332761724136717982933559786186:50510901055403:2800:3340190CC17044D67D941BCC97DC4BD354FBC0067A5A975D445EE8BFCF190880.png[/IMG]

9. Click Download/Export version details paste into assets/containers folder.

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051403.23368628170887821141095784172166:50510901055403:2800:ECFA0D5C640C62C37365D56547A4A9456D3F65D8AA034CE464AF3D6419CA1F23.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051403.23368628170887821141095784172166:50510901055403:2800:ECFA0D5C640C62C37365D56547A4A9456D3F65D8AA034CE464AF3D6419CA1F23.png[/IMG]

Integration

App level gradle dependencies.

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

Dtm kit dependencies

implementation 'com.huawei.hms:hianalytics:5.0.1.300'
implementation 'com.huawei.hms:dtm-api:5.0.0.302'

Kotlin dependencies

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

Root level gradle dependencies

maven {url 'http://developer.huawei.com/repo/'}
classpath 'com.huawei.agconnect:agcp:1.3.1.300'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

Add the below permissions in Android Manifest file

<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application ...
</manifest>

After configurations successfully done create instance for HiAnalyticsInstance in activity

private var mInstance: HiAnalyticsInstance? = null
mInstance = HiAnalytics.getInstance(this)
HiAnalyticsTools.enableLog()

Below snippet for the event trigger method.

fun updateEvent() {
val bundle = Bundle()
bundle.putString("user_name", userName.editText?.text.toString())
bundle.putString("user_mail", userMail.editText?.text.toString())
bundle.putString("user_number", userNumber.editText?.text.toString())
mInstance!!.onEvent("USERDINFO", bundle)
}

Using debug you can monitor real time data follow steps to enable debug mode.

Command for enabling the debug mode: adb shell setprop debug.huawei.hms.analytics.app <package_name>

Command for disabling the debug mode: adb shell setprop debug.huawei.hms.analytics.app .none.

After debug mode is enabled, all events

Result:

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051919.25727676407789773608471054122663:50510901080510:2800:3C4521F82683873072F96CAAC4DC70CC852A57291167A5823604002C1B6EB9F0.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051919.25727676407789773608471054122663:50510901080510:2800:3C4521F82683873072F96CAAC4DC70CC852A57291167A5823604002C1B6EB9F0.png[/IMG]

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051909.44518609929486263699778001718692:50510901055403:2800:7FB9C1352D6FA68B5B0803ACB7C7BD3C181D164E651F119E8F07DA86F3130DC3.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051909.44518609929486263699778001718692:50510901055403:2800:7FB9C1352D6FA68B5B0803ACB7C7BD3C181D164E651F119E8F07DA86F3130DC3.png[/IMG]

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051947.20562941766356334782272447951741:50510901055403:2800:3016EE5F3DB71FB14DC4DEAD8C0892924680D3AAA8D16857027ED093AD86B591.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051947.20562941766356334782272447951741:50510901055403:2800:3016EE5F3DB71FB14DC4DEAD8C0892924680D3AAA8D16857027ED093AD86B591.png[/IMG]

[IMG="https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051958.98434706096669042565679656050807:50510901055403:2800:2BBCE96E6EBD6B961809846FBBDDBB41344106574A88A0BAC425737CB7B7EDF1.png"]https://communityfile-dre.op.hicloud.com/FileServer/getFile/cmtybbs/001/767/951/2640091000001767951.20200821051958.98434706096669042565679656050807:50510901055403:2800:2BBCE96E6EBD6B961809846FBBDDBB41344106574A88A0BAC425737CB7B7EDF1.png[/IMG]

Reference:

To know more about DTM kit, check below URL.

https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050043907