10

I want to exclude some groups of internal users from analytics, but keep the website personalized for them (and gather data for future personalization).

I tried 2 approaches and none of them worked:

  • Exclude Robots - exclude from analytics but personalization stops working.
  • aggregation.filter.inbound - I created a custom processor in which I set args.IsExcluded = true when IP is on a list. This doesn't work as the data still shows in Analytics Reports, even when the logs says that the filter was called and it should be filtered out.

What I want to try:

  • set Tracker.Current.Contact.ContactSaveMode = ContactSaveMode.NeverSave; in a pipelines after the tracker is created when IP is internal. But as I understand that will stop gathering data for contact.
  • add custom processor to interactions pipeline that will abort the pipelines when internal IP is used in interaction. I'm not sure if this will work and how to get interaction IP here.
  • creating a custom channel for internal users, and adding a filter by channel to each of Analytics Reports. I am not sure if all reports can be filtered by channel.
  • Can you try to add the IP within the config file Sitecore.Analytics.ExcludeRobots.config and see if it fixes the problem – Hishaam Namooya Feb 19 '18 at 14:26
  • As mentioned in the post, using exclude robots don't solve the problem as it shut down the personalization for the user. And i still want to personalize. – Martynka Feb 19 '18 at 14:48
3

In the end I went with creating a custom chanel for internal users and then filtering out the internal traffic from reports via the rule engine.

So the rough steps to follow are as follows:

  1. Create a new chanel in Sitecore and copy it's id. https://doc.sitecore.net/sitecore_experience_platform/82/digital_marketing/marketing_operations/channels/create_a_channel
  2. Make Sitecore recognize your new chanel. https://doc.sitecore.net/sitecore_experience_platform/82/digital_marketing/marketing_operations/channels/map_traffic_types_to_channels
  3. Write a new processor inherit from DetermineChannelProcessorBase.

    namespace Custom.Pipelines.DetermineInteractionChannel
    {
        public class InternalTrafficChannel : DetermineChannelProcessorBase
        {
    
            private readonly string channelId;
    
            protected readonly List<string> Filters = new List<string>();
    
            public virtual void AddFilter(string filter)
            {
                if (this.Filters.Contains(filter))
                    return;
                this.Filters.Add(filter);
            }
    
            public InternalTrafficChannel(string channelId)
            {
                this.channelId = channelId;
            }
    
            public override void Process(DetermineChannelProcessorArgs args)
            {
                if (IsInternalTraffic(args.Interaction))
                {
                    args.ChannelId = new ID(this.channelId);
                }
            }
    
            private bool IsInternalTraffic(CurrentInteraction interaction)
            {
            \\write your logic here.
            }        
        }
    }
    
  4. Add the new processor to determineInteractionChannel pipeline.

    <sitecore>
        <pipelines>
        <determineInteractionChannel>
            <processor type="Custom.Pipelines.DetermineInteractionChannel.InternalTrafficChannel, Custom.Pipelines">
            <param desc="channelId">{00000000-0000-0000-0000-000000000000}</param>
            <filters hint="list:AddFilter">
                <filter>127.0.0.1</filter>
            </filters>
            </processor>
        </determineInteractionChannel>
        </pipelines>
    </sitecore>
    
  5. Create a filter to exclude internal users in /sitecore/system/Marketing Control Panel/Experience Analytics/Filters and as a rule write:

    Rule 1
    except when the current interaction is on the Internal channel
    add visit to segment
    Rule 2
    except when the current interaction is on a channel in the Internal channel group
    add visit to segment
    
  6. Amend Segments that you are interested in to use the new filter.

  7. Rebuild your reporting db. https://doc.sitecore.net/sitecore_experience_platform/82/setting_up_and_maintaining/xdb/server_considerations/walkthrough_rebuilding_the_reporting_database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.