Dealing with GA(I)

本文详细介绍了Google Analytics(GA)的安装与配置过程,包括跟踪代码的工作原理、如何收集数据及配置步骤。此外,还提供了GA JavaScript代码示例,帮助网站管理员更好地理解和实施网站活动跟踪。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Dealing with GA(I)

1. Introduction from GA
1.1 Overview
Tracking Code Overview
Send all the informations to the Analytics server via a list of parameters attached to a single-pixel image request.

How Does GA Collect Data
The HTTP request
Browser/system information
hostname, the browser type, referrer, language
First-party cookies

How the Tracking Code Works

How GIF Requests Are Classified
requestType
Page
Event
Transaction
Item
Var

1.2 Tracking Code
Tracking Site Activity
Ecommerce Tracking
Event Tracking
Cross-Domain Tracking
Traffic Source
Visitor Configuration

GA javascript is in mess http://www.google-analytics.com/ga.js

Urchin 7 vs GA

2. implementation
visit http://www.google.cn/intl/en/analytics/
click 'Access Analytics'

click 'Analytics Configuration' ------> 'create new configuration file'-----> type your domain name

The GA javascript code:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'xxxxxxxx']); // This is your GA number
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

Add these javascript block to my website. I changed my /var/www/index.html file from apache2.

references:
http://code.google.com/intl/zh-CN/apis/analytics/docs/
http://code.google.com/intl/en/apis/analytics/docs/
http://xiaolithinking.blogbus.com/logs/41170954.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值