How to Resolve an Interaction Channel Using a Query String in Sitecore

What does “Channel” term mean in the Sitecore context? Channel is the source or the paths that contacts use to interact with your brand through campaigns and face-to-face interactions. Sitecore defines why you need them:

“When you view how contacts interact with your website, it can be helpful to track the channels that your contacts use to come to your website. This can give you more insight into how contacts interact with your brand, which channels bring the most traffic to your campaigns, and which channels lead to the best goal conversion rates.” (

Let’s imagine that we have some specific ways how users interact with our application. It can be some web api, services and etc. In our case, we use JSS Layout service to provide data for Xamarin app and we want to associate interactions of the mobile app with, for example, “App usage” channel.

Our requirement can be easily resolved by passing an id of the “App usage” channel in a query string parameter in a layout service url.

First of all we need to `QueryStringChannelResolver` processor:

   using Sitecore.Analytics.OmniChannel.Pipelines.DetermineInteractionChannel;
using Sitecore.Data;
using Sitecore.Diagnostics;

namespace Jss.Demo.App.Pipelines.Channel
    public class QueryStringChannelResolver : DetermineChannelProcessorBase
        public override void Process(DetermineChannelProcessorArgs args)
            Assert.ArgumentNotNull((object)args, nameof(args));
            if (string.IsNullOrWhiteSpace(Sitecore.Context.Request.QueryString["channelId"]))

            var queryString = Sitecore.Context.Request.QueryString["channelId"];
            ID channelId;
            if (ID.TryParse(queryString, out channelId))
                args.ChannelId = channelId;

And then to register it in “determineInteractionChannel” pipline:

   <!--?xml version="1.0" encoding="utf-8" ?-->
<configuration xmlns:patch="">
type="Jss.Demo.App.Pipelines.Channel.QueryStringChannelResolver, Jss.Demo.App"
patch:after="processor[@type='Sitecore.Analytics.OmniChannel.Pipelines.DetermineInteractionChannel.DefaultChannel, Sitecore.Analytics.OmniChannel']">

After that, our request url became to look like the following:


Now we can track the interactions from our mobile app separately from the site activities:

interaction channels sitecore