Using Google Analytics: Universal Analytics Enhanced Ecommerce to Analyze User Interactions
This article uses the purchase event as an example to demonstrate how to implement Google Analytics: Universal Analytics Enhanced Ecommerce in the android app.
Join the DZone community and get the full member experience.Join For Free
Using traditional e-commerce data analysis tools, we can only analyze the order sales data of products, and cannot have a global understanding of product conversion. Google Analytics: Universal Analytics Enhanced e-commerce provides great convenience for developers to understand customer behavior and sales results, thus exploring many new opportunities.
With the enhanced e-commerce function, developers can easily track user interactions with your product during their shopping journey. Such interactions include product displays, product clicks, viewing product details, adding the product to the shopping cart, checking out, transactions, and refunds.
Currently, this function supports many events, including product display, product click or selection, viewing product details, adding or removing products to or from the shopping cart, promotion information display, promotion information clicks or selection, checkout start, other checkout steps, checkout options, purchasing, and refunds.
In this article, I'll use the purchase event as an example to demonstrate the enhanced e-commerce function.
Before you begin, ensure that your Android app has been integrated with the Analytics SDK and DTM SDK and that both SDK versions are 220.127.116.110 or later.
First, sign in to AppGallery Connect and go to Grow, and then Dynamic Tag Manager.
Create a Google Analytics: Universal Analytics tag and configure related parameters. Be sure to select Enable enhanced e-commerce.
Then, set the Trigger condition. Here, set the Value to $CompletePurchase, which indicates the purchase event. Note that the content in Value must be the actual value of the supported event, which you can obtain from the document.
Before compiling code, click the development documentation to view the parameters of each supported event. In the click event code, add code for tracking the purchase event.
Verify the Event
Then, verify that the purchase event can be reported to Google Analytics: Universal Analytics.
For this, click Preview on the Workspace page to go to the version preview page.
Then, use your mobile browser to scan the QR code or run the ADB command to start the preview.
Click the purchase button in the app to trigger event reporting, and verify that the event reported to Google Analytics: Universal Analytics is the same as that configured in DTM. We've now finished verifying the DTM configuration.
Release a DTM Configuration Version
Next, let's release a DTM configuration version so that the configuration takes effect for your app on the live network. Go to the Version page to create and release a version.
We have now covered how to use the enhanced e-commerce function of Google Analytics: Universal Analytics.
Opinions expressed by DZone contributors are their own.