btmorex
Member
Posted 4 years ago #
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.
blogher8
Member
Posted 4 years ago #
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!
btmorex
Member
Posted 4 years ago #
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? :) )