开发者

How do I track Fancybox clicks in Google Analytics?

I have a page with 24 links that each open up a .html file in a modal window with Fancybox,开发者_如何学编程 and each .html file has a video embedded in it. How do I track to see who is opening which videos?


How google analytics works
You put a by Google provided javascript (the tracking code) on your page .
Everytime the page is loaded, the javascript is executed and a hit is recorded by Google.

How fancybox works
You can use fancybox in different ways but the default behaviour is that you feed it a link and it will open the content of this link inside an iframe
If you know how iframes work, you should know that they just load/display a page inside a page. But because they load an entire page, the by google provided javascript will also load.

Answer
So to finally answer your question...,

If you use fancybox by default (loading content inside an iframe) google analytics will already record the clicks on those pages.
If not you should check out the note below.

Note: This is how it works with the original Google Analytics tracking code. If you are using the new Asynchronous tracking you should really check out this page as it explains in detail how to hook custom events etc: http://code.google.com/intl/nl-NL/apis/analytics/docs/tracking/asyncUsageGuide.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜