• Tracking of downloads isn’t working right for non-www domains (i.e. blog.example.com). Technically, it actually works, but the tracked url looks bad (“/downloadsblog./path/to/file”). This is because of line 475 of googleanalytics.php:

    $file = str_replace('www.',"",$file);

    I fixed it locally by changing “www.” to “blog.”, but obviously there’s a general way to do this. Just thought I’d report it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • So if I am not using www. in my URLs, how do I fix this?
    Do I just replace line 475 with what you have above?
    Thanks!

    Thread Starter btmorex

    (@btmorex)

    It depends on your domain. If your domain is blog.example.com

    change:
    $file = str_replace('www.',"",$file);
    to:
    $file = str_replace('blog.',"",$file);

    If you’re just using example.com, I don’t think you need to do anything.

    Hmm I’ll have another look at this, seems like something I should be fixing ?? (or getting rid of in the first place, why not leave the www in there? ?? )

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Google Analytics for WordPress] downloads tracking doesn’t work right with non-www domain’ is closed to new replies.