[Huawei Developers] muraliameakula:
Previously, I've introduced how to quickly report app events to Google Analytics using DTM without releasing app updates. Now, the visual event tracking requirement has changed to report events to Firebase for multi-dimensional data analysis. The following uses a case to explain the process of reporting events to Firebase using DTM.

Case:

Report the $AddProduct2Cart event to Firebase using DTM.

Procedure:

1. Preparations

Before modifying the DTM configuration, ensure that you have completed the following preparations:

a. The DTM SDK has been integrated into the app.

b. The Firebase SDK has been integrated into the app.

c. The $AddProduct2Cart event has been configured for the app using the Analytics SDK.

Bundle bundle = new Bundle();
bundle.putString(PRODUCTID, "xxx");
bundle.putString(PRODUCTNAME, "xxx");
HiAnalytics.getInstance(context).onEvent(HAEventType.ADDPRODUCT2CART, bundle);
</p>

2. Modifying the DTM Configuration.

2.1 Creating a Variable

Go to Grow > Dynamic Tag Manager > Variable. Click Configure, select Event Name, and click OK.

2.2 Creating a Tag.

On the Tag page, click Create to create a Firebase tag. Configure the tag as follows:

Name: Enter a custom tag name.

Extension: Select Google Analytics (Firebase).

Event name: This parameter is optional. Select the check box and enter the renamed event name AddProduct2Cart (events reported to Firebase cannot contain the dollar sign $).

Parameters for addition: Set Key to price and Value to 1000.

Set Trigger condition to the created condition.

3. Creating and Releasing a Version.

Create and release a new configuration version on the Version page. The app with the DTM SDK integrated will periodically check and download the latest configuration version and report events according to this version.

In the Create version dialog box, select Create and release version.

4. Viewing the Reported Event on Firebase.

After completing the preceding operations, you can view the reported event on Firebase.

By default, the DTM SDK checks and downloads the latest configuration version at an interval of 6 hours. To download the latest configuration version immediately, clear the app cache and restart the app. DTM will not report events immediately if the debug mode is not enabled. Instead, events are reported every 10 minutes when the app is running. To report events immediately, run the following ADB commands:

adb shell setprop debug.huawei.hms.dtm.app <package_name>
adb shell setprop debug.firebase.analytics.app <package_name>

There may be a delay of several minutes for Firebase to receive the renamed event AddProduct2Cart triggered in the app.

Go to Analytics > DebugView to view the latest reported events.

The reported event name is AddProduct2Cart. The event has the price parameter and the parameter value is 1000, which is consistent with that set in DTM. This means that the DTM configuration has taken effect.

To learn more, please visit:

Our official website

Our development documentation page to find the documents you need

Reddit to join our developer discussion

GitHub or Gitee to download the demo and sample code

Stack Overflow to solve any integration problems

Original Source