A tag mainly consists of parameters and conditions. The following uses HUAWEI Analytics as an example to describe how to create a tag.
Operation Type |
Description |
|---|---|
Add event |
When an event meeting the specific condition occurs, the app sends an additional event to HUAWEI Analytics. You can configure a name for the additional event. By default, parameters of the additional event are inherited from the source event. You can also add, modify, and delete event parameters. |
Modify event |
When an event meeting the specific condition occurs, you can rename the event and send the renamed event to HUAWEI Analytics. You can also add, modify, and delete event parameters. |
Block event |
Specified events will be blocked and not sent to HUAWEI Analytics. Adding and modification events in other tags are not affected. |

The event name must begin with a letter or reference, and can contain only digits, letters, and underscores (_). If a variable is referenced in the event name, you need to ensure that the value of the referenced variable meets the event name constraints. Otherwise, the event may fail to be reported.





To report data to Firebase, you need to integrate both the DTM SDK and Firebase-analytics SDK into your app. For details, please refer to Add Firebase to your Android project.
The enhanced e-commerce function in the Google Analytics: Universal Analytics template is supported, allowing you to easily track user interactions with your product, including product display, product click, viewing product details, adding your product to the shopping cart, checkout, transaction, and refund.
You have integrated Analytics Kit 5.2.0.300 or later. For details, please refer to Accessing Analytics Kit.

If settings on the Create tag page are inconsistent with those in the tag, settings on the Create tag page take precedence.
Event |
HUAWEI Analytics Key Value |
Actual Value |
|---|---|---|
HAEventType.VIEWPRODUCTLIST |
$ViewProductList |
|
HAEventType.VIEWCONTENT |
$ViewContent |
|
HAEventType.VIEWPRODUCT |
$ViewProduct |
|
HAEventType.ADDPRODUCT2CART |
$AddProduct2Cart |
|
HAEventType.DELPRODUCTFROMCART |
$DelProductFromCart |
|
HAEventType.VIEWPRODUCT |
$ViewProduct |
|
HAEventType.VIEWCONTENT |
$ViewContent |
|
HAEventType.STARTCHECKOUT |
$StartCheckout |
|
HAEventType.VIEWCHECKOUTSTEP |
$ViewCheckoutStep |
|
HAEventType.UPDATECHECKOUTOPTION |
$UpdateCheckoutOption |
|
HAEventType.COMPLETEPURCHASE |
$CompletePurchase |
|
HAEventType.REFUNDORDER |
$RefundOrder |
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
POSITIONID |
Product Position |
pr<productIndex>ps |
1 |
PRODUCTLIST |
Product Impression List Name |
pal |
Search Results |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.POSITIONID, 1);
Bundle product2 = new Bundle();
product2.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03QJ2J90");
product2.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product2.putString(HAParamType.CATEGORY, "Phone/Mate/Yellow");
product2.putString(HAParamType.PRODUCTFEATURE, "Yellow");
product2.putString(HAParamType.BRAND, "HUAWEI");
product2.putDouble(HAParamType.PRICE, 6999.00);
product2.putString(HAParamType.CURRNAME, "CNY");
product2.putLong(HAParamType.POSITIONID, 2);
ArrayList items = new ArrayList();
items.add(product1);
items.add(product2);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList("items", items);
ecommerceBundle.putString(HAParamType.PRODUCTLIST, "Search Results");
hiAnalytics.onEvent(HAEventType.VIEWPRODUCTLIST, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
POSITIONID |
Product Position |
pr<productIndex>ps |
1 |
PRODUCTLIST |
Product Impression List Name |
pal |
Search Results |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.POSITIONID, 1);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putBundle("items", product1);
ecommerceBundle.putString(HAParamType.PRODUCTLIST, "Search Results");
hiAnalytics.onEvent(HAEventType.VIEWCONTENT, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putBundle("items", product1);
hiAnalytics.onEvent(HAEventType.VIEWPRODUCT, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
QUANTITY |
Product Quantity |
pr<productIndex>qt |
1 |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.QUANTITY, 1);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putBundle("items", product1);
hiAnalytics.onEvent(HAEventType.ADDPRODUCT2CART, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
QUANTITY |
Product Quantity |
pr<productIndex>qt |
1 |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.QUANTITY, 1);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putBundle("items", product1);
hiAnalytics.onEvent(HAEventType.DELPRODUCTFROMCART, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
CLICKID |
Promotion ID |
promo<promoIndex>id |
PROMO_NEW_PHONE_XXX |
PROMOTIONNAME |
Promotion Name |
promo<promoIndex>nm |
New Phone Promotion |
MATERIALNAME |
Promotion Creative |
promo<promoIndex>cr |
new_phone_banner_x |
MATERIALSLOT |
Promotion Position |
promo<promoIndex>ps |
banner_slot_x |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle promotion = new Bundle();
promotion.putString(HAParamType.TRANSACTIONID, "PROMO_NEW_PHONE_XXX");
promotion.putString(HAParamType.PROMOTIONNAME, "New Phone Promotion");
promotion.putString(HAParamType.MATERIALNAME, "new_phone_banner_x");
promotion.putString(HAParamType.MATERIALSLOT, "banner_slot_x");
ArrayList promotions = new ArrayList();
promotions.add(promotion);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList("promotions", promotions);
hiAnalytics.onEvent(HAEventType.VIEWPRODUCT, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
CLICKID |
Promotion ID |
promo<promoIndex>id |
PROMO_NEW_PHONE_XXX |
PROMOTIONNAME |
Promotion Name |
promo<promoIndex>nm |
New Phone Promotion |
MATERIALNAME |
Promotion Creative |
promo<promoIndex>cr |
new_phone_banner_x |
MATERIALSLOT |
Promotion Position |
promo<promoIndex>ps |
banner_slot_x |
CONTENTTYPE |
Product Action List |
pal |
Internal Promotions |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle promotion = new Bundle();
promotion.putString(HAParamType.TRANSACTIONID, "PROMO_NEW_PHONE_XXX");
promotion.putString(HAParamType.PROMOTIONNAME, "New Phone Promotion");
promotion.putString(HAParamType.MATERIALNAME, "new_phone_banner_x");
promotion.putString(HAParamType.MATERIALSLOT, "banner_slot_x");
ArrayList promotions = new ArrayList();
promotions.add(promotion);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList("promotions", promotions);
ecommerceBundle.putString(HAParamType.MEDIUM, "Internal Promotions");
hiAnalytics.onEvent(HAEventType.VIEWCONTENT, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
QUANTITY |
Product Quantity |
pr<productIndex>qt |
1 |
STEP |
Checkout Step |
cos |
1 |
OPTION |
Checkout Step Option |
col |
Visa |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.QUANTITY, 1);
ArrayList items = new ArrayList();
items.add(product1);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList("items", items);
ecommerceBundle.putLong(HAParamType.STEP, 1);
ecommerceBundle.putString(HAParamType.OPTION, "Visa");
hiAnalytics.onEvent(HAEventType.STARTCHECKOUT, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
QUANTITY |
Product Quantity |
pr<productIndex>qt |
1 |
STEP |
Checkout Step |
cos |
2 |
OPTION |
Checkout Step Option |
col |
Visa |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.QUANTITY, 1);
ArrayList items = new ArrayList();
items.add(product1);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList("items", items);
ecommerceBundle.putLong(HAParamType.STEP, 2);
ecommerceBundle.putString(HAParamType.OPTION, "Visa");
hiAnalytics.onEvent(HAEventType.VIEWCHECKOUTSTEP, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
STEP |
Checkout Step |
cos |
2 |
OPTION |
Checkout Step Option |
col |
Mastercard |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putLong(HAParamType.STEP, 2);
ecommerceBundle.putString(HAParamType.OPTION, "Mastercard");
hiAnalytics.onEvent(HAEventType.UPDATECHECKOUTOPTION, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
PRODUCTNAME |
Product Name |
pr<productIndex>nm |
HUAWEI Mate 40 Pro |
CATEGORY |
Product Category |
pr<productIndex>ca |
Phone/Mate/Black |
PRODUCTFEATURE |
Product Variant |
pr<productIndex>va |
Black |
BRAND |
Product Brand |
pr<productIndex>br |
HUAWEI |
PRICE |
Product Price |
pr<productIndex>pr |
6999.00 |
CURRNAME |
Currency Code |
cu |
CNY |
QUANTITY |
Product Quantity |
pr<productIndex>qt |
1 |
TRANSACTIONID |
Transaction ID |
ti |
T12345 |
STORENAME |
Transaction Affiliation |
ta |
HUAWEI Store - Online |
REVENUE |
Transaction Revenue |
tr |
37.39 |
TAXFEE |
Transaction Tax |
tt |
2.85 |
SHIPPING |
Transaction Shipping |
ts |
5.34 |
CURRNAME |
Currency Code |
cu |
CNY |
VOUCHER |
Coupon Code |
tcc |
NEW_PHONE_2020 |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle product1 = new Bundle();
product1.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
product1.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product1.putString(HAParamType.CATEGORY, "Phone/Mate/Black");
product1.putString(HAParamType.PRODUCTFEATURE, "Black");
product1.putString(HAParamType.BRAND, "HUAWEI");
product1.putDouble(HAParamType.PRICE, 6999.00);
product1.putString(HAParamType.CURRNAME, "CNY");
product1.putLong(HAParamType.QUANTITY, 1);
Bundle product2 = new Bundle();
product2.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03QJ2J90");
product2.putString(HAParamType.PRODUCTNAME, "HUAWEI Mate 40 Pro");
product2.putString(HAParamType.CATEGORY, "Phone/Mate/Yellow");
product2.putString(HAParamType.PRODUCTFEATURE, "Yellow");
product2.putString(HAParamType.BRAND, "HUAWEI");
product2.putDouble(HAParamType.PRICE, 6999.00);
product2.putString(HAParamType.CURRNAME, "CNY");
product2.putLong(HAParamType.QUANTITY, 1);
ArrayList items = new ArrayList();
items.add(product1);
items.add(product2);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putParcelableArrayList("items", items);
ecommerceBundle.putString(HAParamType.TRANSACTIONID, "T12345");
ecommerceBundle.putString(HAParamType.STORENAME, "HUAWEI Store - Online");
ecommerceBundle.putDouble(HAParamType.REVENUE, 37.39);
ecommerceBundle.putDouble(HAParamType.TAXFEE, 2.85);
ecommerceBundle.putDouble(HAParamType.SHIPPING, 5.34);
ecommerceBundle.putString(HAParamType.CURRNAME, "CNY");
ecommerceBundle.putString(HAParamType.VOUCHER, "NEW_PHONE_2020");
hiAnalytics.onEvent(HAEventType.COMPLETEPURCHASE, ecommerceBundle);
HUAWEI Analytics Parameter |
Name |
Google Analytics Field |
Value Example |
|---|---|---|---|
TRANSACTIONID |
Transaction ID |
ti |
T12345 |
REVENUE |
Transaction Revenue |
tr |
37.39 |
PRODUCTID |
Product SKU |
pr<productIndex>id |
HUAWEI_Mate_40_AI8I03Q423G |
QUANTITY |
Product Quantity |
pr<productIndex>qt |
1 |
The sample code is as follows:
HiAnalyticsInstance hiAnalytics = HiAnalytics.getInstance(this);
Bundle ecommerceBundle = new Bundle();
ecommerceBundle.putString(HAParamType.TRANSACTIONID, "T12345");
ecommerceBundle.putDouble(HAParamType.REVENUE, 37.39 );
Bundle refundedProduct = new Bundle();
refundedProduct.putString(HAParamType.PRODUCTID, "HUAWEI_Mate_40_AI8I03Q423G");
refundedProduct.putLong(HAParamType.QUANTITY, 1);
ArrayList items = new ArrayList();
items.add(refundedProduct);
ecommerceBundle.putParcelableArrayList("items", items);
hiAnalytics.onEvent(HAEventType.REFUNDORDER, ecommerceBundle);