Ads

 

Foreword

AT Internet’s SDK offers the measurement of your in-app ads so that you can evaluate their performance.

The goal is to measure “clicks” and impressions of self-promotion ad campaigns, as well as third-party campaigns displayed on your app, and then analyse this information.

 

Get off to a good start

Once your tag is initialised, you can start tagging your in-app ads.

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

 

Tagging

To tag your ads, the tracker exposes two objects, Publishers and SelfPromotions, according to the type of ad to be measured.

These two objects themselves expose two methods:

  • Add
  • SendImpressions

The Add method allows you to add an ad tag and put it in standby for send. This method returns an object with type Publisher or SelfPromotion according to the case in question.

To send the defined information, you must call the SendTouch or SendImpression method of your object, based on the type of action taken by the user, or call the Tracker’s Dispatch method.

Please note, calling the methods SendTouch and SendImpression modifies the object’s action property.

The SendImpressions method allows sending of all information for ads whose action is defined as Impression.

 

Tagging examples

  1. Tagging an ad impression for a third-party
    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.Publishers.Add("[ad1]").SendImpression();
            }
        }
    }
    
  2. Tagging an ad “click” for a third-party
    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.Publishers.Add("[ad1]").SendTouch();
            }
        }
    }
    
  3. Tagging a self-promotion campaign impression
    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)
            {
                Publisher publisher = tracker.Publishers.Add("[ad1]");
                publisher.Creation = "[creation]";
                publisher.Variant = "[variant]";
                publisher.Format = "[120x40]";
                publisher.GeneralPlacement = "[generalPlacement]";
                publisher.DetailedPlacement = "[detailedPlacement]";
                publisher.AdvertiserId = "1[http://advertiser-url.com]";
                publisher.Url = "[creation]";
    
                Publisher publisher2 = tracker.Publishers.Add("[ad2]");
                Publisher publisher3 = tracker.Publishers.Add("[ad3]");
                publisher3.Creation = "[creation]";
                publisher3.Variant = "[variant]";
                tracker.Publishers.SendImpressions();
           }
        }
    }
    
  4. Tagging an self-promotion campaign “click”
    private void Button_clicked(object button, RoutedEventArgs e) {
            tracker.SelfPromotions.Add(3).SendTouch();
    }
  5. Tagging several ads and sending impressions
    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, TrackerReadyHandler
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                SelfPromotion promotion = tracker.SelfPromotions.Add(1);
                promotion.Format = "[120x40]";
                promotion.ProductId = "p1";
    
                tracker.SelfPromotions.Add(1);
    
                SelfPromotion promotion2 = tracker.SelfPromotions.Add(3);
                promotion2.ProductId = "p3";
                tracker.SelfPromotions.SendImpressions();
            }
        }
    }
    
  6. Tagging several self-promotion campaigns and sending impressions
    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, TrackerReadyHandler
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                SelfPromotion promotion = tracker.SelfPromotions.Add(1);
                promotion.Format = "[120x40]";
                promotion.ProductId = "p1";
    
                tracker.SelfPromotions.Add(1);
    
                SelfPromotion promotion2 = tracker.SelfPromotions.Add(3);
                promotion2.ProductId = "p3";
                tracker.SelfPromotions.SendImpressions();
            }
        }
    }
    
  7. Tagging self-promotion ads and campaigns and using dispatcher
    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, TrackerReadyHandler
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                tracker.Publishers.Add();
                tracker.Publishers.Add();
                tracker.SelfPromotions.Add(1);
                tracker.Dispatch();
            }
        }
    }
    
  8. Tagging self-promotion ads and campaigns and adding screen information
    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, TrackerReadyHandler
        {
            Tracker tracker;
    
            public MainPage()
            {
                this.InitializeComponent();
                tracker = SmartTag.Instance.defaultTracker;
            }
    
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                SelfPromotion promotion = tracker.SelfPromotions.add(1);
                promotion.Format = "[120x40]";
                promotion.ProductId = "p1";
    
                tracker.SelfPromotions.Add(1);
    
                SelfPromotion promotion2 = tracker.SelfPromotions.Add(3);
                promotion2.ProductId = "p3";
                tracker.Screens.Add().SendView();
            }
        }
    }
    
 

Publisher class

 

Properties

NameTypeDefault valueDescription
CampaignIdStringEmpty stringGets or sets the campaign name (ex: [label] or id[label])
CreationStringnullGets or sets the creative name (ex: [label] or id[label])
VariantStringnullGets or sets the variant name (ex: [label] or id[label])
FormatStringnullGets or sets the format name (predefined or custom ID. ex: [120×40])
GeneralPlacementStringnullGets or sets the general placement (textual ID predefined by us, to be formatted as [label])
DetailedPlacementStringnullGets or sets the detailed placement (ex: [label] or id[label])
AdvertiserIdStringnullGets or sets the advertiser ID (ex: id[label])
UrlStringnullGets or sets the URL to which the link points. The URL is necessarily linked to the advertiser ID
ActionEnumOnAppAd.Action.ViewGets or sets the action type (View or Touch)
 

Methods

NameReturn typeDescription
SendTouchvoidSends a hit indicating that an ad was touched
SendImpressionvoidSends a hit indicating that an ad was seen
 

SelfPromotion class

 

Properties

NomTypeDefault valueDescription

AdId

Int-1Gets or sets the ad ID
FormatStringnullGets or sets the format name (predefined or custom ID. ex: [120×40])
ProductIdStringnullGets or sets the self-promoted product in question, that can be found in the order (Subject to the SalesTracker option)
ActionEnumOnAppAd.Action.ViewGets or sets the action type (View or Touch)
 

Methods

NameReturn typeDescription
SendTouchvoidSends a hit indicating that a self-promotion campaign was touched
SendImpressionvoidSends a hit indicating that a self-promotion campaign was seen
 

Was this post helpful?

Last update: 29/10/2015