Skip to content

Instantly share code, notes, and snippets.

@davidknipe
Created February 15, 2018 15:57
Show Gist options
  • Select an option

  • Save davidknipe/f43509547ec5f4a3df3e04d1b655f7d7 to your computer and use it in GitHub Desktop.

Select an option

Save davidknipe/f43509547ec5f4a3df3e04d1b655f7d7 to your computer and use it in GitHub Desktop.
using EPiServer.ServiceLocation;
using EPiServer.Tracking.Core;
namespace InsightScopes.Business.ChangeScope
{
[ServiceConfiguration(ServiceType = typeof(ITrackingDataInterceptor), Lifecycle = ServiceInstanceScope.Singleton)]
public class CustomScopeInterceptor : ITrackingDataInterceptor
{
public int SortOrder => int.MaxValue; // Ensure the interceptor fires last
public void Intercept<TPayload>(TrackingData<TPayload> trackingData)
{
trackingData.Scope = "MyCustomScope";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment