Jump to: Характеристики элементов событий
Событие можно сравнить с чеком на всю покупку. А элементы событий в MobileAppTracking (MAT) – это отдельные купленные товары. Они позволяют вам определить несколько элементов в едином логе. Например, если вы идете в супермаркет и покупаете там одно яблоко и два апельсина, эти фрукты являются элементами события для одного конкретного события (покупки в супермаркете).
Вы можете регистрировать события внутри мобильного приложения на стороне сервера. А в этом разделе мы расскажем, как включать элементы событий с зарегистрированными событиями с помощью SDK (его удобно использовать для регистрации различных покупок и информации об отдельных событиях, связанных с покупкой – таких, как бронирование номера в гостинице, покупка туристической путевки или онлайн-шопинг).
В элементы события вы можете включить до 5 уникальных атрибутов строки. Максимальная длина этих атрибутов составляет 255 символов. В MAT есть возможность изучить подробные данные об элементах события. Проводить их анализ можно вотчете о регистрации элементов событий.
Чтобы начать регистрацию элементов событий для мобильного приложения, следуйте инструкциям ниже. Мы сделали функциональный шаблон для разных платформ и плагинов. Выберите необходимые настройки и введите аргументы элементов события, которые вы хотите зарегистрировать.
Характеристики элементов событий
|
|
itemName | Название элемента типа String. |
unitPrice | Уникальная цена одного элемента типа Double. |
quantity | Количество приобретенных элементов типа Integer. |
revenue | Общая сумма покупки типа Double (если это значение не равно нулю, оно имеет больший приоритет, чем произведение quantity и unitPrice). |
attribute[1-5] | Индивидуальные строки, необязательные к заполнению типа String (максимальная длина – 255 символов). |
var eventItem:Dictionary = new Dictionary();
eventItem["item"] = itemName;
eventItem["unit_price"] = unitPrice;
eventItem["quantity"] = quantity;
eventItem["revenue"] = revenue;
eventItem["attribute_sub1"] = attribute1;
eventItem["attribute_sub2"] = attribute2;
eventItem["attribute_sub3"] = attribute3;
eventItem["attribute_sub4"] = attribute4;
eventItem["attribute_sub5"] = attribute5;
var eventItems:Array = new Array();
eventItems.push(eventItem);
mobileAppTracker.measureActionWithEventItem(eventName, eventItems);
var eventItem:Dictionary = new Dictionary();
eventItem["item"] = itemName;
eventItem["unit_price"] = unitPrice;
eventItem["quantity"] = quantity;
eventItem["revenue"] = revenue;
eventItem["attribute_sub1"] = attribute1;
eventItem["attribute_sub2"] = attribute2;
eventItem["attribute_sub3"] = attribute3;
eventItem["attribute_sub4"] = attribute4;
eventItem["attribute_sub5"] = attribute5;
var eventItems:Array = new Array();
eventItems.push(eventItem);
mobileAppTracker.trackActionWithEventItem(eventName, eventItems);
TuneEventItem eventItem = new TuneEventItem(itemName) // Required
.withQuantity(quantity) // Rest are optional
.withUnitPrice(unitPrice)
.withRevenue(revenue)
.withAttribute1(attribute)
...
.withAttribute5(attribute);
MATEventItem eventItem = new MATEventItem(itemName) // Required
.withQuantity(quantity) // Rest are optional
.withUnitPrice(unitPrice)
.withRevenue(revenue)
.withAttribute1(attribute)
...
.withAttribute5(attribute);
MATEventItem eventItem;
eventItem = new MATEventItem(itemName, quantity, unitPrice, revenue);
eventItem = new MATEventItem(itemName, attribute1, attribute2, attribute3, attribute4, attribute5);
eventItem = new MATEventItem(itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
MATEventItem eventItem;
eventItem = new MATEventItem(itemName, quantity, unitPrice, revenue);
eventItem = new MATEventItem(itemName, attribute1, attribute2, attribute3, attribute4, attribute5);
eventItem = new MATEventItem(itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
StringMap eventItem;
eventItem["item"] = itemName;
eventItem["unit_price"] = unitPrice;
eventItem["quantity"] = quantity;
eventItem["revenue"] = revenue;
eventItem["attribute1"] = attribute1;
eventItem["attribute2"] = attribute2;
eventItem["attribute3"] = attribute3;
eventItem["attribute4"] = attribute4;
eventItem["attribute5"] = attribute5;
PluginParam pEventItem(eventItem);
pluginMat->callFuncWithParam("trackActionWithEventItems", &pEventName, &pReferenceId, &pRevenue, &pCurrencyCode,
&pEventItem, NULL);
TuneEventItem *eventItem;
eventItem = [TuneEventItem eventItemWithName:itemName unitPrice:unitPrice quantity:quantity];
eventItem = [TuneEventItem eventItemWithName:itemName unitPrice:unitPrice quantity:quantity revenue:revenue];
eventItem = [TuneEventItem eventItemWithName:itemName
attribute1:attribute1
attribute2:attribute2
attribute3:attribute3
attribute4:attribute4
attribute5:attribute5];
eventItem = [TuneEventItem eventItemWithName:itemName
unitPrice:unitPrice
quantity:quantity
revenue:revenue
attribute1:attribute1
attribute2:attribute2
attribute3:attribute3
attribute4:attribute4
attribute5:attribute5];
MATEventItem *eventItem;
eventItem = [MATEventItem eventItemWithName:itemName unitPrice:unitPrice quantity:quantity];
eventItem = [MATEventItem eventItemWithName:itemName unitPrice:unitPrice quantity:quantity revenue:revenue];
eventItem = [MATEventItem eventItemWithName:itemName
attribute1:attribute1
attribute2:attribute2
attribute3:attribute3
attribute4:attribute4
attribute5:attribute5];
eventItem = [MATEventItem eventItemWithName:itemName
unitPrice:unitPrice
quantity:quantity
revenue:revenue
attribute1:attribute1
attribute2:attribute2
attribute3:attribute3
attribute4:attribute4
attribute5:attribute5];
var eventItem = new MATEventItem({
"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5
});
MobileAppTracker.trackAction(eventName, 0, null, null, [eventItem]);
var eventItem = new MATEventItem({
"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5
});
MobileAppTracker.trackAction(eventName, 0, null, null, [eventItem]);
MATSDKEventItem *eventItems = (MATSDKEventItem *)s3eMalloc(sizeof(MATSDKEventItem));
strncpy(eventItems[0].name, itemName, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].unitPrice, unitPrice, S3E_MATSDK_STRING_MAX);
eventItems[0].quantity = quantity;
strncpy(eventItems[0].revenue, revenue, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute1, attribute1, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute2, attribute2, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute3, attribute3, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute4, attribute4, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute5, attribute5, S3E_MATSDK_STRING_MAX);
MATArray array;
array.m_count = 1;
array.m_items = eventItems;
MATMeasureActionWithItems(eventName, &array, NULL, NULL, NULL, 0, NULL, NULL);
s3eFree(eventItems);
MATSDKEventItem *eventItems = (MATSDKEventItem *)s3eMalloc(sizeof(MATSDKEventItem));
strncpy(eventItems[0].name, itemName, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].unitPrice, unitPrice, S3E_MATSDK_STRING_MAX);
eventItems[0].quantity = quantity;
strncpy(eventItems[0].revenue, revenue, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute1, attribute1, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute2, attribute2, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute3, attribute3, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute4, attribute4, S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute5, attribute5, S3E_MATSDK_STRING_MAX);
MATArray array;
array.m_count = 1;
array.m_items = eventItems;
MATTrackActionForEventIdOrNameItems(eventName, &array, NULL, NULL, NULL, 0, NULL, NULL);
s3eFree(eventItems);
var eventItems = new Array();
var eventItem = {
"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5
};
eventItems[0] = eventItem;
var matEvent = {
"name": "eventName",
"eventItems": eventItems
};
mobileAppTracker.measureEvent(matEvent);
var eventItem = {"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5};
mobileAppTracker.measureActionWithItems(function (winParams) {
console.log("tracking result: " + JSON.parse(winParams)['result']);
}, function (error) {
console.log("tracking error: " + error);
}, eventName, [eventItem], null, revenue);
var eventItem = {"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5};
mobileAppTracker.trackActionWithItems(function (winParams) {
console.log("tracking result: " + JSON.parse(winParams)['result']);
}, function (error) {
console.log("tracking error: " + error);
}, eventName, [eventItem], null, revenue);
var eventItem = {"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5};
mobileAppTracker.measureEvent({
eventName: eventName,
eventItems: [eventItem]
});
var eventItem = {"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5};
mobileAppTracker.measureActionWithItems(eventName, [eventItem]);
var eventItem = {"item": itemName,
"unit_price": unitPrice,
"quantity": quantity,
"revenue": revenue,
"attribute_sub1": attribute1,
"attribute_sub2": attribute2,
"attribute_sub3": attribute3,
"attribute_sub4": attribute4,
"attribute_sub5": attribute5};
mobileAppTracker.trackActionWithItems(eventName, [eventItem]);
using MATSDK;
MATItem eventItem = new MATItem("itemName");
eventItem.unitPrice = unitPrice;
eventItem.quantity = quantity;
eventItem.revenue = revenue;
eventItem.attribute1 = attribute1;
eventItem.attribute2 = attribute2;
eventItem.attribute3 = attribute3;
eventItem.attribute4 = attribute4;
eventItem.attribute5 = attribute5;
#if UNITY_ANDROID
[DllImport ("mobileapptracker")]
private static extern void measureActionWithEventItems(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
#if UNITY_IPHONE
[DllImport ("__Internal")]
private static extern void measureActionWithEventItems(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
public struct MATItem
{
public string name;
public double unitPrice;
public int quantity;
public double revenue;
public string attribute1;
public string attribute2;
public string attribute3;
public string attribute4;
public string attribute5;
}
MATItem eventItem = new MATItem ();
eventItem.name = itemName;
eventItem.unitPrice = unitPrice;
eventItem.quantity = quantity;
eventItem.revenue = revenue;
eventItem.attribute1 = attribute1;
eventItem.attribute2 = attribute2;
eventItem.attribute3 = attribute3;
eventItem.attribute4 = attribute4;
eventItem.attribute5 = attribute5;
MATItem[] eventItems = {eventItem};
measureActionWithEventItems(eventName, eventItems, eventItems.length, null, 0, null, 0, null, null);
#if UNITY_ANDROID
[DllImport ("mobileapptracker")]
private static extern void trackActionWithEventItem(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
#if UNITY_IPHONE
[DllImport ("__Internal")]
private static extern void trackActionWithEventItem(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
public struct MATItem
{
public string name;
public double unitPrice;
public int quantity;
public double revenue;
public string attribute1;
public string attribute2;
public string attribute3;
public string attribute4;
public string attribute5;
}
MATItem eventItem = new MATItem ();
eventItem.name = itemName;
eventItem.unitPrice = unitPrice;
eventItem.quantity = quantity;
eventItem.revenue = revenue;
eventItem.attribute1 = attribute1;
eventItem.attribute2 = attribute2;
eventItem.attribute3 = attribute3;
eventItem.attribute4 = attribute4;
eventItem.attribute5 = attribute5;
MATItem[] eventItems = {eventItem};
trackActionWithEventItem (eventName, eventItems, eventItems.length, null, 0, null, 0, null, null);
MATEventItem eventItem = new MATEventItem (itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
List<MATEventItem> eventItems = new List<MATEventItem>();
eventItems.add (eventItem);
mobileAppTracker.TrackAction (eventName, 0, null, null, eventItems);
MATEventItem eventItem = new MATEventItem (itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
List<MATEventItem> eventItems = new List<MATEventItem>();
eventItems.add (eventItem);
mobileAppTracker.MeasureAction (eventName, eventItems: eventItems);
MATEventItem eventItem = new MATEventItem (itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
List<MATEventItem> eventItems = new List<MATEventItem>();
eventItems.add (eventItem);
mobileAppTracker.TrackAction (eventName, 0, null, null, eventItems);
MATEventItem eventItem = MATEventItem.EventItemWithName(itemName, unitPrice, quantity, revenue, attribute1,
attribute2, attribute3, attribute4, attribute5);
MATEventItem[] eventItems = {eventItem};
MobileAppTracker.MeasureAction (eventName, eventItems, null, 0, null, 0);
MATEventItem eventItem = new MATEventItem (itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
mobileAppTracker.MeasureAction (eventName, eventItem);
MATEventItem eventItem = MATEventItem.EventItemWithName(itemName, unitPrice, quantity, revenue, attribute1,
attribute2, attribute3, attribute4, attribute5);
MATEventItem[] eventItems = {eventItem};
MobileAppTracker.MeasureAction (eventName, eventItems, null, 0, null, 0);
MATEventItem eventItem = new MATEventItem (itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
mobileAppTracker.MeasureAction (eventName, eventItem);
MATEventItem eventItem = MATEventItem.EventItemWithName(itemName, unitPrice, quantity, revenue, attribute1,
attribute2, attribute3, attribute4, attribute5);
MATEventItem[] eventItems = {eventItem};
mobileAppTracker.TrackActionWithItems (eventName, eventItems, null, 0, null, 0);
MATEventItem eventItem = new MATEventItem (itemName, quantity, unitPrice, revenue,
attribute1, attribute2, attribute3, attribute4, attribute5);
mobileAppTracker.TrackAction (eventName, eventItem);
Select a preferred platform.
Example:
// Example event item with product SKU
var eventItem:Dictionary = new Dictionary();
eventItem["item"] = "apple";
eventItem["unit_price"] = 0.50;
eventItem["quantity"] = 3;
eventItem["revenue"] = 1.50;
eventItem["attribute_sub1"] = "3848-4578458-347834";
var eventItems:Array = new Array();
eventItems.push(eventItem);
// Example event item with product SKU
var eventItem:Dictionary = new Dictionary();
eventItem["item"] = "apple";
eventItem["unit_price"] = 0.50;
eventItem["quantity"] = 3;
eventItem["revenue"] = 1.50;
eventItem["attribute_sub1"] = "3848-4578458-347834";
var eventItems:Array = new Array();
eventItems.push(eventItem);
// Example event item with product SKU
TuneEventItem eventItem = new TuneEventItem("apple")
.withQuantity(3)
.withUnitPrice(0.50)
.withRevenue(1.50)
.withAttribute1("3848-4578458-347834");
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem("apple")
.withQuantity(3)
.withUnitPrice(0.50)
.withRevenue(1.50)
.withAttribute1("3848-4578458-347834");
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem("apple", 3, 0.50, 1.50, "3848-4578458-347834", null, null, null, null);
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem("apple", 3, 0.50, 1.50, "3848-4578458-347834", null, null, null, null);
// Example event item with product SKU
StringMap eventItem;
eventItem["item"] = "apple";
eventItem["unit_price"] = 0.50f;
eventItem["quantity"] = 3;
eventItem["revenue"] = 1.50f;
eventItem["attribute1"] = "3848-4578458-347834";
PluginParam pEventItem(eventItem);
// Example event item with product SKU
TuneEventItem *eventItem = [TuneEventItem eventItemWithName:@"apple"
unitPrice:0.50
quantity:3
revenue:1.50
attribute1:@"3848-4578458-347834"
attribute2:@"crisp"
attribute3:@"red"
attribute4:nil
attribute5:nil];
// Example event item with product SKU
MATEventItem *eventItem = [MATEventItem eventItemWithName:@"apple"
unitPrice:0.50
quantity:3
revenue:1.50
attribute1:@"3848-4578458-347834"
attribute2:@"crisp"
attribute3:@"red"
attribute4:nil
attribute5:nil];
// Example event item with product SKU
var eventItem = new MATEventItem({
"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
// Example event item with product SKU
var eventItem = new MATEventItem({
"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
// Example event item with product SKU
MATSDKEventItem *eventItems = (MATSDKEventItem *)s3eMalloc(sizeof(MATSDKEventItem));
strncpy(eventItems[0].name, "apple", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].unitPrice, "0.50", S3E_MATSDK_STRING_MAX);
eventItems[0].quantity = 3;
strncpy(eventItems[0].revenue, "1.50", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute1, "3848-4578458-347834", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute2, "", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute3, "", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute4, "", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute5, "" S3E_MATSDK_STRING_MAX);
MATArray array;
array.m_count = 1;
array.m_items = eventItems;
// Example event item with product SKU
MATSDKEventItem *eventItems = (MATSDKEventItem *)s3eMalloc(sizeof(MATSDKEventItem));
strncpy(eventItems[0].name, "apple", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].unitPrice, "0.50", S3E_MATSDK_STRING_MAX);
eventItems[0].quantity = 3;
strncpy(eventItems[0].revenue, "1.50", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute1, "3848-4578458-347834", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute2, "", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute3, "", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute4, "", S3E_MATSDK_STRING_MAX);
strncpy(eventItems[0].attribute5, "" S3E_MATSDK_STRING_MAX);
MATArray array;
array.m_count = 1;
array.m_items = eventItems;
var eventItems = new Array();
// Example event item with product SKU
var eventItem = {
"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
eventItems[0] = eventItem;
var matEvent = {
"name": "purchase",
"eventItems": eventItems
};
mobileAppTracker.measureEvent(matEvent);
// Example event item with product SKU
var eventItem = {"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
mobileAppTracker.measureActionWithItems(function (winParams) {
console.log("tracking result: " + JSON.parse(winParams)['result']);
}, function (error) {
console.log("tracking error: " + error);
}, eventName, [eventItem], null, revenue);
// Example event item with product SKU
var eventItem = {"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
mobileAppTracker.trackActionWithItems(function (winParams) {
console.log("tracking result: " + JSON.parse(winParams)['result']);
}, function (error) {
console.log("tracking error: " + error);
}, eventName, [eventItem], null, revenue);
// Example event item with product SKU
var eventItem = {"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
mobileAppTracker.measureEvent({
eventName: eventName,
eventItems: [eventItem]
});
// Example event item with product SKU
var eventItem = {"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
mobileAppTracker.measureActionWithItems(eventName, [eventItem]);
// Example event item with product SKU
var eventItem = {"item": "apple",
"unit_price": 0.50,
"quantity": 3,
"revenue": 1.50,
"attribute_sub1": "3848-4578458-347834"
};
mobileAppTracker.trackActionWithItems(eventName, [eventItem]);
using MATSDK;
// Example event item with product SKU
MATItem eventItem = new MATItem("apple");
eventItem.unitPrice = 0.50;
eventItem.quantity = 3;
eventItem.revenue = 1.50;
eventItem.attribute1 = "3848-4578458-347834";
MATItem[] eventItems = {eventItem};
MATEvent matEvent = new MATEvent("eventName");
matEvent.eventItems = eventItems;
MATBinding.MeasureEvent(matEvent);
// Example event item with product SKU
#if UNITY_ANDROID
[DllImport ("mobileapptracker")]
private static extern void measureActionWithEventItems(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
#if UNITY_IPHONE
[DllImport ("__Internal")]
private static extern void measureActionWithEventItems(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
public struct MATItem
{
public string name;
public double unitPrice;
public int quantity;
public double revenue;
public string attribute1;
public string attribute2;
public string attribute3;
public string attribute4;
public string attribute5;
}
MATItem eventItem = new MATItem ();
eventItem.name = "apple";
eventItem.unitPrice = 0.50;
eventItem.quantity = 3;
eventItem.revenue = 1.50;
eventItem.attribute1 = "3848-4578458-347834";
eventItem.attribute2 = null;
eventItem.attribute3 = null;
eventItem.attribute4 = null;
eventItem.attribute5 = null;
MATItem[] eventItems = {eventItem};
// Example event item with product SKU
#if UNITY_ANDROID
[DllImport ("mobileapptracker")]
private static extern void trackActionWithEventItem(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
#if UNITY_IPHONE
[DllImport ("__Internal")]
private static extern void trackActionWithEventItem(string eventName, MATItem[] eventItems, int eventItemCount,
string referenceId, double revenue, string currencyCode,
int transactionState, string receiptData,
string receiptSignature);
#endif
public struct MATItem
{
public string name;
public double unitPrice;
public int quantity;
public double revenue;
public string attribute1;
public string attribute2;
public string attribute3;
public string attribute4;
public string attribute5;
}
MATItem eventItem = new MATItem ();
eventItem.name = "apple";
eventItem.unitPrice = 0.50;
eventItem.quantity = 3;
eventItem.revenue = 1.50;
eventItem.attribute1 = "3848-4578458-347834";
eventItem.attribute2 = null;
eventItem.attribute3 = null;
eventItem.attribute4 = null;
eventItem.attribute5 = null;
MATItem[] eventItems = {eventItem};
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem ("apple", 3, 0.50, 1.50,
"3848-4578458-347834", null, null, null, null);
List<MATEventItem> eventItems = new List<MATEventItem>();
eventItems.add (eventItem);
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem ("apple", 3, 0.50, 1.50,
"3848-4578458-347834", null, null, null, null);
List<MATEventItem> eventItems = new List<MATEventItem>();
eventItems.add (eventItem);
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem ("apple", 3, 0.50, 1.50,
"3848-4578458-347834", null, null, null, null);
List<MATEventItem> eventItems = new List<MATEventItem>();
eventItems.add (eventItem);
// Example event item with product SKU
MATEventItem eventItem = MATEventItem.EventItemWithName("apple", 0.50, 3, 1.50,
"3848-4578458-347834", null, null, null, null);
MATEventItem[] eventItems = {eventItem};
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem ("apple", 3, 0.50, 1.50,
"3848-4578458-347834", null, null, null, null);
// Example event item with product SKU
MATEventItem eventItem = MATEventItem.EventItemWithName("apple", 0.50, 3, 1.50,
"3848-4578458-347834", null, null, null, null);
MATEventItem[] eventItems = {eventItem};
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem ("apple", 3, 0.50, 1.50,
"3848-4578458-347834", null, null, null, null);
// Example event item with product SKU
MATEventItem eventItem = MATEventItem.EventItemWithName("apple", 0.50, 3, 1.50,
"3848-4578458-347834", null, null, null, null);
MATEventItem[] eventItems = {eventItem};
// Example event item with product SKU
MATEventItem eventItem = new MATEventItem ("apple", 3, 0.50, 1.50,
"3848-4578458-347834", null, null, null, null);
Select a preferred platform.