开发者

Using Google Analytics with an Ajax webapp

So I've got an Ajax-based webapp. The homepage serves most - almost all - of the site's functionality. It's split into 3 columns, and the first two are loaded from the page's HT开发者_StackOverflowML. The third column is loaded dynamically based on what is selected in the second column.

Would tracking an Ajax-based app with Analytics be as easy as putting the tracking code at the bottom of the PHP file that returns the contents of the third column? This seems logical to me, but, I'm a bit of an Analytics newbie and am sure you guys have much better answers.

Jack


As far as I know, this is usually done by calling ga.js's tracking events in your Ajax code. Including the snippet <script> probably wouldn't work.

There used to be a number of reference pages on the Google Analytics docs ("How to track Ajax applications"), but they are all gone for some reason.

The info in this support thread looks good. This is the asynchronous way to track a page view:

_gaq.push(['_trackPageview', '/pagefilename1']);

there are more push() examples in the reference.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜