Repositioning script

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
2/23/2010 11:59:41 AM
Gravatar
Total Posts 171
I am a Russian programmer

Repositioning script

Hi, Joe

In GoogleAnalyticsScript.cs

private void SetupMainScript()

please change place function HasGALabelCookie that it was called before

script.Append("<script type=\"text/javascript\" src=\"" + overrideScriptUrl + "\" />\n");
otherwise an error HasGALabelCookie - undefined

implement this function such as:

private void SetupMainScript()
{
if (trackPageLoadTime)
{
SetupUpperPageLoadTrackingScript();
}

StringBuilder script = new StringBuilder();

script.Append("<script type=\"text/javascript\"> ");
script.Append("\n");
script.Append("function HasGALabelCookie(labelTerm){");
script.Append("\n");
script.Append("var gaCookie = ' ' + document.cookie + \";\";");
script.Append("\n");
script.Append("return gaCookie.indexOf(labelTerm);");
script.Append("}");
script.Append(" </script>");

if (overrideScriptUrl.Length > 0)
{
script.Append("<script type=\"text/javascript\" src=\"" + overrideScriptUrl + "\" />\n");

}

script.Append("<script type=\"text/javascript\"> ");
script.Append("\n");

if(overrideScriptUrl.Length == 0)
{
script.Append("var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");");
script.Append("\n");
script.Append("document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));");
script.Append("\n");
}

script.Append(" </script>");

Page.ClientScript.RegisterStartupScript(
this.GetType(),
"ganalytics",
script.ToString());

}

 

 

Best regards, Alexander

2/23/2010 1:04:59 PM
Gravatar
Total Posts 171
I am a Russian programmer

Re: Repositioning script

And more

Please change

private bool setAllowHashFalse = true;

to

private bool setAllowHashFalse = false;

and

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

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

Best regards, Alexander
 

2/23/2010 2:30:34 PM
Gravatar
Total Posts 171
I am a Russian programmer

Re: Repositioning script

I downloaded the update from SVN and installed it. Everything works correctly.

Thank you, Joe

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