StatCounter User Forum  
StatCounter Free web tracker and counter

Go Back   StatCounter User Forum > StatCounter.com > Help

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 08-31-2007, 06:41 PM
Frostblue Frostblue is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Default Statcounter and Wordpress blog

From what I've read it seems Statcounter doesn't work well with free Wordpress blog, since Wordpress doesn't allow javascript and Statcounter only works best in the javascript version.

I did install Statcounter in my free Wordpress blog and the counter does seem to work fine. The only problem is that on my site the counter doesn't really display correctly - meaning instead of only having the Statcounter button, there are also parts of the code displayed on top of the button as well.

It would be weird if this'd mean in order to have Statcounter with my blog I'd have to put up with having the codes shown on my site. It's not a big enough reason for me to either give up Statcounter or Wordpress, but it is still quite an annoyance.

Any help would be much appreciated.
  #2  
Old 08-31-2007, 07:26 PM
Arne's Avatar
Arne Arne is offline
Moderator
 
Join Date: Sep 2004
Location: Lulea, Sweden
Posts: 5,465
Default

Not under any circumstances the code needs to be displayed on the pages if it is pasted correctly to the source of the page. So there must be some kind of mangled code on your page. View the source code and take a look, and don't paste the counter code in HTML mode. But that is probably a doing by the Wordpress, to make the Javascript useless if they don't allowe it. Post the URL to your page so we can look at it, if you can't find the error by your self.

Last edited by Arne; 08-31-2007 at 07:29 PM.
  #3  
Old 09-01-2007, 03:21 AM
Frostblue Frostblue is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Default

That's what I think too so I guess I did something incorrectly...

Although I did paste the Statcounter code as given to the textbox in the Wordpress's text sidebar widget as instructed on Wordpress site.

Here's the blog link: http://extravirgin.wordpress.com , the statcounter is in the sidebar.
  #4  
Old 09-01-2007, 03:28 AM
Car Guy's Avatar
Car Guy Car Guy is offline
Moderator
 
Join Date: Jan 2007
Location: Vancouver, Canada
Posts: 4,927
Default

Hello Frostblue

Until Arne or someone else gets a look at your page code, and me not being an expert in Wordpress, I am wondering if you have access to place the code in the footer? The footer is the best place to put the code.

Richard
  #5  
Old 09-01-2007, 06:12 AM
Arne's Avatar
Arne Arne is offline
Moderator
 
Join Date: Sep 2004
Location: Lulea, Sweden
Posts: 5,465
Default

Quote:
Originally Posted by Frostblue View Post
That's what I think too so I guess I did something incorrectly...

Although I did paste the Statcounter code as given to the textbox in the Wordpress's text sidebar widget as instructed on Wordpress site.

Here's the blog link: http://extravirgin.wordpress.com , the statcounter is in the sidebar.
Are you sure that is the code you get from Statcounter wizard? I belive Wordpress did something to it

Quote:
<!-- Start of StatCounter Code -->
<script type="text/javascript">
var sc_project=2889733;
var sc_invisible=0;
var sc_partition=29;
var sc_security="d9b57fa9";
</script>

<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript>
<div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c30.statcounter.com/2889733/0/d9b57fa9/0/" alt="best tracker" /></a></div></noscript>
<!-- End of StatCounter Code -->
Those parts in red bold text is missing from the code on your blog page! So the first part is only seen as any regular text on the page by the browsers. Thats also the reason it's visible, as normal text are.

The second part of the code is missing the Javascript link to the .js file on Statcounters server. What you have left is what should be the <noscript> part of the code, used by Javascript disabled browsers. But since <noscript> tag is missing, the remaining code works as the "HTML only" version of Statcounter, logging pageloads but not all the detailed stats the full counter can give.

I don't know much about Wordpress but my guess is, that Wordpress is removing anything that can make a Javascript work, leaving only the <noscript> parts and any other non scripting content. Delete what you have of the counter on the page, then go back to the counter wizard and choose the HTML only version of the counter and paste it to the page.

As Car Guy says, the footer is the best place to put the code, not only on Wordpress pages. But it should work on the sidebar also, no need to move it unless you see any problems with it.
  #6  
Old 09-01-2007, 07:49 AM
Frostblue Frostblue is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Default

Hmm, you're right. The Statcounter-issued code is the same as the one in your quote. But when I copied and pasted it on Wordpress widget it's saved as the version without those red bold text. So Wordpress did tamper the code.

There doesn't seem to be an option to put the counter on the footer instead of sidebar too, as Wordpress seems to be very strict with its page template. I'm starting to like Wordpress less now...
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:13 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.