0

i found this answer in some threads here in stackoverflow https://stackoverflow.com/a/8692559, But my reputation is not enough to comment. Here is my question, does google analytic track still work if I set the Meta Refresh to 0 http://example.com/"> ?

Or should I use this method https://stackoverflow.com/a/8692588/3068292 instead of the above code?

Community
  • 1
  • 1
zen
  • 383
  • 3
  • 10
  • 21

1 Answers1

0

If you use async code, you probably refresh before the codes actually fires. Because async wait till the page is loaded to get executed. since there's no time after end-of-execution and new request, your track will be lost (at least, most of the time).

The wait sync works is that the page is not loaded until it load and fires the javascript with a response. This way, by the time it reach the refresh, all the tracking has been done.

Bart Calixto
  • 19,210
  • 11
  • 78
  • 114
  • thanks for responding @Bart, can you suggest on what should the best thing to do? – zen Jan 10 '14 at 06:02