1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

question on analytics & AJAX

Discussion in 'White Hat SEO' started by PurpleLaze, May 28, 2015.

  1. PurpleLaze

    PurpleLaze Registered Member

    Joined:
    Feb 11, 2010
    Messages:
    66
    Likes Received:
    18
    Location:
    FLA, USA
    hi,

    this may seem a stupid simple question so please bear mind im new to using dynamic pages and haven't played too much with jquery. yes i am aware split tests can answer this question, but asking those already on the trip can save me gas/time and help avoid internet traffic jams. c:

    say one were to use an infinite scroll/dynamic pagination plugin such as or similar to

    Code:
    https://wordpress.org/plugins/wp-infinite-scroll-posts/
    since this would feed the new page through AJAX (loaded on the same page), would analytics such as page views, ctr, etc. still be tracked?

    for example, i've seen some sites using ajax/jquery that the URL bar will show the same domain but you seem to access tons of different content pages without the subdirectories changing much. if a user just scrolled through like 20 pgs of posts loaded in ajax and just clicked thru one randomly, would all of those pages' impressions be trackable, or just the original post and the one clicked?

    i'm curious because if so, this will help bring a much smoother end user experience... but fuck them if i cant track it, i have a couple alternatives.

    any thoughts?

    thanks,

    -purp
     
  2. thecornstach

    thecornstach Newbie

    Joined:
    Oct 14, 2014
    Messages:
    15
    Likes Received:
    4
    Location:
    Canada
    It's called a "virtual page view" google provides a very good explanation of it.

    In most cases it just a one line copy paste to get it working the way you want it.
     
    • Thanks Thanks x 1
  3. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    766
    Likes Received:
    275
    Location:
    PHP Scripting ;)
    As far as I know, the analytics codes page view count even fires only once every actualy page load.If you want it to count all the ajaxified page loads(I hope you get what I mean), The simple fix would be to reload the analytics code just after every ajaxified page load. Wrapping the analytics code to a function, and firing it after every ajax loads would do the trick.

    Well, in that case, you may get the number of pageviews, but the url will remain the same, so it would end up like 10 pageviews on the same url in the stats.
     
    • Thanks Thanks x 1
  4. PurpleLaze

    PurpleLaze Registered Member

    Joined:
    Feb 11, 2010
    Messages:
    66
    Likes Received:
    18
    Location:
    FLA, USA
    That actually makes perfect sense and is exactly the kind of fix I knew had to exist somewhere in creative digitalspace. I imagine it would distort the data just how you describe, but that's not a problem for me with this project, since it should still be proportionate enough for me to measure. I'll have to gauge how it affects load time (analytics code is small so prob not too much), but at least I know what variables to look out for.

    Thanks guys, I'll take a look into this.