Does preloading content from a page provide my Google Analytics statistics?

I would like to write myself a simple script that uses AJAX to load content from every page on my main navigation bar into a hidden div on the current page.

It’s just that I can preload as much of my important content as possible and get it on the user's computer (I hope) before he finishes with the current page and wants to move on.

I am worried that running a query for every page on the site, every time someone visits, will really ruin the validity of my Google analytics statistics.

How does AJAX interact with Google Analytics? Is it considered a "page visit"?

0
source share
2 answers

If you retrieve each page without running the built-in script, then the Google Analytics code will not run and should not be considered a pageview. I suggest not doing anything with the code after fetching each page (i.e. do not paste content into a hidden div).

+1
source

If you want to ajaxify your site by deleting pages and replacing them with ajax requests, then all you need to do on the GA side is call _trackPageView when you need to track page views.

+1
source

All Articles