Google Analytics in Template

jminadeo / 2007-06-11 13:24:13   

A couple months ago a username giantparty mentioned that you could paste the google analytics code in the post-nav to get it going but that does not work for me as it seems like it needs to be in the header. Vaska replied that you could simply add the code to the template. I believe this is the best way to handle it. How do I do add code to the template directly?

Vaska A / 2007-06-11 13:32:00   

Yeah, it's easy...adding it to the template is best. First of all, you should switch to the Sample template set...unless you've made something custom already. Then you can access things at:

/ndxz-studio/site/sample/index.php

And, put the code into the template where ever Google suggests you do to (I believe just before the closing body tag I think).

jminadeo / 2007-06-11 15:03:24   

Sweet. That did the trick. Thank you very much for your quick response.

Speaking of analytics, I absolutely love the statistics page for some quick stats on the site. So cool!

Thanks again for a great free application.

andysn / 2009-04-14 05:11:04   

I have just followed these instructions but now the site has gone down. has anyone had this problem before?

Vaska A / 2009-04-14 08:03:11   

You could show us...

It going down would be based upon the fact that you've really messed something up...this is an easy template edit.

Switch to the Eatock template set and if things work fine then you know it's the template - if they don't, you'll need to figure out which file was damaged and replace it.

con / 2009-08-12 09:49:05   

bump. super easy.
Google Analytics is great btw and should be installed by one and all

repeterepete / 2009-08-13 07:40:24   

Arghhhhh!

I also just tried to add Google Analytics into my site. I inserted the code into the main index.php file in the ndxz-studio directory (which I'm now sure was definitely not the right thing to do). I have replaced the index file with the original one and the site is still not working. If you go to www.peterroot.com you will see the error code.

I tried switching to the Eatcock template and the error code remains. I cannot figure out why the problem still occurs even though I put the original index file back??

Please help me!!

repeterepete / 2009-08-13 07:47:34   

In response to the warning code, I haven't done anything to the defaults.php file... not moved or altered it in any way. Literally all I did was adjust the index.php and then replaced it with the original version when I saw it didn't work.

repeterepete / 2009-08-13 07:51:57   

I was wondering, should I try the reset script mentioned in this thread - http://www.indexhibit.org/forum/thread/3279/
?

lemathieu A / 2009-08-13 08:48:58   
It going down would be based upon the fact that you've really messed something up...this is an easy template edit.

Switch to the Eatock template set and if things work fine then you know it's the template - if they don't, you'll need to figure out which file was damaged and replace it.

So, try to see wich file(s) had been damaged at the time of the shutdown. Look at the dates,…

repeterepete / 2009-08-13 08:55:11   

Thanks. I already checked the thread you've referenced, and switched to Eatock which still didn't work. The site was working perfectly and literally all I did was add the Google Analytics script into the index.php in the main directory, uploaded it, noticed the site no longer worked and got the following error message -

Warning: require_once(defaults.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/84/4626084/html/index.php on line 23

Fatal error: require_once() [function.require]: Failed opening required 'defaults.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/84/4626084/html/index.php on line 23

I thought it would be as simple as replacing the index.php file with the original one. So anyway, the only file i have touched is the index.php so surely it must be this that is in some way damaged? Although I don't see how as it is back to it's original state. Do I need to reset my site or something?

Vaska A / 2009-08-13 08:56:42   

You replaced the wrong index.php file...of course things are no longer working.

Just replace the file you messed up with a clean one from the files you downloaded from this site.

repeterepete / 2009-08-13 09:01:37   

I just replaced the index.php file in the main directory with the original version downloaded from this site and the error message has changed to Internal Server Error

lemathieu A / 2009-08-13 09:05:31   

edit: late

Vaska A / 2009-08-13 09:06:10   

Start over...it's impossible for us to know what's going wrong when people are editing the wrong files.

repeterepete / 2009-08-13 09:11:51   

Please don't tell me you mean re-build the site?! I really appreciate that you guys are trying to help me, and I can't stress enough that all I changed was the index.php in the main directory and then immediately replaced it with the original index file once I had seen it was no longer working.

Vaska A / 2009-08-13 09:18:57   

Obviously, you've done more than that. The error message alone isn't pointing to Indexhibit...something is really wrong.

repeterepete / 2009-08-13 09:22:55   

I've just deleted everything, and am rebuilding as we speak.

repeterepete / 2009-08-13 09:39:26   

I replaced everything and and am re-uploading images etc... Seems to be working again.

On a slightly less related note, I've noticed that since changing my site from a simple Dreamweaver site to Indexhibit my hits have gone from around 100 a month to 73,351 in the last month and a half... can this be correct?! That was why i wanted to add Google Analytics to double check.

Cheers

Vaska A / 2009-08-13 09:42:09   

Google Analytics are the most accurate thing out there. Indexhibit stats are very simple in that they simply track page hits and unique visitors - it's not filtering for the billions of things that Analytics or some big stat package is doing. Not trying to be 100% correct...just a benchmark.

polamoon / 2009-10-13 16:32:46   

I'm trying to install google analytics to my website. I've found the index.php file in ndxz-studio/site/sample/index.php
but when I open it, it only says: *Built with indexhibit. There's nothing else. So, I don't know where to paste my google analytics code.
What am I doing wrong???
Thank you!! and congrats for your work!

Vaska A / 2009-10-13 16:37:12   

View the code...then it will make sense.

ewarfield / 2009-11-15 17:22:17   

hello. not to beat a dead horse, but I just can't seem to figure out where to put the Google Analytics code! I am using the Eatock template, which I customized a tiny bit, and there is no "index.php" file in there to change - so where does it go?
does this mean you have to have an index.php file to put the code in and if Eatock does not have one I have to switch templates??
I have been reading through all these posts and still I don't understand, any help is appreciated. Thanks so much.

lemathieu A / 2009-11-15 17:58:15   

don't use eatock : it's not done for being customized.
choose "sample"

then
: /ndxz-studio/site/sample/index.php

jorgemartin / 2009-12-17 09:24:32   

Hello,

I have pasted the google analytics tracking code into the template as suggested in this thread (http://jorgemartin.org/ndxz-studio/site/sample/index.php). On the analytics dashboard, everything seems to work properly (there's a green tick mark next to the website address: www.jorgemartin.org). However, it's not recording any visits while I positively know there have been visits. Any clues as to what the problem might be?

Cheers,
Jorge

Vaska A / 2009-12-17 12:09:29   

Doesn't Analytics only update once a day (usually at midnight)? This is how it works for me...

puppiepoppy / 2009-12-17 14:17:08   

I think the Google Analysis user has to configure it or something. There are some 'goal' thingy that need to be filled up. The point is: I'm having big problem understanding that setting...so, at the moment, I'm like you Jorgemartin...not recording whatsoever! :(

Anyone out there can help us, probably a screengrab of the google analsis page setting, or a throughout explanation on this thread?

That would be lovely.

Cheerio,
Michael

Vaska A / 2009-12-17 14:58:40   

I'm pretty sure it takes at least 24 hours to get any results.

puppiepoppy / 2009-12-17 15:18:38   

Mine has exceeded 24 hours, no statistic at all, eventhough the status is marked with a green tick. I just can't figure out what's wrong.

Is setting up the 'goal' in the Goggle Analysis an important step?

jorgemartin / 2009-12-17 15:19:24   

It's been three days since I added the code.

Vaska A / 2009-12-17 15:21:53   

Then it's not added right. I would search the greater web for help on this topic - there is much more info out there on it.

katieosgood / 2010-02-12 20:04:42   

in the setting section of www.yoursite.com/ndxz-studio you just copy and past the analytics code into the" Post-Nav Text (HTML Allowed)" box and there you go.
••i promise this will work.

Vaska A / 2010-02-12 20:06:09   

It will work...but...it's preferred you put it in the template at the end of the file.

And, your way can also go 'wrong' as well but not always.

PMD / 2010-05-10 08:40:05   

Hello. I am an example of how it can go 'wrong' to the solution katieosgood just mentioned. I reverted all the files that were affected by the mistake, but when I attempt to update any of the changes I make to the "settings" page I now see this...

http://farm2.static.flickr.com/1227/4594965598_646a2b003c_b.jpg

I have changed my index.php in the "sample" folder as well as the ie.css and styles.css in the "eatock" folder back to the stock files. Any other suggestions of files to replace to make this section editable again would be very appreciated. Thanks.

my website is http://www.philipdibello.com if that will help at all also.

misspumps / 2010-05-15 09:02:15   

Hey,

ive been trying to follow these above threads to understand where i have to paste my google analytics code. but im sorry, i dont understand.

@Vasko - what does this mean?

Yeah, it's easy...adding it to the template is best. First of all, you should switch to the Sample template set...unless you've made something custom already. Then you can access things at:

/ndxz-studio/site/sample/index.php

And, put the code into the template where ever Google suggests you do to (I believe just before the closing body tag I think).

Where do i access /ndxz-studio/site/sample/index.php???

im new to all this, so it would help me if you guys say where on indexhibit i have to go and paste the code? or do i have to access my ftp server?

thanks!

autosavevault / 2010-07-11 11:23:15   

Dear Vaska. I have read all of the forums and now I truly need your help. I now do not see my website. Which I have created and have used for years. I am trying to install Google Analytics.

1. First, when I typed in living-portrait/ndxz-studio/site/sample/index.php in the browser I just saw built by indexhibit.

2. I went to cyberduck and clicked on the site folder, then the sample folder, then downloaded the index.php folder. I saw what polamoon saw - the file said "built with indexhibit" I then added the google analytic code to the index.php file and then uploaded to my ftp. Then I saw nothing- http://living-portrait.com is now just built with indexhibit.

Did I just delete my entire website?

autosavevault / 2010-07-11 11:42:23   

When I log into http://www.living-portrait.com/ndxz-studio- I can log in and then I see the organization of my site, all of my exhibits and sections, but when I click to edit each Exhibit, what I see is: "built by indexhibit" - everything is gone. Kind thanks for your help. Essentially- changing the index.php file that was inside the sample folder of my site folder-- did this have all of my content in it? I thought I was fairly savvy but it looks like I made a rudimentary mistake. Is there any information I can give you for you to help me? Thank you.

arsondpi / 2010-07-11 13:21:43   

errr - reupload the sample theme... And use a different code editor... It seems that the one you're using has actually broken up your php code...

autosavevault / 2010-07-11 21:33:33   

Kind thanks arsondpi for checking this out! I love indexhibit and have worked on this site for 2.5 years... I will now search forum on how to reupload sample theme...and may ask about how to do this in an appropriate forum. I will use Aptana to text edit, looks like it is popular on delicious.com

Vaska A / 2010-07-11 21:54:02   

Sample goes at:

/ndxz-studio/site/sample/

Aptana? That's a bit advanced...just use a solid text editor.

ctodorovich / 2010-11-02 06:32:55   

When I try to implement this by going to:

/ndxz-studio/site/sample/index.php

all that is visible in my browser window is the following:

* Built with Indexhibit

Any suggestions?

arsondpi / 2010-11-02 09:16:08   

use a proper code editor... have you got an web address?

ctodorovich / 2010-11-06 08:19:24   

Hey arsondpi, thanks for your help! Yes my web address is crystalcages.com. By code editor, do you mean through my hosting service?

ctodorovich / 2010-11-06 08:29:41   

Hi again. Figured it out, no need for reply :)

wazm688 / 2011-01-26 12:02:04   

Hi,

To add to the index.php issues that have come up, I've got a strange but slightly less dramatic problem when installing analytics. I'm using a horizontal theme that i've worked on extensively, based on the Columner theme.

1. I edited my index.php file in dreamweaver, adding the analytics code in the correct place.

2. Uploaded to my site directory with cyberduck in the correct folder

3. Saw that for some reason my menu had been squashed to the top left corner, making the pre-nav and post-nav text appear on top of the menu headings, and my collapsing menus are now stuck "open"

4. took out the analytics code and re-uploaded the original index.php file to the directory. Things are still the same.

I know I did something wrong, but have no idea why this would effect thing in this way.

Any help would be appreciated. My site is www.angusmccullough.com

wazm688 / 2011-01-26 15:57:42   

just got some fresh files from the columner theme and uploaded that index.php (without opening it or editing it in any way) and the problem persists.
My site

Anneke / 2011-01-27 07:24:08   

Hello!
First of all, thanks a lot for indexhibit!
I also managed to now mess up my site completely after trying to add the Analytics code, then getting what you can see here: http://annekegerloff.de ,
removing the code, still having the same problem, uploading the index.php from a copy of the sample theme that i had made, and still the problem persisted.
Now i've somehow managed to make it worse (I'm a real beginner here), and I see I have to start anew (which is not so bad, because I haven't done so many specific things).
Do I have to uninstall somehow or can I just delete the files from my Library and Cyberduck and download my new indexhibit?
Can I dare to try to add the Google Analytics code again?
I read it should be a simple change, but somehow it didn't work for me.
Any ideas on why the previews looked fine but on the actual site I only got this thing:

* Built with Indexhibit

Best, Anneke

Anneke / 2011-01-27 07:26:01   

Sorry, just saw that there's lots of stuff in the forum about reinstalling. So, please ignore that question!

Anneke / 2011-01-29 14:19:56   

okay, whole problem solved (with the help of my internet-savvy friend.)

bilheteira / 2011-06-13 16:38:47   

hello there! i' so sorry but my HTML knowledge is not the most accurate onde and i seem to have made a HUGE mistake in the process of adding google analitics to my website.

the site is online --> http://renatacandeias.net

but I can't acess my http://renatacandeias.net/ndxz-studio/?a=exhibits

i've made some changes in the wrong index.php and what to know how to fix this without going trough the reinstalling process again
please help!!!

This thread has been closed, thank you.