You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Andrus Adamchik <an...@objectstyle.org> on 2012/11/05 09:13:49 UTC

Re: svn commit: r1405709 - /cayenne/site/cms/trunk/templates/skeleton.html

> Move to the async Google tracking code which needs to be in the head to make webmaster tools work.

I actually thought that Google considers it the best practice to keep GA code in the bottom of the page, as it ensures that your HTML can render even if GA is sluggish/unavailable? 

So it seems like the old approach was right?

Andrus


On Nov 5, 2012, at 11:09 AM, amaniatis@apache.org wrote:
> Author: amaniatis
> Date: Mon Nov  5 08:09:26 2012
> New Revision: 1405709
> 
> URL: http://svn.apache.org/viewvc?rev=1405709&view=rev
> Log:
> Move to the async Google tracking code which needs to be in the head to make webmaster tools work.
> 
> Modified:
>    cayenne/site/cms/trunk/templates/skeleton.html
> 
> Modified: cayenne/site/cms/trunk/templates/skeleton.html
> URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/templates/skeleton.html?rev=1405709&r1=1405708&r2=1405709&view=diff
> ==============================================================================
> --- cayenne/site/cms/trunk/templates/skeleton.html (original)
> +++ cayenne/site/cms/trunk/templates/skeleton.html Mon Nov  5 08:09:26 2012
> @@ -9,6 +9,16 @@
> <link rel="stylesheet" type="text/css" media="print" href="/css/print.css">
> <link rel="shortcut icon" href="/img/favicon.ico" type="image/ico">
> <script type="text/javascript" src="/js/scripts.js"></script>
> +<script type="text/javascript">
> +  var _gaq = _gaq || [];
> +  _gaq.push(['_setAccount', 'UA-7036673-1']);
> +  _gaq.push(['_trackPageview']);
> +  (function() {
> +    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
> +    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
> +    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
> +  })();
> +</script>
> </head>
> <body>
> <div id="wrap"><div id="wrap-inner">
> @@ -31,14 +41,5 @@
> </div>
> 
> </div></div>
> -<script type="text/javascript">
> -var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
> -document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
> -</script>
> -<script type="text/javascript">
> -try {
> -var pageTracker = _gat._getTracker("UA-7036673-1");
> -pageTracker._trackPageview();
> -} catch(err) {}</script>
> </body>
> </html>
> 
> 
> 


Re: svn commit: r1405709 - /cayenne/site/cms/trunk/templates/skeleton.html

Posted by Aristedes Maniatis <ar...@maniatis.org>.
Yeah, Google told me to do it.  Who am I to argue? :-)  I think the new code is async and so the performance no longer relevant.

Ari

On 5/11/12 7:13pm, Andrus Adamchik wrote:
>> Move to the async Google tracking code which needs to be in the head to make webmaster tools work.
>
> I actually thought that Google considers it the best practice to keep GA code in the bottom of the page, as it ensures that your HTML can render even if GA is sluggish/unavailable?
>
> So it seems like the old approach was right?
>
> Andrus
>
>
> On Nov 5, 2012, at 11:09 AM, amaniatis@apache.org wrote:
>> Author: amaniatis
>> Date: Mon Nov  5 08:09:26 2012
>> New Revision: 1405709
>>
>> URL: http://svn.apache.org/viewvc?rev=1405709&view=rev
>> Log:
>> Move to the async Google tracking code which needs to be in the head to make webmaster tools work.
>>
>> Modified:
>>     cayenne/site/cms/trunk/templates/skeleton.html
>>
>> Modified: cayenne/site/cms/trunk/templates/skeleton.html
>> URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/templates/skeleton.html?rev=1405709&r1=1405708&r2=1405709&view=diff
>> ==============================================================================
>> --- cayenne/site/cms/trunk/templates/skeleton.html (original)
>> +++ cayenne/site/cms/trunk/templates/skeleton.html Mon Nov  5 08:09:26 2012
>> @@ -9,6 +9,16 @@
>> <link rel="stylesheet" type="text/css" media="print" href="/css/print.css">
>> <link rel="shortcut icon" href="/img/favicon.ico" type="image/ico">
>> <script type="text/javascript" src="/js/scripts.js"></script>
>> +<script type="text/javascript">
>> +  var _gaq = _gaq || [];
>> +  _gaq.push(['_setAccount', 'UA-7036673-1']);
>> +  _gaq.push(['_trackPageview']);
>> +  (function() {
>> +    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
>> +    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
>> +    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
>> +  })();
>> +</script>
>> </head>
>> <body>
>> <div id="wrap"><div id="wrap-inner">
>> @@ -31,14 +41,5 @@
>> </div>
>>
>> </div></div>
>> -<script type="text/javascript">
>> -var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
>> -document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
>> -</script>
>> -<script type="text/javascript">
>> -try {
>> -var pageTracker = _gat._getTracker("UA-7036673-1");
>> -pageTracker._trackPageview();
>> -} catch(err) {}</script>
>> </body>
>> </html>
>>
>>
>>
>

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A