Intermediate: Integrating Dynamic Tag Manager (DTM) in Pharmacy App to Improve Business
Introduction
Huawei Dynamic Tag Manager (DTM) is a dynamic tag management system. We can manage tags, events dynamically from web UI. It also helps to send data to third party analytics platform like Google Analytics, Facebook Analytics and AppsFlyer etc.
How DTM improves our business?
As we know, it’s a Dynamic Tag Management System. So if we are sending events on any page, button click or Navigation to other screens, we can filter those events dynamically from web.
For example, Pharmacy app is used for purchasing medicine online and it shows the list of medicine and price. When we click on Buy button to purchase medicine, it will send the Medicine name, id, price and description to Huawei Analytics. But if we are putting condition on web UI for price (price > 10), then we will get analytics data of those medicine which is having price more than 10 INR. Like this we can manage lot of things. With these features we can analyze our data smoothly and can make profit which will help to improve our business.
Let us start with the project configuration part:
Step 1: Implement IAP (In-App Purchase) in Pharmacy App.
Step 2: Install Huawei DTM NuGet Package.
Step 3: Install Huawei.Hms.Hianalytics package using Step 2.
Step 4: Select Project Setting > Grow > Dynamic Tag Manager and enable it.

Step 5: Enter the details and click OK to create DTM configuration.

Step 6: After configuration success, it will create the Configuration code.

Step 7: Click Version tab and create version.

Step 8: Click Variable tab and click Configure/Create button to set Preset/Custom variable for events and tags.

a) Preset Variable: These are predefined variables which can be used to configure most of the tags and conditions. Currently DTM provides 18 preset variables.

b) Custom Variable: You can also create your custom variable for tags and conditions according to your project. Currently 6 types of custom variables are present.

Step 9: Click Condition tab and create the condition.

Step 10: Click Tag tab and create the tag.

Step 11: Select Project Setting > Huawei Analytics > App debugging and enable it for getting real time analytics data.
Step 12: For checking the real time events, enable debug mode by using below commands.
Enable
adb shell setprop debug.huawei.hms.analytics.app <package_name>
Disable
adb shell setprop debug.huawei.hms.analytics.app .none.
Now your configuration part completed.
Let us start with the implementation part:
Step 1: Initialize Huawei Analytics inside MainActivity’s OnCreate() method.
Step 2: Send the events using Huawei Analytics OnEvent() method.
Now implementation part done.
Result



Tips and Tricks
Please enable app debug mode using command “adb shell setprop debug.huawei.hms.analytics.app <package_name>”.
Conclusion
In this Article, We have learnt how to improve our business with the help of Huawei Dynamic Tag Management System. We can also place some ads on the basis of user engagement on the application to maximize our profit.
References