-
Notifications
You must be signed in to change notification settings - Fork 0
Products 91797a
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.
Once your tag has been initialised, you can send information of viewed products.
In cases of a Swift project, please import the Tracker module (or TrackerExtension if your target is an extension) in your ViewController. In case of an Objective-C project, please import the headers ATInternet.h, ATTracker.h, ATProduct.h
The tracker makes a products property available. This property exposes the following methods :
- add (or addString in Objective-C) : 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 a viewed product
import UIKit
import Tracker
class ViewController: UIViewController {
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(animated: Bool) {
tracker.products.add("1253[MF885FA]", category1: "1[Desktop]", category2: "10[iMac]").sendView()
}
}#import "ViewController.h"
#import "ATInternet.h"
#import "ATTracker.h"
#import "ATProduct.h"
@interface ViewController ()
@property (nonatomic, strong) ATTracker* tracker;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tracker = [ATInternet sharedInstance].defaultTracker;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[self.tracker.products add:@"1253[MF885FA]" category1:@"1[Desktop]" category2: @"10[iMac]"] sendView];
}
@end-
Tagging several viewed products
import UIKit
import Tracker
class ViewController: UIViewController {
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(animated: Bool) {
tracker.products.add("1254[MF839FA]", category1: "2[Laptop]", category2: "20[Macbook Pro]")
tracker.products.add("1253[MF885FA]", category1: "1[Desktop]", category2: "10[iMac]")
tracker.products.sendViews()
}
}#import "ViewController.h"
#import "ATInternet.h"
#import "ATTracker.h"
#import "ATProduct.h"
@interface ViewController ()
@property (nonatomic, strong) ATTracker* tracker;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tracker = [ATInternet sharedInstance].defaultTracker;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tracker.products add:@"1254[MF839FA]" category1: @"2[Laptop]" category2: @"20[Macbook Pro]"];
[self.tracker.products add:@"1253[MF885FA]" category1: @"1[Desktop]" category2: @"10[iMac]"];
[self.tracker.products sendViews];
}
@end-
Tagging viewed products with an �add to cart
import UIKit
import Tracker
class ViewController: UIViewController {
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
var products: [Product] = []
override func viewDidLoad() {
super.viewDidLoad()
// Enable cart and set an ID
tracker.cart.set("1")
// Declare first product
let p1 = tracker.products.add("1254[MF839FA]", category1: "2[Laptop]", category2: "20[Macbook Pro]")
p1.quantity = 1
p1.unitPriceTaxFree = 1839
p1.unitPriceTaxIncluded = 2299
products.append(p1)
// Declare second product
let p2 = tracker.products.add("1253[MF885FA]", category1: "1[Desktop]", category2: "10[iMac]")
p2.quantity = 1
p2.unitPriceTaxFree = 1199
p2.unitPriceTaxIncluded = 1499
products.append(p2)
}
override func viewWillAppear(animated: Bool) {
// Send products views
tracker.products.sendViews()
// Send screen hit
tracker.screens.add("Store").sendView()
}
@IBAction func addProductToCart(sender: UIButton) {
// Add a previously declared product to the cart
tracker.cart.products.add(products[0])
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Go to cart resume and send a screen hit with cart content
let 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()
}
}#import "ViewController.h"
#import "ATInternet.h"
#import "ATTracker.h"
#import "ATScreen.h"
#import "ATCart.h"
#import "ATProduct.h"
@interface ViewController ()
@property (nonatomic, strong) ATTracker* tracker;
@property (nonatomic, strong) NSMutableArray* products;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tracker = [ATInternet sharedInstance].defaultTracker;
self.products = [[NSMutableArray alloc] init];
[self.tracker.cart setWithId:@"1"];
ATProduct *p1 = [self.tracker.products add:@"1254[MF839FA]" category1: @"2[Laptop]" category2: @"20[Macbook Pro]"];
p1.quantity = 1;
p1.unitPriceTaxFree = 1839;
p1.unitPriceTaxIncluded = 2299;
[self.products addObject:p1];
ATProduct *p2 = [self.tracker.products add:@"1253[MF885FA]" category1: @"1[Desktop]" category2: @"10[iMac]"];
p2.quantity = 1;
p2.unitPriceTaxFree = 1149;
p2.unitPriceTaxIncluded = 1499;
[self.products addObject:p2];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Send products views
[self.tracker.products sendViews];
[[self.tracker.screens addWithName:@"Store"] sendView];
}
- (IBAction) addProductToCart:(UIButton *)sender {
// Add a previously declared product to the cart
[self.tracker.cart.products add:self.products[0]];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Go to cart resume and send a screen hit with cart content
ATScreen* cartScreen = [self.tracker.screens addWithName:@"Cart resume"];
// If isBasketScreen is not set to true, Cart info won't be added to Screen hit
cartScreen.isBasketScreen = YES;
[cartScreen sendView];
}
@end-
Removal of a product
@IBAction func removeProduct(sender: UIButton) {
tracker.products.remove("1254[MF839FA]")
}- (IBAction) removeProduct:(UIButton *)sender {
[self.tracker.products removeWithId:@"1254[MF839FA]"];
}-
Removal of all products
@IBAction func removeProducts(sender: UIButton) {
tracker.products.removeAll()
}- (IBAction) removeProducts:(UIButton *)sender {
[self.tracker.products removeAll];
}-
Data API
- Data flow
- Advice optimizations data flow
- Error codes data flow
- Faq data flow
- General information data flow
- Technical information data flow
- Reporting API v3
- Getting started
- Methods
- Parameters
- Technical information
- REST API
- Campaigns
- Custom variables
- Getting started rest
- Methods rest
- Response structure parameters rest
- Fixed periods
- Parameters compatibility
- Relative periods
- Structure of the response
- “code” parameter
- “columns” parameter
- “evo” parameter
- “filter” parameter
- “include” parameter
- “lng” parameter
- “max-results” parameter
- “page-num” parameter
- “period” parameter
- “period” parameter: “H” v. “He” & “MN” v. “MNe”
- “retention” parameter
- “segmentdesc” parameter
- “segment” parameter
- “sep” parameter
- “sort” parameter
- “space” parameter
- Technical specifications rest
- Data flow
-
Data collection
- Android
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- Apple
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Users
- General
- Cddc renew staging process
- Changelog
- Craft your hit
- Encoded parameters
- Server side cookie management
- Supported taggings
- Tagging deletion
- Utilisation of dispatch sdks
- JavaScript
- Advanced features
- Campaigns
- Changelog
- Content
- Ecommerce
- Getting started
- Partners javascript
- Users
- Piano Analytics
- Event tagging piano analytics
- Getting started piano analytics
- Piano analytics tagging
- Feeding piano analytics with as2 tagging
- Tagging custom properties sdk
- Android