By fjuqp on
Hello!!
The problem is that this part of the Google Analytics code is visible at the bottom of every page in my site:
"pageTracker._trackPageview();"
This is where the Google Analytics code appears on:
</div></div> <!-- /#footer-inner, /#footer -->
<Google Analytics code>
</div></div> <!-- /#page-inner, /#page -->
</body>
</html>I also tried moving it before the "body" closing tag just as google suggests, but the code was still viewable.
Anyone know how can I hide this?
Thanks in advance,
Cristian
Comments
Use the Google Analytics
Use the Google Analytics module?
Sorry, I forgot to mention
Sorry, I forgot to mention I'm using it.
what's the URL?
what's the URL?
This is my site:
This is my site: http://www.thisdir.com/
At the bottom of the page you can see this part of the Google Analytics code:
pageTracker._trackPageview();
I believe it shouldn't be visible, right?
the markup is malformed, so
the markup is malformed, so the browser is confused and is rendering that code to the screen.
the problem is at line 276:
<script type="text/javascript">var pageTracker = _gat._getTracker("UA-4328980-1");pageTracker._initData();<script type="text/javascript">fix that up and you should be all set. (btw, if you use Firefox, the HTML Validator extension is really handy to catch such errors. otherwise, you can just swing over to the W3C Markup Validation Service any time.)
I'm not sure about what I
I'm not sure about what I should fix. I'm a Javascript newbie.
You tell me the problem is at line 276, the validator says scripts should not be there and Firebug points out the line 279 "unexpected end of XML source". However, Google says the code should be there.
Could you help me with this?
Bye!
it's an XHTML problem, not a
it's an XHTML problem, not a Javascript problem...
you've got an extra
<script type="text/javascript">in the code i highlighted above. just look closely at the JS snippets you need and be sure all<script>tags have matching</script>tags.Hi! Thank you for your help,
Hi!
Thank you for your help, arh1.
The Google Analytics module is a little confusing for me. I don't know how to insert my code in there so that it looks exactly like the code Google provided me.
So, I decided to create a block and inserted the Google Analytics code in it. Then I placed it in the closure section. I enabled the block only for anonymous users.
To me, doing it this way provides the same functionality as the module.
Just in case someone finds it useful.
Bye and thanks again for all your help.
glad you got it working,
glad you got it working, cBoy, but i'm curious about your process (should have mentioned this earlier). with the GA module you should not have to add any content to your theme at all, right? you just add your GA user ID at /admin/settings/googleanalytics , and the necessary scripts should be added automatically wherever you print the $closure variable in your theme (should be just above
</body>).the code output on our site (Drupal 5.7; GA 5.x-1.4) is like:
What code? If you are
What code?
If you are referring JavaScript code, you cannot and do not want to hide it.
--
Cheers,
Sivanandhan, P. (a.k.a. apsivam)
***Never*** add GA code into "Custom javascript code" textarea
***Never*** add GA tracking javascript into the "Custom javascript code" textarea and this would never been happen. Upgrade to 1.6 and you are unable to do such mistakes.