This article was shared on Huawei Developer Forum "How to use DTM to send App events to Google Analytics" , you can watch the video for specific integration instructions.
As a developer or app operator, obtaining real-time user behavior data in an app is one of the daily and important tasks. For example, how to quickly obtain the conversion data of users of various channels at various key nodes of the app and the final payment status?
Through the dynamic tag manager service (DTM for short), you can analyze and measure the configuration of the code based on the web interface, and then send the data to a third-party analysis platform without modifying the code and publishing the app version. Taking the add to cart event as an example, in this issue we will introduce how to send the add to cart event to Google Analytics through DTM.
Before starting the configuration, your app needs to have integrated the DTM Android SDK ( is linked to the previous issue of ), and the "Add to shopping cart" has been completed using the Huawei Analytics SDK.
1. Modify the DTM configuration to send the "Add to Cart" event to Google Analytics.
Step 1, configure a preset variable of Event Name in the variable management.
The second step is to create a new custom condition in the condition management. When the value of Event Name is equal to $AddProduct2Cart, the match is successful.
Step 3: Create a new code with the code type "Google Analytics (Analysis): Universal Analytics" in the code management. The tracking ID uses the data tracking unique ID of Google Analytics. Select the type of report and fill in the corresponding parameters. Select the trigger condition. The condition created in the previous step. So far, the configuration of DTM has been modified.
2. Verify that the DTM configuration is correct.
Step 1: Click the preview button on the overview page to enter the version preview page, scan the QR code with a mobile browser or start the preview through the adb command.
Step 2: Click the Add to Cart button in the App to trigger the reporting of the tracking event, and check whether the reported event is consistent with the configuration in the DTM in the "Event" drop-down under "Real-time" in the menu bar of the Google Analytics analysis platform. So far, the configuration verification of DTM is completed.
3. Create and publish a DTM version.
Next, the DTM version can be released to make the configuration take effect for all apps on the live network. You need to go to the version management page to create and publish a version.
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 developer discussions, please go to the Reddit community
for more details >>
Visit Huawei Developer Alliance official website
Get the development guidance document
Huawei Mobile Services open source warehouse address: GitHub , Gitee
Follow us to know the latest technical information of HMS Core for the first time~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。