I am running a Javascript redirect (with location.replace) to redirect someone who clicks on a Facebook ad to the desired page I want them to visit. The reason I did that was so I could track the visitor’s activity. I added Google Analytics before the location.replace and then uploaded it.
It seems that the only time it tracks any activity is when I test the page (type the exact URL in and visit it). I know for a fact, after checking my Facebook ads insights, that 40 people have clicked on the link, yet Google Analytics tracks none of it.
Why would Google Analytics not pick up the activity?
Google analytics does not have time to send the tracker before the page is redirected.
Try adding a
setTimeout: