Internal search engine

 

Foreword

AT Internet’s SDK allows you to tag your application’s internal search engine. By doing so, you can see which keywords were entered, as well as the results screen number, and the position of the item selected by the user.

 

Get off to a good start

Once your tag is initialised, you can add the search information to your screen or gesture hit.

To use SDK class and methods, add ATInternet namespace to your Page.

 

Tagging

The tracker makes an internalSearches object available.

This property exposes an add method enabling the inclusion of search information in your screen or gesture tagging.

This method sends an InternalSearch-type object.

 

Tagging example

Tagging a search (the user is redirected toward a screen containing the results)

Here, parameters are passed as parameters during the selection of an item on the search screen

// SearchPage
private void GoToResultPage()
{
        Dictionary<string, string> param = new Dictionary<string, string>()
        {
            {"searchKeywords", "Windows" },
            {"searchScreenNumber", "1" },
            {"searchElementPosition", "1" },
        };
        Frame.Navigate(typeof(ResultPage), param);
}
using System;
using System.Collections.Generic;
using Windows.Data.Json;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using ATInternet;
using Windows.UI.Xaml.Navigation;

namespace App1
{
    public sealed partial class ResultPage : Page
    {
        Tracker tracker;

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
             tracker = SmartTag.Instance.defaultTracker;
             var parameters = e.Parameter as Dictionary<string, string>;
             string searchKeyword   = parameters["searchKeywords"];
             int searchScreenNumber = int.Parse(parameters["searchScreenNumber"]);
             int searchElementPosition = int.Parse(parameters["searchElementPosition"]);
             tracker.InternalSearches.Add(searchKeyword, searchScreenNumber, searchElementPosition);
        }
     }
}
 

InternalSearch class

 

Properties

NameTypeDefault valueDescription
KeywordStringnullGets or sets keywords entered during the search
ResultScreenNumberInt-1 (>= 1.2.2 –> 1)Gets or sets the screen number containing the item on which the user clicked
ResultPositionInt-1Gets or sets the position of the item on which the user clicked
 

Was this post helpful?

Last update: 24/02/2017