Standard Setup code thought

3 views
Skip to first unread message

Dave Smith

unread,
Nov 12, 2009, 7:47:48 AM11/12/09
to google-analytics-api - GA Data Export API
Hi Google Analytics

Could the Standard Setup code (http://code.google.com/apis/analytics/
docs/tracking/gaTrackingOverview.html) be improved if the URI "//
www.google-analytics.com/ga.js" was used instead of testing for https/
http?

The URI is protocol independent, making https/http testing
unnecessary. It would work given that the analytics js file can be
obtained at both of the following URIs:
https://www.google-analytics.com/ga.js
http://www.google-analytics.com/ga.js

The code could become:
<script type="text/javascript" src="//www.google-analytics.com/ga.js"
type="text/javascript"></script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}</script>

all the best
Dave

Nick

unread,
Nov 16, 2009, 8:06:34 PM11/16/09
to google-analytics-api - GA Data Export API
Hi,

This group is for developers building products on top of our Data
Export API.

You should be able to find an answer in our public implementation
support group: http://www.google.com/support/forum/p/Google+Analytics/?hl=en

-Nick

On Nov 12, 4:47 am, Dave Smith wrote:
> Hi Google Analytics
>
> Could the Standard Setup code (http://code.google.com/apis/analytics/
> docs/tracking/gaTrackingOverview.html) be improved if the URI "//www.google-analytics.com/ga.js" was used instead of testing for https/
> http?
>
> The URI is protocol independent, making https/http testing
> unnecessary. It would work given that the analytics js file can be
> obtained at both of the following URIs:https://www.google-analytics.com/ga.jshttp://www.google-analytics.com/ga.js

Dave Smith

unread,
Dec 11, 2009, 9:22:57 AM12/11/09
to google-analytics-api - GA Data Export API
Thanks Nick, have done that

On Nov 17, 1:06 am, Nick wrote:
> Hi,
>
> This group is for developers building products on top of our Data
> Export API.
>
> You should be able to find an answer in our public implementation
> support group:http://www.google.com/support/forum/p/Google+Analytics/?hl=en
>
> -Nick
>
> On Nov 12, 4:47 am, DaveSmithwrote:
>
> > Hi Google Analytics
>
> > Could the Standard Setup code (http://code.google.com/apis/analytics/
> > docs/tracking/gaTrackingOverview.html) be improved if the URI "//www.google-analytics.com/ga.js" was used instead of testing for https/
> > http?
>
> > The URI is protocol independent, making https/http testing
> > unnecessary. It would work given that the analytics js file can be
> > obtained at both of the following URIs:https://www.google-analytics.com/ga.jshttp://www.google-analytics.com...
Reply all
Reply to author
Forward
0 new messages