After upgrading to Sitecore 9, our customer noticed some odd behaviour regarding channel allocation in Experience Analytics. The problem was that most of the traffic had been assigned to the "Direct" or "Organic non-branded search" channels. All the other channels barely received any assignments.

top-channels-by-visit

Back in Sitecore 8.1 we had a way more diverse distribution (especially from social channels). Therefore we first had a look at the data that has been collected in the xConnect collection database. We found out that the amount of interactions which have been mapped to the "Organic non-branded search" channel was correct. However, the "Direct" channel received way too many assignments. It became apparent that a lot of interactions with referrer of social platforms like Facebook or Twitter have been mapped to the "Direct" channel. Only the ones which were associated with a Campaign were properly assigned. The Channel "Other referrals" which previously received all the remaining mappings was basically a blank.

After some chatting with Sitecore Support we were informed that some changes happened between Sitecore 8 and Sitecore 9 Update-1 which ultimately lead to this behaviour (the following information has been copied from the release notes):

  • Sitecore 9.0 Initial Release: "The Social Connected application is not included in Sitecore 9.0. Information about future availability will be confirmed at a later date."
  • Sitecore 9.0 Update-1: "The Sitecore.Analytics.OmniChannel.Pipelines.DetermineInteractionChannel.ReferringSite class has been deprecated and removed from the configuration file."

What does this mean? First of all, the Social Connected application was a module integrated into Sitecore which gave content authors and marketers different functionalities to better integrate social networks into their site. It also offered posting messages to the social networks along with publishing Sitecore items. If you are interested in something like that then check out Oliver Raduner's post on bringing back the Social Connected module functionality for Sitecore 9 using an alternative module. Back to our problem: Alongside the Social Connected application, a pipeline processor called SocialChannels went into retirement. This processor was present in the determineInteractionChannel pipeline and was responsible for assigning traffic to the proper social channels in Sitecore.
The second change I want to point out is about the ReferringSite processor (also previously in determineInteractionChannel pipeline). It was responsible for mapping every unassigned interaction (which has a referrer) to the channel "Other referrals". Quite simple, but it makes a big difference at the end of the day.

Now, it's up to you how you want to handle this situation. In the following part I will give you instructions on how to bring back the channel allocation as it worked back in Sitecore 8. You have also the possibility to just go with one of the two described processors. As a side note: Sitecore Support has registered a feature request to bring back those functionalities.

Enable "Other referrals" channel allocation

This one is quite simple to enable. As the processor is still available in all of the available Sitecore 9 versions (current version: Sitecore 9.2 Initial Release) we can simply introduce the ReferringSite processor back to the pipeline. Please keep in mind that this processor is flagged as "Obsolete". This means it might get removed in a future version of Sitecore.

Enable "Social" channels allocation

Reintroducing the "Social" channels allocation is a bit more work because this functionality is gone for good in Sitecore 9. Therefore I've reconstructed the old code and made some minor modifications/improvements. You can copy this Helix-ready project into your Visual Studio solution and will be done within a few minutes. Please notice that this project also includes the config file which enables the ReferringSite processor. If you don't want to use it, then just remove the Foundation.Channels.ReferringSite.config file. Let's have a look at the configuration:

As you can see, we have a new node which lets us configure the behaviour of channel allocation. This is not only restricted to social network traffic but can be used for all kinds of channels. Simply map one or more referrers to a channel (by ID) which is present in Sitecore. You can also create completely new channels and map those. You can find more information about this topic in the official documentation.

A word on retroactive allocation

There is no retroactive allocation of past collected interactions. If you want to map those interactions to the proper channels, then you have to do it yourself. I haven't done it myself but here are the steps you have to take most likely:

  1. Backup your Shard databases!
  2. Run a custom script which fetches all interactions with ChannelId {B418E4F2-1013-4B42-A053-B6D4DCA988BF} (this is the "Direct" channel) from xConnect or directly from the Shard databases. This will highly depend on how much data you have to process. Also make sure you fetch the corresponding InteractionFacets.
  3. Parse the FacetData value of the InteractionFacets (is stored in JSON) and read the Referrer property value.
  4. If the Referrer value is not empty, then run the determineInteractionChannel pipeline with this value.
  5. Save the ChannelId which has been calculated by the pipeline.
  6. Rebuild your reporting database. This can also be a tricky and time consuming part if you have millions of interactions to process. You might want to consider purging parts of the data which you don't need anymore. Sitecore 9.2 introduced a new Purging API which should help you handle this task. There is also a marketplace module available, called Analytics Database Manager.