Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Google Analytics Tracking Code

Google Analytics Tracking Code
Thread Tools
selowitch
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Apr 7, 2007, 02:35 PM
 
The code Google asks you to insert in a web page to enable Google Analytics looks like this:
code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct="UA-xxxx-x";
urchinTracker();
</script>
Is it possible to condense this code into something less redundant (i.e., in a single tag instead of in two tags):
code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
_uacct="UA-xxxx-x";
urchinTracker();
</script>
and also, could one change the type to "text/ecmascript" and have it still work?
( Last edited by selowitch; Apr 7, 2007 at 04:24 PM. )
     
WJMoore
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Apr 9, 2007, 04:38 AM
 
I don't think so. If the tag specifies an external file with 'src' then I think the content of the tag is ignored. This is speculation though, try it with a simple test case (alert() is your friend) and see what happens in various browsers.

Why do you want to change the type? If you do so you're likely to just cause problems with browsers not handling text/ecmascript.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:41 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,