Try our conversational search powered by Generative AI!

Apr 20, 2015
(2 votes)

Installing the nuget for EPiServer GoogleAnalytics and virtual Roles

This is a short post and a reminder since I had trouble with installing the Google Analytics addon from EPiServer the other day.

They are looking for GoogleAnalyticsAdministrators that is supposed to be mapped to a specific group. But if you have not setup the website with these roles it will fail and the website will not start. Instead you will get the following error.

Serverfel i tillämpningsprogrammet /.
The list of roles for virtual role 'GoogleAnalyticsAdministrators' is not valid
Parameternamn: config
Beskrivning: Ett undantag som inte kunde hanteras uppstod när den aktuella webbegäran kördes. Mer information om felet och var i koden det uppstod finns i stackspårningen.

Undantagsinformation: System.ArgumentException: The list of roles for virtual role 'GoogleAnalyticsAdministrators' is not valid
Parameternamn: config


Ett undantag som inte hanteras genererades vid körningen av den aktuella webbegäran. Information om undantagets ursprung och plats kan identifieras med undantagsstackspårningen nedan.


[ArgumentException: The list of roles for virtual role 'GoogleAnalyticsAdministrators' is not valid
Parameternamn: config]
   EPiServer.Security.MappedRole.Initialize(String name, NameValueCollection config) +545
   EPiServer.GoogleAnalytics.InitializationModule.EnsureMappedRoleExists(VirtualRoleRepository`1 vrReposistory, String name, String roles) +153
   EPiServer.GoogleAnalytics.InitializationModule.InitializeVirtualRoles() +558
   EPiServer.GoogleAnalytics.InitializationModule.application_PostAuthenticateRequest(Object sender, EventArgs e) +5
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Versionsinformation: Microsoft .NET Framework-version:4.0.30319; ASP.NET-version:4.0.30319.34212 


Before you install you setup the groups WebEditors and WebAdmins in the CMS – Admin interface. Or  you can add a virtualroles mapping in web.config for the specific groups.


    <virtualRoles addClaims="true">
        <add name="Administrators" type="EPiServer.Security.WindowsAdministratorsRole, EPiServer.Framework" />
        <add name="Everyone" type="EPiServer.Security.EveryoneRole, EPiServer.Framework" />
        <add name="Authenticated" type="EPiServer.Security.AuthenticatedRole, EPiServer.Framework" />
        <add name="Anonymous" type="EPiServer.Security.AnonymousRole, EPiServer.Framework" />
        <add name="CmsAdmins" type="EPiServer.Security.MappedRole, EPiServer.Framework" roles="WebAdmins, Administrators" mode="Any" />
        <add name="CmsEditors" type="EPiServer.Security.MappedRole, EPiServer.Framework" roles="WebEditors" mode="Any" />
        <add name="GoogleAnalyticsAdministrators" type="EPiServer.Security.MappedRole, EPiServer.Framework" roles="Administrators" mode="Any" />
        <add name="Creator" type="EPiServer.Security.CreatorRole, EPiServer" />
        <add name="PackagingAdmins" type="EPiServer.Security.MappedRole, EPiServer.Framework" roles="WebAdmins, Administrators" mode="Any" />
Apr 20, 2015


Please login to comment.
Latest blogs
Stott Security Version 2 So Far

In December 2023, I unveiled the initial version of Stott Security version 2. Although I typically announce each version I release on LinkedIn and...

Mark Stott | May 22, 2024

Optimizely Data Platform (ODP) Page Scroll Tracking

As with my last post, this isn’t a “getting started with ODP” — to get started with ODP, check out the developer docs,   “Implement the ODP...

Daniel Isaacs | May 22, 2024

Optimizely Search and Navigation – Part 1 – Search Tips

Introduction Search and Navigation is a cloud service provided by Optimizely to support building search functionality for both Optimizely CMS and...

Binh Nguyen Thi | May 22, 2024

From Procrastination to Proficiency: Navigating Your Journey to Web Experimentation Certification

Hey there, Optimizely enthusiasts!   Join me in celebrating a milestone – I'm officially a certified web experimentation expert! It's an exhilarati...

Silvio Pacitto | May 17, 2024