chrisyates 0 Report post Posted April 7, 2010 I was wondering how to add web stat code to all my pages. I've tried to add it to the custom code area within WP but no luck. If I add it in either the 'Header Scripts' or Footer Scripts and Analytics' sections and then save I get taken to a page of my website which shows an 'Error 404 - Not Found' page. The code I am trying to add is this: <!-- Begin Web-Stat code 2.0 http --> <script type="text/javascript" src="http://server4.web-stat.com/wtslog.pl?al207003,3"></script> <noscript><p> <img src="http://server4.web-stat.com/3/al207003.gif" style="border:0px;" alt="traffic analysis"/></p></noscript> <!-- End Web-Stat code v 2.0 --> Share this post Link to post Share on other sites
cmunns 16 Report post Posted April 7, 2010 Try putting it in the body of your site. You can add it to the header.php file after the `` Let me know if that helps Share this post Link to post Share on other sites
chrisyates 0 Report post Posted April 7, 2010 Unfortunately no luck. Everytime I add the code and then click on 'Update File' I get another 404 error. Any other ideas? Share this post Link to post Share on other sites
chrisyates 0 Report post Posted April 8, 2010 So I removed the code and clicked the 'Update File' button again and it still takes me to a 404 error page? The strange thing is my site still seems to works fine. I decided to have a quick look through the header.php file and the only thing I can see that looks strange are the question marks as follows: <!-- This makes the comment box appear where the ?????????reply to this comment????????? link is --> Share this post Link to post Share on other sites
Andrew 207 Report post Posted April 8, 2010 Which theme and version are you on? This should e-a-s-y in the pro themes; (custom code option) Share this post Link to post Share on other sites
chrisyates 0 Report post Posted April 8, 2010 Yeah I thought it was going to be straight forward too! I'm using iBlogPro 3. Share this post Link to post Share on other sites
chrisyates 0 Report post Posted April 8, 2010 So I tried adding the simplified code in the custom code option and the page saves fine. It would seem that it has issues with JavaScript. The code I mentioned earlier in the post is obviously JS and it doesn't like it at all. The new code I tried was this: ` ` The thing is I want to use the JS code as it gives me more options, any other ideas on how I might implement the JS code. Thanks Share this post Link to post Share on other sites
cmunns 16 Report post Posted April 9, 2010 can you try linking an external JS file or does it have to be embedded directly in there? Share this post Link to post Share on other sites
chrisyates 0 Report post Posted April 9, 2010 I think it needs to be embedded directly. As a test I decided to try adding Adsense code as this is also JS and I have seen it done before in right handside widgets on other iBlog sites. I simply added a text widget to the right and pasted the Adsense code into it and tried to save. I again experienced the same problem of a 404 error?! As soon as I remove the code and save I don't get the error. Am I doing something wrong as others are quite happily adding their JS code on the right without problems? Share this post Link to post Share on other sites
cmunns 16 Report post Posted April 9, 2010 Well if you get a 404 it means that the file in question doesn't exist or can't be found. Maybe the javascript is adding code to the permalink that is screwing things up like filepath. Is it possible the code your pasting is bad. There is no reason why adsense wouldn't work especially if you've seen it on other sites. Also, make sure the widget you pasted the code into has a title. Try viewing the source of a page that you know works to see the code they have and reference it to yours for markup differences. Share this post Link to post Share on other sites