Forum Moderators: DixonJones

Message Too Old, No Replies

Google Analytics Code -- I placed mine wrong but it's working.

         

peterinwa

6:10 pm on Jul 2, 2007 (gmt 0)

10+ Year Member



I placed my code improperly but it seems to be working so I guess I won't worry about it. I dropped the code at the very bottom of my hundreds of pages which end like this:

<script language="JavaScript">
c=p3;
document.write(c);
</script>

The problem is that you are supposed to put it before the </body> tag, but:

p3="</td></tr></table></center></body></html>";

So I effectively put it after the tag.

As I say, all these pages are showing up in the Analytics stats so it must be okay.

Peter

dmorison

2:52 pm on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you're benefiting from the general leniency of browsers to handle badly formatted HTML! I would urge caution however - if your (X)HTML is being output with a strict header it is possible that some browsers, now or in the future, may not execute the analytics code! In other words, although it appears to be working, you can't be sure that analytics is logging every visitor...!

peterinwa

10:19 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



Thanks, I'll correct it when I have time.

Peter