I have installed the latest version of Google Analytics for EPiServer on an existing CMS6R2 site. The problem is that some requests accessing the AnalyticsDataRepository triggers a FormatException, stack trace:
[FormatException: Input string was not in a correct format.]
System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) +542
System.Double.Parse(String s) +29
System.Linq.Enumerable.Sum(IEnumerable`1 source) +120
EPiServer.GoogleAnalytics.Internal.Services.AnalyticsDataRepository.GetSummaryData(AnalyticsUser user, AnalyticsWebProperty webProperty, Limit limit) +644
EPiServer.GoogleAnalytics.Internal.Controllers.EPiGaGadgetController.SummaryView(Guid gadgetId, Nullable`1 startDate, Nullable`1 endDate) +347
lambda_method(Closure , ControllerBase , Object ) +273
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +258
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +637
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +307
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +704
EPiServer.GoogleAnalytics.Internal.Controllers.EPiGaGadgetController.Execute(RequestContext requestContext) +67
EPiServer.Shell.Web.Mvc.ModuleMvcHandler.ProcessController(IController controller) +50
EPiServer.Shell.Web.Mvc.ModuleMvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +28
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Does anyone recognize this error or can confirm that the module is working (I know there was some problems with the previous version)?
Setting globalization culture to en-US solved the problem.
And what do I do if I want to run my site in sv-SE for example?
You can add the globalization element to your webroot/Modules/EPiServer.GoogleAnalytics/web.config file.
Great help! It works! Thank you :-)
I am having issues with this aswell, even though I added the globalization element to my web.config located in /modules/EPiServer.GoogleAnalytics/ under configuration/system.web section.
Our site has the site-language set to Swedish, so I figured I could set the culture and cultureUi attributes of globalization element to sv-SE and sv to get this to work but no luck.
The only thing that works is if I change the site-langugage under my settings and display options tab in EPiServer UI to English. This is unfortunately not an option as we have a Swedish customer.
Josef: Did you just put your globalization element right under the specified section that I mentioned?
@Niklas: yes I did and it works for us. We also run Swedish everywhere except for this module.
On the other hand, non of our statistics seem correct, i.e. the plugin does not display the same numbers as the GA page does.
If anyone has managed to get this plugin to function correctly, please let me know :-)
That's interesting, that it "almost" works :)
It seems that the langugage settings for the current logged in user in EPiServer overrides the underlying configurations about culture and cultureUi set in the globalization element in web.config files.
The data that is retrieved from Google Analytics seems to be in english culture, which causes the FormatException to be thrown as the current language for our site is in Swedish, a mismatch there between cultures. I tried to change the language for the Google Analytics account to Swedish but that doesn't work either so I don't know what to do.
The only solution I can come up with is if EPiServer published the source code of this plugin, then you could just modify the Parse-method to explicit take an IFormatProvider with the specified culture.
:-) well, what I mean is that before we changed the culture we got an exception. With en-US culture we don't get an exception and we see graphs and numbers although they don't match with reality....
It seems strange that culture from logged in user should override the module config for you, but not for us.
<globalization culture="en-US" uiCulture="en" requestEncoding="utf-8" responseEncoding="utf-8" resourceProviderFactoryType="EPiServer.Resources.XmlResourceProviderFactory, EPiServer" />
Above is our setting that comes first inside <system.web>
I noticed there is another web.config in the Views folder. Check that it doesn't have another globalization setting that override yours.
I can't get this to work. Tried to modify the globalization element in both Web.config under modules/EPiServer.GoogleAnalytics and under /Views but it doesn't seem to make any difference.
I get the same problem, a format exception if language for the user is not set o English. I have tried to set
<globalization culture="en-US" uiCulture="en" requestEncoding="utf-8" responseEncoding="utf-8" resourceProviderFactoryType="EPiServer.Resources.XmlResourceProviderFactory, EPiServer" />In boths web.config files under modules/EPiServer.GoogleAnalytics, but the only thing getting the module to run is to change the user language. This is not an option for our customer so if anyone knows how to solve this, please post.
I took a copy of the language file from the module, moved the copy to the main language folder in our solution, added a new tag for swedish with all english tags(i did not translate them).
At first i tried to add the swedish tag in the module folder but it didnt hock up... i suppose its cashed in some way when you install the add on
Not so nice but it worked for me.