在Google Analytics中使用增强型电子商务时,您何时以及多长时间致电ga('发送','网页浏览')? [英] When and how often do you call ga('send', 'pageview') when using Enhanced Ecommerce with Google Analytics?

查看:86
本文介绍了在Google Analytics中使用增强型电子商务时,您何时以及多长时间致电ga('发送','网页浏览')?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将我们的网站迁移到Universal Analytics以及增强型电子商务服务。经过一些使用GA调试器的实验后,看起来你必须在调用 ga()之后调用 ga('send','pageview') 'ec:addProduct') ga('ec:setAction')方法来实际发送数据。
查看文档时( https://developers.google .com / analytics / devguides / collection / analyticsjs / enhanced-ecommerce
一些例子显示他们调用 ga('send','pageview')两次,一次在设置产品数据的开始和第二次,而在其他示例中, ga('send','pageview')仅存在于

  ga('create','UA-XXXXX-Y'); 
ga('send','pageview'); / *第一页视图在这里* /
ga('require','ec','ec.js');

'('ec:addProduct',{
'id':'P12345',
'name':'Android Warhol T-Shirt',
'类别':'服装',
'品牌':'Google',
'变体':'黑色'
'价格':'29 .20',
'数量': 1
});

//通过actionFieldObject提供交易级别信息。
ga''ec:setAction','purchase',{
'id':'T12345',
'从属':'Google Store - Online',
'收入':'37 .39',
'tax':'2.85',
'shipping':'5.34',
'coupon':'SUMMER2013'//用户在结帐时添加了优惠券。
});

ga('send','pageview'); //以初始综合浏览量发送交易数据。 / *但我们已经把它叫做顶部* /

以上代码是否会导致页面浏览我们还希望使用 ga('ec:setAction','checkout',{code $} 'step':step}); 并指定我们在分析帐户中定义的步骤号。看起来我们需要再次调用send pageview来发送这些数据。我尝试在单个页面视图中发送所有数据,但似乎每个网页浏览只能设置一个动作( ga('ec.setAction')),所以我们可以'在单个页面视图中同时发送产品交易数据和结帐步骤数据。分析中会多次记录多个网页浏览量,或者Google会检测到您简单的发送额外数据并且不会记录额外的数据我发现使用普通电子商务跟踪时,可以使用 ga('ecommerce:send'); ,是他们在增强电子商务追踪中的等价物吗?

解决方案

每次调用 ga('send','pageview'),新的综合浏览量将发送给GA。如果您只想发送更多数据,则还可以发送活动以避免双重页面浏览跟踪。

I'm attempting to migrate our site to Universal Analytics as well as the Enhanced Ecommerce services. After some experimentation using the GA debugger, it appears that you must call ga('send', 'pageview') after you have called your ga('ec:addProduct') and ga('ec:setAction') methods to actually send the data. When looking through the doc (https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce) some examples show that they call ga('send', 'pageview') twice, once at the beginning and a second time after setting the product data, while in other examples, ga('send', 'pageview') is only present at the end.

ga('create', 'UA-XXXXX-Y');
ga('send', 'pageview'); /*FIRST PAGE VIEW CALLED HERE */
ga('require', 'ec', 'ec.js');

ga('ec:addProduct', {
  'id': 'P12345',
  'name': 'Android Warhol T-Shirt',
  'category': 'Apparel',
  'brand': 'Google',
  'variant': 'black'
  'price': '29.20',
  'quantity': 1
});

// Transaction level information is provided via an actionFieldObject.
ga('ec:setAction', 'purchase', {
  'id': 'T12345',
  'affiliation': 'Google Store - Online',
  'revenue': '37.39',
  'tax': '2.85',
  'shipping': '5.34',
  'coupon': 'SUMMER2013'    // User added a coupon at checkout.
});

ga('send', 'pageview');     // Send transaction data with initial pageview. /*BUT WE ALREADY CALLED IT AT THE TOP */

Will the above code result in the page view being logged twice?

We also want to track our customers progression through the checkout using ga('ec:setAction', 'checkout', {'step' : step}); and specifiying the step number which we have defined in our analytics account. It appears we need to call send pageview again to send this data as well. I attempted to send all the data in a single page view but it appears you can only set one action (ga('ec.setAction')) per pageview so we can't send both the product transaction data as well as the checkout step data in a single page view. Will calling ga('send', 'pageview') multiple times log multiple page views in analytics or does google detect that your simple sending additional data and doesn't log the extra page views?

I've found that when using normal eCommerce tracking you can use ga('ecommerce:send');, is their an equivalent in enhanced eCommerce tracking?

解决方案

Every time you call ga('send', 'pageview'), a new pageview will be sent to GA. If you just want to send more data you can also send an event to avoid the double pageview tracking.

这篇关于在Google Analytics中使用增强型电子商务时,您何时以及多长时间致电ga('发送','网页浏览')?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆