﻿#### 

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.” ([https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/marketing_operations/channels/the_online_channels_and_their_subchannels](https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/marketing_operations/channels/the_online_channels_and_their_subchannels "online channels"))

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"]))
                return;

            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="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<determineInteractionChannel>
<processor
type="Jss.Demo.App.Pipelines.Channel.QueryStringChannelResolver, Jss.Demo.App"
patch:after="processor[@type='Sitecore.Analytics.OmniChannel.Pipelines.DetermineInteractionChannel.DefaultChannel, Sitecore.Analytics.OmniChannel']">
</processor>
</determineInteractionChannel>
</pipelines>
</sitecore>
</configuration>
```

After that, our request url became to look like the following:

```
   http://{our-url}/sitecore/api/layout/render/jss?item={PATH}&sc_lang=en&sc_apikey={apikey}&channelId={1914DA0E-9C3A-4EC3-A2C2-A12EED2A4577}&tracking=true
```

Now we can track the interactions from our mobile app separately from the site activities:

![interaction channels sitecore](https://www.brimit.com/-/media/images/blog/interaction-channel-sc.png?la=en&amp;hash=C71E91C56B764F3F91A2F6B6FAC96223)

###### Author

[!\[artsiom-photo\](https://www.brimit.com/-/jssmedia/feature/blogs/authors/artsiom-200.jpg?h=202&amp;iar=0&amp;w=200&amp;hash=41797D2540DF6EB6FDF558360F6F62B8)
Artsem Prashkovich
Sitecore MVP/ Solution Architect](https://www.brimit.com/blog/author?authors=Artsem%20Prashkovich)

#### More on Sitecore

[!\[How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects\](https://www.brimit.com/-/jssmedia/project/brimit/blog/2024/vercel_cover-image.png)
#Guides#How-toDXPE-commerce
##### How Vercel Will Help You Save Effort When Deploying Sophisticated Sitecore Projects
Optimize and accelerate the development and deployment of complex multisite Sitecore projects.
Alexei Vershalovich on July 17, 2024](https://www.brimit.com/blog/how-vercel-will-help-you-save-effort-when-deploying-sophisticated-sitecore-projects)

[!\[Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story\](https://www.brimit.com/-/jssmedia/project/brimit/blog/2023/sitecore-mentoring---cover-image.png)
#How-toDXP
##### Training Up Tomorrow's Sitecore MVPs: a Mentoring Success Story
How to participate in the Sitecore Mentor program and help younger colleagues jump-start a career in Sitecore development.
Sergey Baranov on October 2, 2023](https://www.brimit.com/blog/training-up-tomorrows-sitecore-mvps)

[!\[Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)\](https://www.brimit.com/-/jssmedia/project/brimit/blog/2022/headless/adobestock_456986731.jpg)
#How-toDXPE-commerce
##### Going Headless. Part 2: When a Headless CMS Is Your Best Bet (if you have Sitecore)
Discover how a headless CMS can benefit organizations that use Sitecore.
Daniil Raschupkin, Palina Trokhautsava on September 15, 2022](https://www.brimit.com/blog/going-headless-part-2-when-a-headless-cms-is-your-best-bet-if-you-have-sitecore)

![](https://bat.bing.net/action/0?ti=187017043&amp;tm=gtm002&amp;Ver=2&amp;mid=bad49bb4-1242-4d6d-b6ed-6d6b241f8c71&amp;bo=2&amp;gtm_tag_source=1&amp;pi=0&amp;lg=en-US&amp;sw=800&amp;sh=600&amp;sc=24&amp;nwd=1&amp;tl=How%20to%20resolve%20interaction%20channel%20by%20query%20string%20in%20Sitecore&amp;kw=Sitecore,%20JSS,%20Xamarin,%20channel,%20query&amp;p=https%3A%2F%2Fwww.brimit.com%2Fblog%2Fhowto-resolve-interaction-channel-query-string-sitecore&amp;r=&amp;lt=296&amp;evt=pageLoad&amp;sv=2&amp;asc=D&amp;cdb=AQAY&amp;rn=159313)