WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Google Analytics for WordPress] adsense-track.js wrong path (8 posts)

  1. Samuel Santos
    Member
    Posted 6 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

  2. blackc2004
    Member
    Posted 6 years ago #

    Hi. I am having the same problem. It'd be great if this were fixed! Thanks.

  3. malexan
    Member
    Posted 6 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

  4. joelbacklund
    Member
    Posted 6 years ago #

    Hi Guys!
    I also have the same problem, have you found any solution for it?

    Best regards,
    Joel

  5. Ze Fontainhas
    Moderator
    Posted 6 years ago #

    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?

  6. Joost de Valk
    Member
    Posted 5 years ago #

    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.

  7. hogudo
    Member
    Posted 5 years ago #

    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

  8. Joost de Valk
    Member
    Posted 5 years ago #

    hogudo: this shouldn't occur anymore as the file is no longer needed... Have you updated to the last version of the plugin?

Topic Closed

This topic has been closed to new replies.

About this Topic