nuxt.js - 插件“电子商务”没有方法“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 的信息。
为什么现在不行了?为什么谷歌分析页面上没有信息?
解决方案
推荐阅读
- javascript - 如何放置适合整个页面的按钮?
- html - Bootstrap4对齐列
- javascript - Sweetalert2 textarea 输入显示在电子邮件中
- javascript - 未捕获的类型错误:无法读取未定义的属性“翻译”
- c# - UWP 中的系统声级
- sql - 如何在 PostgreSQL 中列出项目和计数(*)
- laravel - 未找到 Laravel 中间件类“App\Http\Middleware\CheckAuth”
- angular - 角。寻求有关解决与 AuthGuard 和指令一起使用的同步调用问题的帮助
- java - @QueryParam 仅限制 URL 中的一个值
- java - 语言级别 7 不支持增强的“开关”块 - Android Studio