我正在尝试记录博客网站每位作者的点击次数。
ga('send', 'pageview'); (in the header with the ga code to track each page)
ga('send', 'pageview', { 'dimension1': 'William' }); (only on blog pages, I want to record the hits of each author)
不幸的是,由于网站的模板,我不能只使用ga set
然后发送网页浏览。
每次加载页面时我会获得2次点击,因此在Google Analytics中显示的数据不正确吗?
答案 0 :(得分:1)
是的,您将获得双页浏览量不正确。但是你可以把你的代码放在if模式下吗?
if(currentPage != 'blogpage') //put your conditions identifying if it's blog or not
{
ga('send', 'pageview'); (in the header with the ga code to track each page)
}else
{
ga('send', 'pageview', { 'dimension1': 'William' }); (only on blog pages, I want to record the hits of each author)
}