Google Analytics(分析)来跟踪FireFox扩展的使用 [英] Google Analytics to track FireFox extension use

查看:159
本文介绍了Google Analytics(分析)来跟踪FireFox扩展的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Firefox扩展,希望跟踪它的使用谷歌分析,但我不能得到它的工作。

我试过手动从 ga.js 调用一个函数,但是由于某种原因,这不起作用。没有错误产生,但也没有收集任何数据。

我最后的尝试是有一个网站,只是持有跟踪的JavaScript,然后加载它的扩展配置了URL的iframe包含有意义的数据。这样,当我用浏览器访问所述网页时,分析正在被连接,但不是扩展。我试着把一些可见的JavaScript在网站上,并已确认该网站的JavaScript正在执行。这种方法也适用于其他跟踪器,但我不喜欢他们的输出,并希望谷歌分析。



任何想法我可以尝试做到这一点?解决方案是使用 解决方案

/rel =nofollow> Remy Sharp的迷你图书馆,用于跟踪书签和附加信息。用法很简单:

  gaTrack('UA-123456','yoursite.com','/js/script.js'); 

请注意,由于它不使用Cookie,浏览量和访问次数之间没有区别,在访问和访问者之间。但是,其余的功能相当可靠。

I'm developing a Firefox extension and would like to track its use with google analytics, but I can't get it working.

I've tried manually calling a function from ga.js, but that didn't work for some reason. No error was produced, but neither was any data collected.

My last attempt was to have a website that just holds the tracking javascript and then load it within the extension in an iframe with the URL configured so it contains meaningful data. This way the analytics are getting connected when I visit said webpage with a browser, but not in an extension. I've tried putting some visible javascript on the site and have confirmed the site's javascript is executing. This method also works with other trackers, but I don't like their output and would prefer Google Analytics.

Any ideas what else I could try to accomplish this?

解决方案

The solution is to use Remy Sharp's mini library for tracking bookmarklets and extensions with Google Analytics. Works like a charm.

Usage is as simple as:

gaTrack('UA-123456', 'yoursite.com', '/js/script.js');

Note that, since it doesn't use cookies, there's no differentiation between pageviews and visits, or for that matter, between visits and visitors. But, the rest of the functionality is fairly reliable.

这篇关于Google Analytics(分析)来跟踪FireFox扩展的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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