Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / All Other Contributions/Addons / no "body" tag in view source after installing the Simple Google Analytics module

no "body" tag in view source after installing the Simple Google Analytics module

Locked

Started by notageek on 1 May 2010, 5:16 AM · Views: 2,935

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
1 May 2010, 5:16 AM
#1
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

no "body" tag in view source after installing the Simple Google Analytics module

Hi. I had no validation errors before installing the Simple Google Analytics module. Now there is no </body> code and no </html> code on my home page "view source." My includes/templates/MYTEMPLATE/common/tpl_main_page.php does have the </body> tag right after the added Google Analytics code.

The tpl_main_page.php last lines are these:

<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--eof- banner #6 display --> <?php require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'google_analytics') . '/google_analytics.php'); ?> </body>

The W3C Validator correctly finds no </body> code, which really is absent from view source; and it also finds no </html> but that is not in the tpl_main_page.php template either.

Validation errors seem fairly easy to spot in define pages, but it is really puzzling why there is no </body> tag showing up on the view source. Is that normal?

I never thought to check for that previously, so I do not know if it ever was there in the source code of the web page when my page validated correctly. Should I be worried about this?

And what would be the Zen Cart source file for seeing the </html> tag?

My website is https://www.riverfrontsouth.com. I have turned the banner on and off and that makes no difference in the validation result.

Thanks for any ideas.

15 May 2010, 5:20 PM
#2
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: no "body" tag in view source after installing the Simple Google Analytics module

Hi.

I am still searching for information on what is causing these validation errors; the W3C site says there are 4 errors but it gives all of this information:

Line 447, Column 31: end tag for "body" omitted, but OMITTAG NO was specified

<!--eof- banner #6 display -->

✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 26, Column 1: start tag was here

<body id="indexHomeBody"> Line 447, Column 31: end tag for "html" omitted, but OMITTAG NO was specified <!--eof- banner #6 display --> ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 2, Column 1: start tag was here

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> Line 447, Column 30: Premature end of data in tag body line 26 <!--eof- banner #6 display --> ✉ Line 447, Column 30: Premature end of data in tag html line 2 <!--eof- banner #6 display -->

I have compared my includes/templates/MYTEMPLATE/common/tpl_main_page.php file with another in this forum that is considered correct and there are no differences other than a couple of lines that wouldn't result in a non-closure of a tag.

I do not know what else to check that would lead to my </body> tag just not showing up in my view source when it is in the tpl_main_page file right after the google analytics command.

I am feeling I cannot register my site with Google without it validating correctly.

Any help would be appreciated.

Notageek

15 May 2010, 6:58 PM
#3
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: no "body" tag in view source after installing the Simple Google Analytics module

Maybe a clue to the missing </body> tag in the view source is found in the fact that all of my EZ Pages reflect the missing </body> error but are a bit simpler from the main page validation errors, stating as follows:

Line 428, Column 31: end tag for "body" omitted, but OMITTAG NO was specified

<!--eof- banner #6 display -->

✉
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 26, Column 1: start tag was here

<body id="pageBody"> Line 428, Column 31: end tag for "html" omitted, but OMITTAG NO was specified <!--eof- banner #6 display --> ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 2, Column 1: start tag was here

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> Line 428, Column 30: Premature end of data in tag body line 26 <!--eof- banner #6 display --> ✉ Line 428, Column 30: Premature end of data in tag html line 2 <!--eof- banner #6 display -->

Thanks for any ideas on which php file to check.

17 May 2010, 3:29 AM
#4
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: no "body" tag in view source after installing the Simple Google Analytics module

I compared my view source file with one that had validated previously, which actually did show the </body> and </html> commands.

I took out the code for Google Analytics that the Simple Google Analytics instructions say to place just before the </body> tag in includes/templates/MYTEMPLATE/common/main_page_tpl.php, after experimenting with adding and taking away spaces between the code and the </body> tag.

When I removed the GA code, my home page passed the W3C Validation again and I could once again see the </body> and </html> codes.

I found a discussion line on Google where some people were discussing the missing </body> tag in a very general way. If I come up with an explanation I will post.

Is there some other way to use Google Analytics in Zen Cart that allows the </body> and </html> tags to show, or is this what happens with all the methods of adding Google Analytics to one's website?

19 May 2010, 3:31 AM
#5
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: no "body" tag in view source after installing the Simple Google Analytics module

I found the solution, and posted it in the Simple Google Analytics Support thread, at Post #1245. I'm not sure if the link will work but I think the link to that post is here: http://showthread.php?p=885774#post885774