A
A
Al2017-09-20 11:24:01
Google
Al, 2017-09-20 11:24:01

How do Yandex and Google analytical services react to asynchronous page loading?

If the content of a significant number of pages of the site is loaded by Ajax, is it necessary to do something in Yandex Metrics and Google Analytics in order to record visits to these pages? Or will these services themselves understand that the user has moved to such a page?

For example, there is a page site.ru/my-page , you can go to it via a direct link and it will be displayed as usual, and you can follow the link inside the site (let's say /my-page is a menu item that you can click on while on any site page) - in this case, the /my-page content will be loaded asynchronously and displayed in the same form as if you follow a direct link. It is important that when loading this content with Ajax, the url changes to /my-page in the browser lineusing the history api (not just silently taking the content and displaying it).

When I googled the information about this, I came across the fact that on some resources they write that it is imperative to send pageview type events to the analytics - otherwise the transitions within the site will not be recorded. And on others they write that supposedly when using the history api, no additional events need to be sent to analytical services, they will fix everything anyway. they react to changes in the address bar of the browser.

The question is, where is the truth? What is the right thing to do in my case? If you do not send anything about transitions, I will lose the necessary statistics or part of it, and if you send, then the statistics may be incorrect due to duplication of events. If someone knows how it actually works at the moment - please explain. Specifically interested in the behavior of Yandex metrics and Google Analytics.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Fedoseev, 2017-09-28
@Sanu0074

If we are talking about SPA (single page application), then use ssr (server side rendering) and everything will be ok in terms of ga and i.metrics.
If we are talking about pseudo-SPA (I did it myself :) ) when instead of clicking on a link you load content from its href attribute (or only a specific block from it, for example <main>) to make the site look like a SPA, then this is a shot in the foot. But if you really need it, here it is.
for ga
for i.metrics

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question