TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 04:22:37 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 232
  • Total: 232

Simple Stat Counter needed.

Started by AventuraMan, August 28, 2008, 08:46:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AventuraMan

Quote from: Ken. on August 28, 2008, 09:58:19 PM
Take a look at this topic on SMF... there are others as well.

http://www.simplemachines.org/community/index.php?topic=257245.0

Wow, i never thought this would be so tough.  Really!  Amazing.  I'm trying to put the google analytics info :

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-5440312-1");
pageTracker._trackPageview();
</script>

Before the </body> tag.  I found it and put it right before squeezing this tag as copy and paste right before the body tag and </div> tag.  And it shows an error page.  THANK GOD!! I backed my index.php template page and downloaded it in my PC.  If not my FORUM was a goner!!

For the life of me I don't know what to do or how to place this tag.  Looks like I would need expert help.  This tag seems to be more for regular HTML page and not PHP page.  What do you think?

AventuraMan

Quote from: Lesmondâ,,¢ on August 28, 2008, 10:04:36 PM
Quote from: AventuraMan on August 28, 2008, 09:33:14 PM

Gives me this error message:


I placed it inside of the CITYSCAPE TP Theme folder.

where did you put the text file?it should be in the same directory as your forum, I just got it working fine on one of my test sites

AventuraMan

This is a sad day for me! I never had soooooooooooo much problem with doing a counter.  Amazing! I'm going nuts on this one.  Or GOOGLE ANALYTICS doesn't record right away? or work? :uglystupid2:

OK. I went to my other site and it's a normal HTML page.  I placed the script in that site and page.  I visited it with my browser and nothing.

What am I doing wrong here? :tickedoff:

Lesmond

QuoteI placed it inside of the CITYSCAPE TP Theme folder.
thats why it wont work it needs to be in the main forum folder

IchBin

AventuraMan, take a step back and take a good deep breath. I don't think I've ever seen anyone panic so much....  First of all I hope you've learned a great lesson from making your changes. And that is, NEVER make any changes to your site without BACKING UP. Had you done this, all you'd have to do is restore the file you messed up. All of the SMF templates are PHP. You can see this by looking at their file extension. index.template.php <-- notice the ending?

If you're using TP, why not put your google code into a script block? In order to place your code into one of the SMF files you must first learn a little php. The echo() statement is what is used in ALL of smf's files to output the HTML. Take a read here on how to use it.
http://www.ichbin.us/index.php?topic=19.0

Ianedres

More than welcome to try this one: http://www.tinyportal.net/index.php?topic=18435.0

It resets daily, according to the server's time...