Fixes #4142, add ability for plugins to customize generated JavaScript tracking code and generated image tracking links.