Samuel Santos
Member
Posted 4 years ago #
When I activate the plugin I get a 404 HTTP error for the adsense-track.js file (http://www.samaxes.com/adsense-track.js (404)).
The path should be http://www.samaxes.com/wp-content/plugins/google-analytics-for-wordpress/adsense-track.js.
The path for custom_se.js file is just fine.
Any idea?
Thanks,
Samuel Santos
Hi. I am having the same problem. It'd be great if this were fixed! Thanks.
malexan
Member
Posted 4 years ago #
I have the same issue with the adsense-track.js file. I actually, in my case the reference to the file changes. My permalinks are set up so that each post URL ends with a slash i.e. like a directory. So the adsense-track.js file path is always the full post URL plus adsense-track.js.
For example: http://www.site.com/post-slug/adsense-track.js
joelbacklund
Member
Posted 3 years ago #
Hi Guys!
I also have the same problem, have you found any solution for it?
Best regards,
Joel
Got it!
This function (line 366 on googleanalytics.php):
function track_adsense() {
echo("\t<script src=\"".$pluginpath."adsense-track.js\" type=\"text/javascript\"></script>\n");
}
Is using $pluginpath, but not declaring it global. If I modify it like so:
function track_adsense() {
global $pluginpath;
echo("\t<script src=\"".$pluginpath."adsense-track.js\" type=\"text/javascript\"></script>\n");
}
It works. At least on my install... Joost?
Should be fixed in version 2.5.5, the forgotten global was indeed the issue, as well as the fact that multiple plugins were using the $pluginpath variable, which caused the directory to be wrong sometimes.
Hi Joost,
Now I have the same problem (only from v. 2.7, not before), but I don't see the file named adsense-track.js
Thanks and... Merry Xmas :-)
Max
hogudo: this shouldn't occur anymore as the file is no longer needed... Have you updated to the last version of the plugin?