F
F
frontendo2020-11-18 10:09:59
Google Analytics
frontendo, 2020-11-18 10:09:59

Is it possible to dynamically enable and disable tracking by individual Google Analytics 4 counters on individual pages within a SPA?

We have a website - a single page application. The site has a main Google Analytics counter that tracks all page views. Some "special" pages also include additional Google Analytics counters. When the user navigates past "special" to the next page, these counters are removed.

ga.remove(nameOfAdditionalCounter);

Now there is a problem with switching to Google Analytics 4, which must be enabled via gtag.js
We did not find a similar method in the gtag documentation. Is it even possible to implement removal of counters in gtag without reloading the page?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question