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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 744
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 581
  • Total: 581

Google Analytics with TP and Amber theme?

Started by lowflyerguy, March 14, 2009, 06:09:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lowflyerguy

I need to install Google Analytics in my forum.  It's running SMF 1.1 RC3, with TinyPortal v0.9.5, and Bloc's "Amber" theme.

Looking for instructions on how best to install the Google Analytics code, I see two schools of thought:

Most folks say to just paste the Google Analytics code into the index.template file (right before the </body> tag at the end).  I'm wondering if this is correct for my combination.

Others suggesting using the Global Headers and Footers mod. This apparently will add headers and footers to every page, and allegedly "works on all themes."  Users report that it makes it easy to insert the Google Analytics code with just a few clicks.

I like the idea of being able to easily insert the Google Analytics code into every page, assuming that works, of course.

Does anyone here know if the Global Headers and Footers mod will work with my combination (SMF 1.1 RC3, TP v0.9.5, and Bloc's "Amber" theme)?

What's the best way for me to get the Google Analytics code working on my forum?

Thanks for the help.

IchBin

lowflyerguy, first let me suggest that you update your SMF and TP installation. SMF has had some major security fixes since the 1.1 RC3 release. Also, there are some security fixes that have been put into TP since TP 0.9.5. If you choose to use TP 1.x beta3, you can place your google code into a top/upper block that will display your google codes just fine. There's no need to install another mod to get what you want if you're using TP.

lowflyerguy

Quote from: IchBinâ„¢ on March 14, 2009, 06:26:45 PM
lowflyerguy, first let me suggest that you update your SMF and TP installation.

Thanks, IchBin.  I know I'm overdue for the updates, I've been putting them off.  Perhaps next weekend.  Which versions would you suggest for SMF and TP?  I'm looking for the smoothest, least disruptive upgrade possible.
I have not upgraded any of these components before and do not want to break anything (my forum is pretty active, my users get nervous with any downtime, and I'm not very experienced with making code changes).

Quote from: IchBinâ„¢ on March 14, 2009, 06:26:45 PM
If you choose to use TP 1.x beta3, you can place your google code into a top/upper block that will display your google codes just fine. There's no need to install another mod to get what you want if you're using TP.

I have tried to avoid any other mods to make upgrades simple. 

A related question: If I add the Google Analytics code to my existing setup, then I upgrade SMF and TP, will the Google Analytics code (and, for that matter, my current layout and all boards with messages) remain intact?  Or will I need to go back in and reconstruct things?

Thanks for all your help - its very much appreciated.

IchBin

Generally, the upgrade should be very painless. IMO, that is one of SMF's strongest points. If you are not using any other mods than TP, then it should be very easy. Here's the steps you can take:

Pre-install - BACKUP EVERYTHING. Database and files.
1. Put forum in maintenance mode with a nice little message. :)
2. Download the SMF large upgrade package, upload all the files to your site replacing the existing files.
3. Run the upgrade.php file from the upgrade package by accessing it in your URL. www.yourdomain.com/forum_path/upgrade.php
4. Check forum and make sure everything is functioning as it should.
5. Download and install TP 1.0 beta3 in your package manager.
6. Bring forum out of maintenance mode if there are no probelms.

If there are problems, search for your problem here as its almost ALWAYS been posted about. If not, post your info here including what we ask for in the Posting Guidelines.

To answer your question about losing stuff. You should not lose anything. All blocks/articles/posts/boards etc should be left untouched.

lowflyerguy

Quote from: IchBinâ„¢ on March 14, 2009, 09:01:22 PM
Generally, the upgrade should be very painless.

Good, that's reassuring (hopefully I won't find some new way to screw things up  ;D).  TP is the only mod I've installed.

I will do a complete backup before touching anything.

Quote from: IchBinâ„¢ on March 14, 2009, 09:01:22 PM
2. Download the SMF large upgrade package

Which version of SMF would you recommend?  I've got 1.1RC3 installed.  I see the most recent v1.x seems to be 1.1.8....would that be best (and I assume no incompatibilities with TP or the Amber theme)?

Also, on my forum, when I go to Admin > package manager, I don't see any SMF updates there -- under Latest packages/New Packages I see several avatar packages, and under Package of the Moment I see a mod (the contents of these seem to rotate each time I come back there).

Maybe I'm not looking in the right place....what's the best entry point to access "the SMF large upgrade package"?  Is that done through the Admin center itself, or just by going to the SMF website and grabbing it?  If (as I suspect) one just needs to go to the SMF site via a web browser and download it, I'm not finding anything that that appears to be "the SMF large upgrade package"...is that it's literal name, or should I be looking for something else?

Sorry for the dumb questions -- the trick is always figuring out which general SMF instructions do/don't need to be done differently with TP installed (i.e. the exact border between one and the other isn't always obvious to us clueless noobs).

Thanks again for the help.

IchBin

Yes, if you want to use TP 1.0beta you will need to use SMF 1.1.x as TP is not updated to work with SMF2 yet.  Best way to get the SMF 1.1.8 package is to go to the SMF site and download it. :)
On the downloads page it says "Large Upgrade" above the downloads for it. http://download.simplemachines.org/

lowflyerguy

Oy....that went really, REALLY badly.  Ouch.   :-\

The upgrade to SMF 1.1.8 failed and I somehow killed my forum - after uploading the files and running the upgrade.php  file, all I was getting was some database error.  Yikes.

Fortunately, I took a lot of care not to overwrite any of the files when uploading - if there was an existing file name something like hoohah.php that would be replaced, I renamed the original file to hoohah_php.OLD.  So once things stopped working, I could go back and delete the (new) file hoohah.php, and rename the file hoohah_php.OLD back to hoohah.php.  That took a looooong time.  Yeesh, that was stressful (even though I had made a full backup before I did anything).  Thought I had completely destroyed the forum there for a while as I pieced everything back together.

OK, I need to get some sleep and take a big step back from this before attempting it again.  The piecemeal restoration of every file seems to have fixed things, and the forum appears to be OK.  Thank goodness - it would have been a disaster if it was unrecoverable.

Since the upgrade did not go smoothly, I will probably have to come back and ask a bunch of very dump questions before attempting this again.  Ack, I need a drink.... (where's a smiley with a big beer mug when you need it?).

I'll be back.

IchBin

Instead of changing files one by one, you should just use the backup to restore your files. There's no need to go in and renamed files one by one when you can just upload the files you backed up. Make sure you aren't using the full install package. That will overwrite your Settings.php file which will give you that error about the database.

lowflyerguy

Well, I was just trying to be extra careful.  It all seems to be fixed up again now, so I'm probably going to let sleeping dogs lie for now (for unrelated reasons, I need to have the forum up and functional for the next week or two, so since things went badly the last time I messed with it, I'll probably just leave it as-is for the time being).

I need to get a better handle on where various pieces of the forum are (or rather, should be), since I may actually have a partial duplicate of some of the SMF files (left over from the initial installation, I think) sitting in another directory on the server.  In any case, I will do my best to straighten things out before I attempt this again in another week or two.  I'll have a few questions then.

Thanks again for the assistance.

lowflyerguy

Well, looks like there's some minor damage somewhere in my setup.   :'(

One user (who is one of my co-moderators) is reporting that his left block is not showing up.

Also, when I look at "who's online" and follow the IP addresses of some of the search engine webcrawlers, I can see they are repeatedly hitting an error (over and over....there are many instances of this). The errors are consistently in the following three locations:

8: Undefined index: TPortal
File: /home/MYPATH/public_html/Themes/default/Login.template.php (eval?)
Line: 206
?topic=2094.msg17119

8: Undefined index: TPortal
File: /home/MYPATH/public_html/Themes/default/Login.template.php (eval?)
Line: 204
?topic=2094.msg17119

8: Undefined index: leftblock
File: /home/MYPATH/public_html/Themes/default/Login.template.php (eval?)
Line: 223
?action=unread;board=7.0


It looks like there may be a problem with the Login.template.php file....or is there something else that's broken that is merely pointing back to that?

I would really prefer to fix an individual file rather than restoring the whole thing, if that's possible.

Any ideas?  Thanks.

This website is proudly hosted on Crocweb Cloud Website Hosting.