首页 > 解决方案 > 插件“电子商务”没有方法“addProduct”

问题描述

我有这样的测试代码:

      this.$ga.ecommerce.addProduct({
        'id': 'P12345',                   // Product ID (string).
        'name': 'Android Warhol T-Shirt', // Product name (string).
        'category': 'Apparel',            // Product category (string).
        'brand': 'Google',                // Product brand (string).
        'variant': 'Black',               // Product variant (string).
        'position': 1,                    // Product position (number).
        'dimension1': 'Member'
      });
      this.$ga.ecommerce.addItem({
        'id': 'P12345',                   // Product ID (string).
        'name': 'Android Warhol T-Shirt', // Product name (string).
        'category': 'Apparel',            // Product category (string).
        'brand': 'Google',                // Product brand (string).
        'variant': 'Black',               // Product variant (string).
        'position': 1,                    // Product position (number).
        'dimension1': 'Member'
      });
      this.$ga.ecommerce.addImpression({
        'id': 'P12345',                   // Product ID (string).
        'name': 'Android Warhol T-Shirt', // Product name (string).
        'category': 'Apparel',            // Product category (string).
        'brand': 'Google',                // Product brand (string).
        'variant': 'Black',               // Product variant (string).
        'position': 1,                    // Product position (number).
        'dimension1': 'Member'
      });

仅从这 3 个作品this.$ga.ecommerce.addItem中,在浏览器控制台中我得到:

在此处输入图像描述

最奇怪的是昨天它起作用了,我什至在谷歌分析上得到了一些数据。此外,在尝试实现 Google 增强型电子商务时,我安装了@nuxtjs/gtm,并且在浏览器控制台中创建事件时它似乎正在工作,但没有关于 Google Analytics 的信息。

为什么现在不行了?为什么谷歌分析页面上没有信息?

标签: nuxt.jse-commercegoogle-tag-managerenhanced-ecommerce

解决方案


推荐阅读