-
Notifications
You must be signed in to change notification settings - Fork 0
Product events a2040f
This tagging documentation only applies to Tracker from version 2.17.0.
If you can 't see the “Sales Insights” menu entry in Explorer, please get in touch with us so we can activate this for you.
With the tracker, an ecommerce instance is available, exposing different objects and methods useful for measuring:
- Product displays
- Product page displays
- Add-to-cart or remove-from-cart actions
Measuring product display is done by creating a DisplayProduct object, to which the following is associated:
- A list of products, products, which can contain one or several ECommerceProduct-type products.
A product 's properties should be declared as a Dictionary-type collection, with different keys:
- “id” – String: Product ID (mandatory).
- “variant” – String: Product variant (size, colour, etc.).
- “article” – String: Additional level of detail for product variant.
- “placement” – String: Product placement.
- “promocode” – Array: Promotional code table including one or several codes. A promotional code is declared as a label.
- “$” – String: Product name.
- “brand” – String: Product brand.
- “discount” – Boolean: Discounted product.
- “pricetaxincluded” – Float: Price, including tax.
- “pricetaxfree” – Float: Price, excluding tax.
- “stock” – Boolean: Product in stock.
- “category1” – String: The product 's level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).
Example
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
let dp: DisplayProduct = tracker.ecommerce.displayProducts.add()
dp.products.append(ECommerceProduct(obj:
[
"id": "7",
"variant": "1",
"article": "21",
"placement": "homepage",
"promocode": ["AQQYRTGJ"],
"$": "laptop_A56",
"brand": "ACER",
"discount": true,
"pricetaxincluded": 549,
"pricetaxfree": 456.2,
"stock": true,
"category1": "Computers_and_Networking",
"category2": "Computers",
"category3": "Laptops"
]))
tracker.dispatch()You may use the independent method “tracker.events.send()” in order to send only your Ecommerce data.
Tracker* tracker = [ATInternet sharedInstance].defaultTracker;
DisplayProduct *dp = [[tracker.ecommerce displayProducts] add];
NSMutableArray *dpproducts = [dp.products mutableCopy];
[dpproducts addObject:[[ECommerceProduct alloc] initWithObj:@{
@"id": @"7",
@"variant": @"1",
@"article": @"21",
@"placement": @"homepage",
@"promocode": @[@"AQQYRTGJ"],
@"$": @"laptop_A56",
@"brand": @"ACER",
@"discount": @true,
@"pricetaxincluded": @549,
@"pricetaxfree": @456.2,
@"stock": @true,
@"category1": @"Computers_and_Networking",
@"category2": @"Computers",
@"category3": @"Laptops"
}]];
[dp setProducts: dpproducts];
[tracker dispatch];You may use the independent method “[tracker.events send];” in order to send only your Ecommerce data.
Measuring the display of a product page is done by creating a DisplayPageProduct object, to which the following is associated:
- an ECommerceProduct-type product.
A product 's properties should be declared as a em>Dictionary-type collection, with different keys:
- “id” – String: Product ID (mandatory).
- “variant” – String: Product variant (size, colour, etc.).
- “article” – String: Additional level of detail for product variant.
- “placement” – String: Product placement.
- “promocode” – Array: Promotional code table including one or several codes. A promotional code is declared as a label.
- “$” – String: Product name.
- “brand” – String: Product brand.
- “discount” – Boolean: Discounted product.
- “pricetaxincluded” – Float: Price, including tax.
- “pricetaxfree” – Float: Price, excluding tax.
- “stock” – Boolean: Product in stock.
- “category1” – String: The product 's level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).
In case of SalesTracker tagging activation, you can add screen data by passing an instance of Screen as a parameter.
Example
Tracker tracker = let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
let myScreen: Screen = tracker.screens.add("product")
let dpp: DisplayPageProduct = tracker.ecommerce.displayPageProducts.add(screen: myScreen)
_ = dpp.product.setAll(obj:
[
"id": "7",
"variant": "1",
"article": "21",
"placement": "homepage",
"promocode": ["AQQYRTGJ"],
"$": "laptop_A56",
"brand": "ACER",
"discount": true,
"pricetaxincluded": 549,
"pricetaxfree": 456.2,
"stock": true,
"category1": "Computers_and_Networking",
"category2": "Computers",
"category3": "Laptops"
])
tracker.dispatch()You may use the independent method “tracker.events.send()” in order to send only your Ecommerce data.
Tracker* tracker = [ATInternet sharedInstance].defaultTracker;
// With SalesTracker
[tracker.ecommerce setAutoSalesTrackerEnabled:YES sync:YES completionHandler:nil];
Screen *myScreen = [tracker.screens add:@"product"];
DisplayPageProduct *dpp = [[tracker.ecommerce displayPageProducts] addWithScreen:myScreen];
(void)[dpp.product setAllWithObj:@{
@"id": @"7",
@"variant": @"1",
@"article": @"21",
@"placement": @"homepage",
@"promocode": @[@"AQQYRTGJ"],
@"$": @"laptop_A56",
@"brand": @"ACER",
@"discount": @true,
@"pricetaxincluded": @549,
@"pricetaxfree": @456.2,
@"stock": @true,
@"category1": @"Computers_and_Networking",
@"category2": @"Computers",
@"category3": @"Laptops"
}];
[tracker dispatch];You may use the independent method “[tracker.events send];” in order to send only your Ecommerce data.
Measuring the addition of a product to the cart is done by creating an AddProduct object, to which the following are associated:
- an ECommerceCart-type cart
- an ECommerceProduct-type product
A cart must contain a property:
- “id” – String: Cart ID (mandatory).
A product 's properties should be declared as a Dictionary-type collection, with different keys:
- “id” – String: Product ID (mandatory).
- “variant” – String: Product variant (size, colour, etc.).
- “article” – String: Additional level of detail for product variant.
- “placement” – String: Product placement.
- “promocode” – Array: Promotional code table including one or several codes. A promotional code is declared as a label.
- “$” – String: Product name.
- “brand” – String: Product brand.
- “discount” – Boolean: Discounted product.
- “pricetaxincluded” – Float: Price, including tax.
- “pricetaxfree” – Float: Price, excluding tax.
- “stock” – Boolean: Product in stock.
- “quantity” – Number: Number of products to add.
- “category1” – String: CThe product 's level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).
- “cartcreation” – Boolean: Cart creation (true if the action of adding a product has resulted in cart creation, false otherwise).
Example
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
let ap: AddProduct = tracker.ecommerce.addProducts.add()
_ = ap.cart.set(key: "id", value: "34")
_ = ap.product.setAll(obj:
[
"id": "3",
"variant": "1",
"article": "21",
"placement": "homepage",
"promocode": ["AQQYRTGJ"],
"$": "laptop_A56",
"brand": "ACER",
"discount": true,
"pricetaxincluded": 549,
"pricetaxfree": 456.2,
"stock": true,
"quantity": 1,
"cartcreation": true,
"category1": "Computers_and_Networking",
"category2": "Computers",
"category3": "Laptops"
]
)
tracker.dispatch()You may use the independent method “tracker.events.send()” in order to send only your Ecommerce data.
Tracker* tracker = [ATInternet sharedInstance].defaultTracker;
AddProduct *ap = [[tracker.ecommerce addProducts] add];
(void)[ap.cart setWithKey:@"id" value:@"34"];
(void)[ap.product setAllWithObj:@{
@"id": @"3",
@"variant": @"1",
@"article": @"21",
@"placement": @"homepage",
@"promocode": @[@"AQQYRTGJ"],
@"$": @"laptop_A56",
@"brand": @"ACER",
@"discount": @true,
@"pricetaxincluded": @549,
@"pricetaxfree": @456.2,
@"stock": @true,
@"quantity": @1,
@"cartcreation": @true,
@"category1": @"Computers_and_Networking",
@"category2": @"Computers",
@"category3": @"Laptops"
}];
[tracker dispatch];You may use the independent method “[tracker.events send];” in order to send only your Ecommerce data.
Measuring the deletion of a product from the cart is done by creating a RemoveProduct object, to which the following are associated:
- an ECommerceCart-type cart
- an ECommerceProduct-type product
A cart must contain a property:
- “id” – String: Cart ID (mandatory).
A product 's properties should be declared as a Dictionary-type collection, with different keys:
- “id” – String: Product ID (mandatory).
- “variant” – String: Product variant (size, colour, etc.).
- “article” – String: Additional level of detail for product variant.
- “placement” – String: Product placement.
- “promocode” – Array: Promotional code table including one or several codes. A promotional code is declared as a label.
- “$” – String: Product name.
- “brand” – String: Product brand.
- “discount” – Boolean: Discounted product.
- “pricetaxincluded” – Float: Price, including tax.
- “pricetaxfree” – Float: Price, excluding tax.
- “stock” – Boolean: Product in stock.
- “quantity” – Number: Number of products to add.
- “category1” – String: The product 's level 1 category (up to 6 tree structure levels are possible; from “category1” to “category6”).
Example
let tracker: Tracker = ATInternet.sharedInstance.defaultTracker
let rp: RemoveProduct = tracker.ecommerce.removeProducts.add()
_ = rp.cart.set(key: "id", value: "34")
_ = rp.product.setAll(obj:
[
"id": "3",
"variant": "1",
"article": "21",
"placement": "homepage",
"promocode": ["AQQYRTGJ"],
"$": "laptop_A56",
"brand": "ACER",
"discount": true,
"pricetaxincluded": 549,
"pricetaxfree": 456.2,
"stock": true,
"quantity": 1,
"category1": "Computers_and_Networking",
"category2": "Computers",
"category3": "Laptops"
]
)
tracker.dispatch()You may use the independent method “tracker.events.send()” in order to send only your Ecommerce data.
Tracker* tracker = [ATInternet sharedInstance].defaultTracker;
RemoveProduct *rp = [[tracker.ecommerce removeProducts] add];
(void)[rp.cart setWithKey:@"id" value:@"34"];
(void)[rp.product setAllWithObj:@{
@"id": @"3",
@"variant": @"1",
@"article": @"21",
@"placement": @"homepage",
@"promocode": @[@"AQQYRTGJ"],
@"$": @"laptop_A56",
@"brand": @"ACER",
@"discount": @true,
@"pricetaxincluded": @549,
@"pricetaxfree": @456.2,
@"stock": @true,
@"quantity": @1,
@"category1": @"Computers_and_Networking",
@"category2": @"Computers",
@"category3": @"Laptops"
}];
[tracker dispatch];You may use the independent method “[tracker.events send];” in order to send only your Ecommerce data.
-
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