Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Eric
Apr 20, 2015
  4492
(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

Källfel:

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.

Stackspårning:


[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 

Solution

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">
      <providers>
        <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" />
      </providers>
    </virtualRoles>
Apr 20, 2015

Comments

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog