New Settings for the mojoportal

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
1/29/2010 3:57:13 AM
Gravatar
Total Posts 171
I am a Russian programmer

New Settings for the mojoportal

Hi, Joe

For GoogleAnalyticsScript.cs

private void SetupTracker()
{
StringBuilder script = new StringBuilder();
script.Append("\n");
script.Append("<script type=\"text/javascript\"> ");
script.Append("\n");

script.Append(" if(_gat != undefined){");
script.Append("var " + trackerName + " = _gat._getTracker(\"" + googleAnalyticsProfileId + "\");");
script.Append("\n");

script.Append(trackerName + "._setDomainName(\""+googleAnalyticsDomainName+"\");");
script.Append("\n");

The new parameter googleAnalyticsDomainName is taken from web.config

Best regards, Alexander
 

1/29/2010 1:39:38 PM
Gravatar
Total Posts 18439

Re: New Settings for the mojoportal

Hi Alexander,

Today I added a property OverrideDomain that you can set on the GoogleAnalyticsScript control in layout.master. If you enter the value for the domain setting there it will render it.

This will be in svn trunk by late tonight.

Best,

Joe

2/6/2010 12:36:44 PM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Hi, Joe

You added "OverrideDomain" but it does not read from Web.config

Best regards, Alexander

2/6/2010 12:42:40 PM
Gravatar
Total Posts 18439

Re: New Settings for the mojoportal

No, you have to set the property on the control in your skin. I think this is better than using a config setting because it supports multiple sites each being able to specify their own domain settings. If I put it in web.config it would apply globally and be less flexible.

Best,

Joe

2/9/2010 8:07:20 PM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Hi, Joe

I have a problem.

When I added OverrideDomain, it appeared an error in the script ga.js in line X=function(i,l){return i.split(l)}. Erorr text: "'i undefined' is null or not an object". I have this error in IE8. I determined because of what happens this error.

It occurs because you have added lines:

script.Append(trackerName + "._setAllowHash(false);");

Please remove this line

and more

I wish that it were possible to load a script ga.js from intranet. Could you add the path settings for this script?

Best regards, Alexander
 

2/11/2010 2:18:10 AM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Hi, Joe

in GoogleAnalyticsScript.cs change

script.Append(trackerName + "._setAllowLinker(enable);");
to

script.Append(trackerName + "._setAllowLinker(true);");

And yet, why OverrideScriptUrl added to layout.Master and not Web.config? (same way as done for ExtJsBasePath or jQueryBasePath) ?

Best regards, Alexander

2/11/2010 8:42:26 AM
Gravatar
Total Posts 18439

Re: New Settings for the mojoportal

Hi Alexander,

Ok, I fixed that script error in my copy. I was confused because there is an error in the documentation page

http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html

All the examples at the top of the page show "enable" rather than "true", but examples toward the bottom show "true".

At your request I created a setting, you can add this to your user config and put in the url for your local script.

<add key="GoogleAnalyticsScriptOverrideUrl" value="" />

These changes will be in svn trunk by tonight.

Best,

Joe

2/13/2010 2:27:24 AM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Hi, Joe

<add key="GoogleAnalyticsScriptOverrideUrl" value="" />

You forgot to add it in web.config

Best regards, Alexander

2/13/2010 6:22:30 AM
Gravatar
Total Posts 18439

Re: New Settings for the mojoportal

Hi Alexander,

I added this setting to make you happy. No-one else has ever asked for it. I do not want to advertise this setting in Web.config, it will more likely cause me more support work when people put something there that is incorrect and mess up every site in their multi site installation. Most people should not mess with that setting, it is better to let google host that file. Google recommends not hosting the file locally.

Best,

Joe

2/13/2010 7:33:29 AM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Hi, Joe

Thank you

This is due to security. All scripts that are generated on the pages of the site should be located on our server. I work in government institution and therefore we have such rules.

Best regards, Alexander

2/13/2010 8:03:26 AM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Information for people who want to install Google Analytics script locally:

http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55510

Best regards, Alexander

2/13/2010 8:16:11 AM
Gravatar
Total Posts 18439

Re: New Settings for the mojoportal

That links says how to use it on an intranet but it says to load the script from google. Nowhere does it say how to host the script locally.

As I said before they recommend against it:

http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55466

You may go against their recommendation according to your needs but most people should follow the recommended approach.

Best,

Joe

2/13/2010 8:46:05 AM
Gravatar
Total Posts 171
I am a Russian programmer

Re: New Settings for the mojoportal

Hi, Joe

See note: Making Google Analytics code more maintainable

http://meiert.com/en/blog/20090310/optimization-measures-6/

Best regards, Alexander

2/13/2010 8:54:20 AM
Gravatar
Total Posts 18439

Re: New Settings for the mojoportal

I never said no-one recommends hosting the file locally, I said google recommends against it.

It is more maintainable if you don't maintain it and let google maintain it.

I understand why you need to host it locally but my recommendation is for most people to let google host it as they recommend. Since so many sites use google analytics most users already have this file cached in the browser.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.