English 中文(简体)
谷歌分析器和用麻省理工学院的请求装上一页
原标题:Google analytics and loading a page using ajax GET request

我有一个完全使用AJAX的移动站点,而且散列代码,基本上每一页点击都是一种链接,例如连接。

<a href= http://some-domain.com/my-page-122.php" hash-id= 122 >linkage</a>

Meaning that the page itself exists and it has ON IT google analytics page, HOWEVER, on the ajax request, I only ask to load a certein <div> on said page using jQuery s load(), so my question is: because the page is called for in it s entirety with the google analytics code and everything, will it still record it as a page view even though only a portion is injected to the page?

我之所以要问,是因为这个网站每天有大约500个独特之处,我们想要将其改用这一新的阿富汗复兴共和与民主军形式,因此,不记录分析器是一个很大的禁忌。

最佳回答

If you use jQuery you can bind to the global AjaxComplete event to fire a Pageview everytime an Ajax call completes:

jQuery(document).ajaxComplete(function(e, xhr, settings){
  var d = document.location.pathname + document.location.search + document.location.hash;
  _gaq.push([ _trackPageview , d]);
});

If you update the Anchor every time you do an Ajax call this will fire the full path including the anchor part of the url.

Note that if you load content using .load that has the Google Analytics Tracking code in it, it will run that code and fire a second pageview. So you want to make sure you don;t include the GATC on the ajax content to avoid double pageviews.

问题回答

该公司自动获得记录。 假设你重新使用同步代码,你可以记录你希望通过书面形式向彩虹阵列提出的许多页面访问:

_gaq.push([ _setAccount ,  UA-12345-1 ]);
_gaq.push([ _trackPageview ,  /home/landingPage ]);

在这种情况下,你可以建造你想要的、有/家庭/土地的URL。 请注意,如果“_gaq”已经做好了适当的即时工作,而_setAccount已经被推向,那么你就只需要推进“追踪调查”。

此外,这次活动可以由您的非洲宇宙航空研究开发机构退回,也可以在你所在的州或发起非洲宇宙航空研究开发机构请求时点击。

See





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签