Products

 

Foreword

AT Internet’s SDK enables you to tag products for sale that are viewed by your users during usage of your application.

The measurement of viewed products needs an option to be activated. Please contact the support centre for more information.

 

Get off to a good start

Once your tag has been initialised, you can send information of viewed products.

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

 

Tagging

The tracker makes a Products property available. This property exposes the following methods :

  • Add : Add a viewed product to the list and returns a Product object.
  • Remove : Removes a viewed product in the list.
  • RemoveAll : Removes all viewed products.
  • SendViews : Send all viewed products.

 

 

Tagging examples

  1. Tagging a viewed product
    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 MainPage : Page
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                tracker.Products.Add("1253[MF885FA]", "1[Desktop]", "10[iMac]");
            }
        }
    }
    
  2. Tagging several viewed products
    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 MainPage : Page
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                tracker.Products.Add("1253[MF885FA]", "1[Laptop]" , "10[Macbook Pro]" );
                tracker.Products.Add("1253[MF889FA]", "1[Desktop]", "10[iMac]");
                tracker.Products.SendViews();
            }
        }
    }
    
  3. Tagging viewed products with an “add to cart
    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 MainPage : Page
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
                List products = new List();
                tracker.Cart.Set("1");
                Product p1 = tracker.Cart.Products.Add("1253[MF885FA]", "1[Desktop]", "10[iMac]");
                p1.Category1 = "10Shoes";
                p1.Quantity = 1;
                p1.UnitPriceTaxFree = 70;
                p1.UnitPriceTaxIncluded = 85;
                p1.PromotionalCode = "ATCode";
                p1.DiscountTaxFree = 0;
                p1.DiscountTaxIncluded = 0;
                products.Add(p1);
    
                Product p2 = tracker.Cart.Products.Add("ID[P2]");
                p2.Category1 = "20Socks";
                p2.Quantity = 2;
                p2.UnitPriceTaxFree = 7;
                p2.UnitPriceTaxIncluded = 10;
                products.Add(p2);
            }
    
            protected override void OnNavigatingFrom(NavigationEventArgs e)
            {
                // Go to cart resume and send a screen hit with cart content
                Screen cartScreen = tracker.Screens.Add("Cart resume");
                // If isBasketScreen is not set to true, Cart info won't be added to Screen hit
                cartScreen.IsBasketScreen = true;
                cartScreen.SendView();
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                tracker.Products.SendViews();
                tracker.Screens.Add("store").SendView();
            }
        }
    }
    
  4. Removal of a product
    private void removeProduct() {
        tracker.Products.Remove("1254[MF839FA]")
    }
  5. Removal of all products
    private void removeAllProducts() {
        tracker.Products.RemoveAll()
    }
 

Product class

 

Properties

NameTypeDefault valueDescription
ProductIdStringEmpty stringGets or sets the product ID
Category1String?nilGets or sets the product’s 1st category
Category2String?nilGets or sets the product’s 2nd category
Category3String?nilGets or sets the product’s 3rd category
Category4String?nilGets or sets the product’s 4th category
Category5String?nilGets or sets the product’s 5th category
Category6String?nilGets or sets the product’s 6th category
QuantityInt?nilGets or sets the product quantity
UnitPriceTaxIncludedDouble?nilGets or sets the unit price, including tax
UnitPriceTaxFreeDouble?nilGets or sets the unit price, excluding tax
DiscountTaxIncludedDouble?nilGets or sets the total discount, including tax
DiscountTaxFreeDouble?nilGets or sets the total discount, excluding tax
PromotionalCodeString?nilGets or sets the product’s promotional code
 

Was this post helpful?

Last update: 11/06/2018