使用firebase软件包通过GTM v5增强电子商务标签

Fra*_* K. 5 android firebase google-tag-manager enhanced-ecommerce

我正在开发一个电子商务Android应用程序,我想通过GTM v5(包含在Firebase SDK中)跟踪Google Analytics上的增强型电子商务事件.

为此,要发送"展示次数"事件,我尝试将旧数据层转换为GTM v5使用Firebase SDK接受的捆绑包对象.

那么,下面的数据层

DataLayer.mapOf(
                    "currencyCode", "EUR",                                  // Local currency is optional.
                    "impressions", DataLayer.listOf(
                            DataLayer.mapOf(
                                    "name", produitsDispo.get(0).name,             // Name or ID is required.
                                    "id", produitsDispo.get(0).sku,
                                    "price", produitsDispo.get(0).price,
                                    "brand", produitsDispo.get(0).brand,
                                    "category", produitsDispo.get(0).category,
                                    "variant", produitsDispo.get(0).variant,
                                    "list", produitsDispo.get(0).category,
                                    "position", 1),
                            DataLayer.mapOf(
                                    "name", produitsDispo.get(1).name,
                                    "id", produitsDispo.get(1).sku,
                                    "price", produitsDispo.get(1).price,
                                    "brand", produitsDispo.get(1).brand,
                                    "category", produitsDispo.get(1).category,
                                    "variant", produitsDispo.get(1).variant,
                                    "list", produitsDispo.get(1).category,
                                    "position", 2),
                            DataLayer.mapOf(
                                    "name", produitsDispo.get(2).name,
                                    "id", produitsDispo.get(2).sku,
                                    "price", produitsDispo.get(2).price,
                                    "brand", produitsDispo.get(2).brand,
                                    "category", produitsDispo.get(2).category,
                                    "variant", produitsDispo.get(2).variant,
                                    "list", produitsDispo.get(2).category,
                                    "position", 3)));
Run Code Online (Sandbox Code Playgroud)

就是现在 :

Bundle myBundle = new Bundle();
myBundle.putString("currencyCode", "EUR");
myBundle.putParcelableArrayList("impressions", constructBundleImpressions(produitsDispo));
mFirebaseAnalytics.logEvent("ecommerce", myBundle);

  public ArrayList<Bundle> constructBundleImpressions(ArrayList<Item> produitsDispo){
    ArrayList<Bundle> bundleImpressions = new ArrayList<Bundle>();
    Bundle tempBundle = new Bundle();
    for (int i=0; i<produitsDispo.size();i++){
        tempBundle.clear();
        tempBundle.putString("name", produitsDispo.get(i).name);
        Log.d("AAAAA ; ", produitsDispo.get(i).name);
        tempBundle.putString("id", produitsDispo.get(i).sku);
        tempBundle.putString("price", produitsDispo.get(i).price.toString());
        tempBundle.putString("brand", produitsDispo.get(i).brand);
        tempBundle.putString("category", produitsDispo.get(i).category);
        tempBundle.putString("variant", produitsDispo.get(i).variant);
        tempBundle.putString("list", produitsDispo.get(i).category);
        tempBundle.putInt("position", i+1);
        bundleImpressions.add(tempBundle);
    }
Run Code Online (Sandbox Code Playgroud)

我已经使用值,触发器和代码配置了我的GTM容器,但点击未显示在Google Analytics信息中心上.

我认为发生此问题是因为Firebase不接受事件的复杂捆绑,因此,即使它是正确的,带有ArrayList的捆绑包也不会被Firebase事件记录器解释.

你对此有何看法?你遇到过这种问题吗?

Ben*_*tet 2

根据该页面 https://support.google.com/tagmanager/answer/7003315?hl=en

电子商务数组:稍后将提供对需要数据数组的电子商务标签(例如 Google Analytics 增强型电子商务)的支持。

发行说明通知该主题没有进一步进展: https://support.google.com/tagmanager/answer/4620708? hl=en&ref_topic=6003219