Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Statcounter Code

Asked Modified Viewed 5,169 times
M
mikehenson
M
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Junior Member

I've placed my statcounter code at the top of themes/templates/footer.php before <?php because that's where a post I read said it should be placed but when I view the source code of pages in a browser the code is not showing.

The code needs to be placed before </BODY> but I can't find any pages that contain this tag.

Am I in the wrong place?

Many thanks

Mike
0 replies

8 posts

H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

Post your code here: http://www.phpfusion-mods.com/forum/v...forum_id=9 and we'll see what we can do.
0 replies
M
mikehenson
M
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

I'm sorry but I don't understand why I need to post the code.

Statcounter's code is very similar to Google Analytics and I'm sure I can't be the first to want to insert this type of code in php-fusion.

Have I posted this request to the wrong Forum; if I have I apologise.

Mike
0 replies
M
mikehenson
M
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Bump
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

It makes it easier to diagnose a problem if you can see the offending code. I posted the link as this is a modification problem, not a core issue.

Anyway......
If the code needs to be placed in-between <body> and </body>, then place it in includes/footer_includes.php, which is [currently] unused.

FYI, I could only find one other post on statcounter on the mods site and it wasn't answered.
0 replies
M
mikehenson
M
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Thank you.

As I said the Statcounter Code is almost identical to the Google Analytics Code - just a snippet of Javascript.

I had looked into includes/footer_includes.php but as you say it's empty and I was looking for the </body> tag; where is it, it must exist somewhere?

Many thanks

Mike
0 replies
G
glamourca
G
  • Newbie, joined since
  • Contributed 1 post on the community forums.
answered
Newbie

It makes it easier to diagnose a problem if you can see the offending code. I posted the link as this is a modification problem, not a core issue.
0 replies
D
dfmurphy
D
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 19 threads in the forums
answered
Member

I have statcounter on my site and I used a custom panel. This way it works without making any core code changes and it works in every theme.

Go to Admin Panel, System Admin tab.

Click Panels. Add New Panel.

Panel name: Statcounter
Panel filename: leave at none

Panel content: paste the code from statcounter into this box. You've got to remove the word 'content' and replace it with your code. You've got to do a little editing to make sure the quotes thing work. To do this make sure your statcounter code goes between the double quotes around 'content' ... do not remove the double quotes, but use them. Also, look carefully at the statcounter code and replace all of their double quotes with single quotes. It will work just fine.

Save your work and then enable/place the panel where you'd like it. Mine works fine.

If you'd like the panel to be collapsible, change the first and last statements as so:

opensidex("StatCounter", true, "off"wink;
...
closesidex();

Hope that helps.
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

Quote

mikehenson wrote:
Thank you.

As I said the Statcounter Code is almost identical to the Google Analytics Code - just a snippet of Javascript.

I had looked into includes/footer_includes.php but as you say it's empty and I was looking for the </body> tag; where is it, it must exist somewhere?

Many thanks

Mike


includes/footer_includes.php is automatically placed between the body tags, so just enter your code...

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: footer_includes.php
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

echo "--- your code--- ";

?>


You'll probably need to format it for php - just change " for ' , except the closing ";

or use dfmurphy's method.
Edited by HobbyMan on 22-05-2009 14:30,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 8 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

D
D
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 19 threads in the forums
H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
M
M
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
G
G
  • Newbie, joined since
  • Contributed 1 post on the community forums.

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet