Tag: jquery isotope综合

Google Analytics在Hash Change上设置PageView

我正在尝试在Isotope下获得一堆包含大量内容的主页 将每个哈希更改显示为Google Analytics中的综合浏览量。 最初,我打算将此作为事件,但它确实应该是网页浏览。 所以我设置了修改后的GA: (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘create’, ‘UA-XXXXXXXX-X’, {‘allowAnchor’: true}); ga(‘send’, ‘pageview’, { ‘page’: location.pathname + location.search + location.hash}); 在Google Analytics中,如果有人访问特定url,我会立即看到哈希标记 – 例如: http : //www.example.com/#pet-health如果他们重新加载页面,我会在GA中看到哈希,但是如果他们点击Isotope“nav”链接进入它。 如果他们点击,我只是看到“/” 在同位素射击中,我所拥有的似乎没有起作用: //Sets up filtering on click of Isotope navigational elements $(‘#isotopeFilters a, .subnav a, #isotopeContainer .isotopeNav a, .page-template-page-home-php #logo’).click(function(){ var selector = $(this).attr(‘data-filter’); var […]