Answer the question
In order to leave comments, you need to log in
Google Analytics and redirect to JS
Friends, I'm trying to catch the number of clicks using Google. Everything works, but when using this redirect:
Google does not count the transition to this page. Inexplicably.
Now the scheme is as follows:
We go to the page - the GA considers the visit - a redirect.
Without a redirect, the visit counts.
Tell me, has anyone experienced something similar?
It won't work on the PHP header, since you can't send anything to the output before it, including the GA counter.
script type="text/javascript"
var url = "<?php echo $urls[$use]; ?>";
window.location.href = url;
/script
noscript
У вас отключен JavaScript. Для перехода нажмите сюда.
/noscript
Answer the question
In order to leave comments, you need to log in
Because analytics scripts are loaded asynchronously, after your redirect is completed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question