0

Possible Duplicate:
Is it wrong to place the <script> tag after the </body> tag?

My company has odd code restrictions on the site which doesn't permit us to add scripts at the <head> or <body> tag, so they would only let me add Google Analytics outside of both sections, just before the </html> tag.

Can I trust the GA data provided by this implementation? It doesn't feel 'right'.

Community
  • 1
  • 1
SRUCLA
  • 789
  • 1
  • 8
  • 14

2 Answers2

1

Putting a script (or anything) outside the <body/> will be displayed as it is. from W3c recommendations

The SCRIPT element places a script within a document. This element may appear any number of times in the HEAD or BODY of an HTML document.

Shurmajee
  • 1,027
  • 3
  • 12
  • 35
0

I have seen this being rendered as script and also seen it running as well. Not sure if its safe to do so when targeting all browsers os or device combinations but for chrome and firefox they do treat it as script.

Farrukh Subhani
  • 2,018
  • 1
  • 17
  • 25