#1313: Plone.org site slow due to calling google-analytics.com?
-----------------------+----------------------------------------------------
Reporter: hemmecke | Owner:
[hidden email]
Type: bug | Status: reopened
Priority: major | Component: website
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Changes (by newbery):
* cc: newbery (added)
Comment:
Hmm... why doesn't Plone.org call the javascript using the jquery
substitute for registerPloneFunction?
In the AnalyticsForPlone product (pre-Plone3 and pre-jquery), the inline
code looks like...
<script type="text/javascript"><!--
if(location.protocol=='https:'){document.write('<script src="
https://ssl .google-analytics.com/urchin.js" type="text/JavaScript"><\/script>')}
else{document.write('<script src="
http://www.google- analytics.com/urchin.js" type="text/JavaScript"><\/script>')}
function callGoogleAnalytics(){_uacct="UA-xxxxxxx";urchinTracker()}
registerPloneFunction(callGoogleAnalytics);
// --></script>
In Plone.org, the inline code looks like...
<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">
var pageTracker = _gat._getTracker("UA-1907133-2");
pageTracker._trackPageview();
</script>
The Plone.org version is placed at the bottom of the page so that helps
but I wonder if it would be better to load after the page is parsed which
is what the old registerPloneFunction did (need to lookup how it's done in
jquery).
--
Ticket URL: <
https://dev.plone.org/plone.org/ticket/1313#comment:6>
Plone.org <
http://plone.org>
Plone.org services maintenance
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com_______________________________________________
Plone-website mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-websiteThe Wiki:
http://plone.org/development/current/projects/WebsiteTeam