Try our conversational search powered by Generative AI!

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

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024