我的网站使用Google Tag Manager跟踪页面浏览量,并在某些页面上使用ga('require', 'ec')
加载增强型电子商务插件,但出现了错误:
未捕获的引用错误:ga未定义
代码片段:
ga('require', 'ec');
function onProductClick(product, url, key) {
ga('ec:addProduct', {
'id': "'" + product.product_id + "'",
'name': product.model_name,
'category': product.series_name + '/' + product.dealer_name,
'brand': product.brand_name,
'variant': product.model_name,
'position': key
});
出了什么问题?