Google Analytics - Customizable and Interactive Rich Data For Your Website

计算流量的网站,首先你要有gmail的账户,并且你已经在你的 Google Analytics 里面加入了你的网站,并且知道你的Profile ID , 不知道也没有关系,你可以在网址上获得你的ID,例如,我加入我的博客 newyorkphper.iteye.com到我的 Google Analytics ,并且点击EDIT(编辑)的链接之后,网址是 https://www.google.com/analytics/settings/profile_summary?id=24709731,这样,24709731就是你的 Profile ID

如果觉得麻烦,那么可以用下面的程序获得:

<?php
define('ga_email','youremail@email.com');
define('ga_password','your password');require 'gapi.class.php';$ga = new gapi(ga_email,ga_password);$ga->requestAccountData();foreach($ga->getResults() as $result)
{echo $result . ' (' . $result->getProfileId() . ")<br />";
}

下面的是代码

How do I track dynamic sites?

If your website pages are created dynamically with a technology such as PHP or ASP, you can include the tracking code in a separate file that gets included as part of the overall page template.

The following example illustrates how you might do this using PHP, but the solution applies equally to any similar website technology (e.g. ASP or JSP). To track dynamic websites, please follow the steps below.

1. In a separate file, include the standard tracking code. For example, you might have a file called 'analyticsTracking.php' that contains the following:

<?
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
</script> <?php
// End Analytics tracking code
?> 

2. In the standard page template for your website, include the tracking code file before the closing </body> tag. Again, please note that this very simple example illustrates one way you might track dynamic websites using PHP, but the steps may be slightly modified depending on your particular website technology and the way your website pages are generated.

    <html><?php include ("header.php"); ?><body><?php include ("sideNav.php"); ?><?php include ("main.php"); ?><?php include ("analyticsTracking.php"); ?></body></html>

有关 google analytics相关推荐

  1. 博客园 cnblogs博客添加Google Analytics统计

    在cnblogs的文章列表中只可以看到自己的每篇文章的页面浏览量,没有详细的统计信息.Google Analytics作为强大的统计工具,能得到几乎所有想要的统计信息,是博客不可多得的好工具,本文介绍 ...

  2. Google Analytics功能篇 - 如何跟踪邮件打开率与点击率

    有些朋友总会问我,在作邮件营销时,应该如何来跟踪这些流量呢?以便能知道发送的成功率,打开率,点击邮件中的链接数量,怎么实现这样的功能呢? 另外,有一个做邮件群发的朋友给我说,加载这样的链接属于典型的要 ...

  3. 代码简介:向圣诞老人和他的精灵学习Google Analytics(分析)

    Here are three stories we published this week that are worth your time: 这是我们本周发布的三个值得您关注的故事: Learn G ...

  4. 在像Angular2这样的SPA应用中使用Google Analytics的方法

    Angular2のようなシングルページアプリケーションでGoogleアナリティクスを使う方法 如何在像Angular2这样的SPA应用中使用Google Analytics? 试着调查了一下. 由于S ...

  5. Jekyll博客统计访问量,阅读量工具总结--LeanCloud,不蒜子,Valine,Google Analytics

    我用 GitHub Pages搭建了jekyll的博客后,想要在页面上实现访问量的统计. 因为实在GitHub上搭建的静态博客,不能像WordPress一样可以操作php和数据库,自然只能借助第三方工 ...

  6. (转载)Google Analytics(Google分析)使用技巧

    Google Analytics(Google分析)是Google的一款免费的网站分析服务,自从其诞生以来,即广受好评.Google Analytics功能非常强大,只要在网站的页面上加入一段代码,就 ...

  7. Google Analytics 图文全攻略

    最近一段时间,因为工作的需要,小励使用GA(GA是Google Analytics的简称)比较频繁,所以花时间研究了一下,从不太了解到会使用(呵,远还没有到精通的地步),发现了很多有价值的地方,今天在 ...

  8. Google Analytics 跟踪代码安装后状态总是显示'未安装跟踪代码'

    最近要使用Google Analytics,但是在跟踪代码安装后状态总是显示'未安装跟踪代码'!如下所示:   在Google Analytics的帮助中"排查常见的跟踪设置错误" ...

  9. Google Analytics虚拟页面和事件追踪的区别

    今天在蓝鲸的网站分析笔记中,看了Google Analytics虚拟页面和事件追踪这两个功能的介绍文章,两者是事件跟踪(用来记录不产生页面浏览的用户交互行为)的两种方式.但是仔细对比后却有所区别,具体 ...

  10. Google Analytics使用说明

    Google Analytics使用说明 转载▼ 一.Google Analytics 产品简介 1. 产品简介 Google Analytics(是一款免费的 Web 分析产品,根据它提供的丰富详尽 ...

最新文章

  1. if you want to go to ruiyuan fund
  2. 洛谷P2286 [HNOI2004]宠物收养场
  3. Qt QString 与char* 相互转换
  4. 软件推荐┊最有效防止被聚生网管、P2P终结者等管理软件控制的小工具——ARP防火墙单机版...
  5. 前端工程师必备的ps技巧 — 切图
  6. mac os 系统word文档批量更改图片尺寸问题汇总
  7. 【托业】【新托业TOEIC新题型真题】学习笔记3-题库二-P5-6
  8. 你的支付授权失败。请核对你的信息并重试,或尝试其他支付方式。 解决方案
  9. 工欲善其事之Redis可视化管理工具
  10. 苹果截屏快捷键_MacOS截屏的那些事儿
  11. 解决使用vscode写typescript变量报错无法重新声明块范围变量
  12. 反问疑问_反问疑问句的用法
  13. linux命令——ll详解
  14. 微博指定日期舆情数据爬虫获取—基于中文金融词典(python)
  15. CKEditor 4使用方法,来自http://docs.ckeditor.com/#!/guide/dev_ckeditor_js_load官网地址
  16. 详细解读阿里云开源PolarDB总体架构和企业级特性
  17. 你们期待已久的微信功能,终于要来了
  18. Python- 线程和进程
  19. SAP FICO - 外币交易(汇率类型/货币交换汇率)
  20. [环境搭建八] 深度学习环境搭建--常见问题解决方案汇总

热门文章

  1. C语言基础知识(一)-------C++语言结构
  2. 8 WM配置-主数据-定义门(Dock Door)
  3. 16 PP配置-生产计划-主数据-定义MRP区域
  4. c语言写数码管,各位大神,如何用C语言实现在数码管上实现1234同时亮
  5. glob.glob() + os.path.join() :找到文件路径,拼接路径
  6. 损失层SoftmaxWithLossLayer
  7. shell脚本:实现文件覆盖写入、文件内容追加写入
  8. phpcmsV9 如何开启“会员注册” - 教程篇
  9. webStorm编辑器(左侧目录)如何显示、隐藏?
  10. .jsp页面提交form表单,后台却无法获取input文本框value值