So if you found this page then you are in luck, because you probably landed on this page first:
And if you tried what is written on there, you know that it DOES NOT work. I still can’t figure out why Google offers that as their official advice when it clearly does not work. Here is why:
- Your link will redirect before Google finishes the logging call to their server.
- _trackPageview does not offer any callbacks, so there is no way to detect completion
- _trackEvent has a callback so we are piggy-backing on it to log _trackPageview
- You can set the _trackEvent to whatever, I am just using what makes sense to me here
Anyways — Enjoy, I hope this helps someone out there. If I am wrong, or if you know a better way to do this, please let me know!