1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Plugin dos not work.

Discussion in 'Better Analytics' started by mboveiri, Jul 21, 2015.

  1. #1
    hi.
    i installed last version of your plugin's on wordpress version(4.2.2) but plugin not working properly and Google analytics was not add to my blog.

    this is my console errors;

    http://imgur.com/70LOTJo

    thanks.
     
    Solved! View solution.
    mboveiri, Jul 21, 2015 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    There is something on your server that is adding HTML to the JavaScript file for some reason... if you look here:

    http://blog.mboveiri.ir/wp-content/plugins/better-analytics/js/loader.php?ver=1.0.8.js

    This part at the end is not part of the included JavaScript, but something else is adding HTML to the file:
    <div style="text-align: center;"><div style="position:relative; top:0; margin-right:auto;margin-left:auto; z-index:99999">
    </div></div>
    HTML:
    Whatever it is, seems to be adding it to all pages of your site, even error pages. For example if you look at the source of this, it's there too: http://blog.mboveiri.ir/somerandomurl
     
    digitalpoint, Jul 21, 2015 IP
  3. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #3
    I wonder if your php.ini is set to use the auto_append_file directive, where it automatically includes an extra external PHP file on every PHP request. If that's the case, if you open the better-analytics/js/loader.php file, and you add an exit; function to the end of it like so:
    echo 'BetterAnalytics._BA=new BetterAnalytics.BA();';
    exit;
    PHP:
    Does that fix it (with the HTML not longer showing in the loader.php URL)?
     
    digitalpoint, Jul 21, 2015 IP
  4. mboveiri

    mboveiri Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    hi.
    thanks for your replay.
    i checked my php.ini and auto_append_file dos't have a Value.
    And the other thing that is why this html line was only added to your scripts,I'll checked other scripts and none of them have this line.
    and those working properly.
    anyway thanks for your effort,i will let you know the result.
    Thanks.
     
    mboveiri, Jul 21, 2015 IP
  5. #5
    It's happening to all your PHP files. Even your error pages... it's just a little unique here because this PHP file isn't outputting HTML, it's outputting JavaScript.

    As far as figuring out what's adding it, if you have shell access to your server, you could grep for a string it's adding, like: "z-index:99999".

    Also, auto_append_file can be set within httpd.conf or .htaccess files.

    I did some searching, do you use a PHP host that adds their own advertising to your pages? The exact same code showed up in a user's WordPress RSS feed, and it turned out to be an issue with their hosting provider:

    https://wordpress.org/support/topic/extra-code-to-rss-feed
     
    digitalpoint, Jul 21, 2015 IP
  6. mboveiri

    mboveiri Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    oh yes,you are right,sorry I did not notice;
    and i add

        echo 'BetterAnalytics._BA=new BetterAnalytics.BA();';
    exit;
    Code (markup):
    to loader.php,but the problem still exists.
    i'm on free-host provider for now to test my project.it's strange :) but no any ads show's at my pages.
    it became clear that the problem of my hosting provider.
    thanks for your effort and replay's.
     
    mboveiri, Jul 21, 2015 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    Ah, yeah... everything I've read points to things like free hosting companies doing weird things to the source of your PHP pages... sometimes inserting hidden links, sometimes inserting advertisements, etc. In this case it seems like they are inserting a blank spot maybe for future use.

    I suspect if you created the most basic PHP file and ran it on your site, you would see the same weird HTML getting added to the end if you ran a PHP file like this and looked the source:

    <?php
        echo 'Hello world!';
    PHP:
     
    digitalpoint, Jul 21, 2015 IP
  8. mboveiri

    mboveiri Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    :)
    i created /test.php to test it, but the code does not exist in source.??
    it may occurred by it's not indexed yet by host crawler....maybe.

    goo. gl/QRbXNm
     
    mboveiri, Jul 21, 2015 IP
  9. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #9
    Hmm... that is strange. I guess they have some logic on what they are adding HTML code to. Like maybe it has a minimum content length or something. Unfortunately the only way to know for sure would be to try and get an answer from the hosting provider.
     
    digitalpoint, Jul 21, 2015 IP
  10. mboveiri

    mboveiri Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #10
    :)
    anyway the "free host" is "free host", and not more than the expected."Pay the piper and call the tune"
    thaks for your help and replay's.
    and sorry for taking your time.
     
    mboveiri, Jul 21, 2015 IP