Jump to: Building an Event | Basic | Advanced | Event Items | Builder Methods
With the extensive options that Attribution Analytics™ (AA) provides for event measurement, it can be overwhelming to know which events to measure and how to actually measure them in your code.
We have a list of recommended events to measure, and starting from the TUNE Android SDK version 3.8, iOS SDK 3.9 and compatible plugins, we’re introducing the TuneEvent class to simplify the way you build event measurement calls.
Parameter | Type | Description |
Event Name | String | Name of event to measure, e.g. “purchase” |
Revenue | Double | Revenue of event to measure |
Currency Code | String | ISO 4217 currency code of revenue |
Advertiser Ref ID | String | Unique reference ID (like an order ID) to associate with the event |
Event Items | List | List of Tune Event Items |
Receipt Data | String | iTunes receipt or Google Play receipt data, for purchase validation |
Receipt Signature | String | Google Play receipt signature, for purchase validation |
Content ID | String | International Article Number (EAN) when applicable, or other product or content identifier |
Content Type | String | Content type, e.g. “shoes” |
Date 1 | Date | Date of an event |
Date 2 | Date | Second date of an event, e.g. an end date |
Level | Integer | Level of an event |
Quantity | Integer | Quantity for an event |
Rating | Double | Rating for an event |
Search String | String | Search string for an event |
Attribute 1-5 | String | Arbitrary String values of your choice to associate with an event |
Parameter | Type | Description |
Event Name | NSString* | Name of event to measure, e.g. “purchase” |
Revenue | CGFloat | Revenue of event to measure |
Currency Code | NSString* | ISO 4217 currency code of revenue |
Advertiser Ref ID | NSString* | Unique reference ID (like an order ID) to associate with the event |
Event Items | List | List of Tune Event Items |
Receipt Data | NSData* | iTunes receipt receipt data, for purchase validation |
Content ID | NSString* | International Article Number (EAN) when applicable, or other product or content identifier |
Content Type | NSString* | Content type, e.g. “shoes” |
Date 1 | NSDate* | Date of an event |
Date 2 | NSDate* | Second date of an event, e.g. an end date |
Level | NSInteger | Level of an event |
Quantity | NSInteger | Quantity for an event |
Rating | CGFloat | Rating for an event |
Search String | NSString* | Search string for an event |
Attribute 1-5 | NSString* | Arbitrary String values of your choice to associate with an event |
Parameter | Type | Description |
Event Name | String | Name of event to measure, e.g. “purchase” |
Revenue | Double | Revenue of event to measure |
Currency Code | String | ISO 4217 currency code of revenue |
Advertiser Ref ID | String | Unique reference ID (like an order ID) to associate with the event |
Event Items | List | List of Tune Event Items |
Receipt Data | String | iTunes receipt or Google Play receipt data, for purchase validation |
Receipt Signature | String | Google Play receipt signature, for purchase validation |
Content ID | String | International Article Number (EAN) when applicable, or other product or content identifier |
Content Type | String | Content type, e.g. “shoes” |
Date 1 | Date | Date of an event |
Date 2 | Date | Second date of an event, e.g. an end date |
Level | Integer | Level of an event |
Quantity | Integer | Quantity for an event |
Rating | Double | Rating for an event |
Search String | String | Search string for an event |
Attribute 1-5 | String | Arbitrary String values of your choice to associate with an event |
Parameter | Type | Description |
Event Name | String | Name of event to measure, e.g. “purchase” |
Revenue | Double | Revenue of event to measure |
Currency Code | String | ISO 4217 currency code of revenue |
Advertiser Ref ID | String | Unique reference ID (like an order ID) to associate with the event |
Event Items | List | List of Tune Event Items |
Receipt Data | String | iTunes receipt or Google Play receipt data, for purchase validation |
Receipt Signature | String | Google Play receipt signature, for purchase validation |
Content ID | String | International Article Number (EAN) when applicable, or other product or content identifier |
Content Type | String | Content type, e.g. “shoes” |
Date 1 | Date | Date of an event |
Date 2 | Date | Second date of an event, e.g. an end date |
Level | Integer | Level of an event |
Quantity | Integer | Quantity for an event |
Rating | Double | Rating for an event |
Search String | String | Search string for an event |
Attribute 1-5 | String | Arbitrary String values of your choice to associate with an event |
Parameter | Type | Description |
Event Name | String | Name of event to measure, e.g. “purchase” |
Revenue | Double | Revenue of event to measure |
Currency Code | String | ISO 4217 currency code of revenue |
Advertiser Ref ID | String | Unique reference ID (like an order ID) to associate with the event |
Event Items | List | List of Tune Event Items |
Receipt Data | String | iTunes receipt or Google Play receipt data, for purchase validation |
Receipt Signature | String | Google Play receipt signature, for purchase validation |
Content ID | String | International Article Number (EAN) when applicable, or other product or content identifier |
Content Type | String | Content type, e.g. “shoes” |
Date 1 | Date | Date of an event |
Date 2 | Date | Second date of an event, e.g. an end date |
Level | Integer | Level of an event |
Quantity | Integer | Quantity for an event |
Rating | Double | Rating for an event |
Search String | String | Search string for an event |
Attribute 1-5 | String | Arbitrary String values of your choice to associate with an event |
Building an Event
Basic
When constructing an event, only the eventName is required. If these are the only values you care about measuring, you do not need to use the event builder (simply use measureEvent directly with your eventName):
measureEvent(String eventName);
+ (void)measureEventName:(NSString *)eventName;
measureEvent(string eventName);
measureEvent(string eventName);
Tune.MeasureEvent(string eventName);
Select a preferred platform.
Advanced
For more complex events, we’ll use measureEvent with the TuneEvent parameter. We first instantiate a new TuneEvent object with a required eventName.
Tune.getInstance().measureEvent(new TuneEvent("purchase"));
TuneEvent *event = [TuneEvent eventWithName:@"purchase"];
[Tune measureEvent:event];
var tuneEvent = {"name": "purchase"};
window.plugins.tunePlugin.measureEvent(matEvent);
var matEvent = {eventName: "purchase"};
mobileAppTracker.measureEvent(matEvent);
Tune.MeasureEvent(new TuneEvent("purchase"));
Select a preferred platform.
You may then set any additional parameters to this TuneEvent. A full list of parameters can be found below. You may add new parameters you discover onto an existing TuneEvent object to update it, as long as it is built before the measureEvent call.
For example, to measure revenue and currency code with a “purchase” event:
Tune.getInstance().measureEvent(new TuneEvent("purchase").withRevenue(0.99).withCurrencyCode("CAD"));
TuneEvent *event = [TuneEvent eventWithName:@"purchase"];
event.revenue = 0.99;
event.currencyCode = @"CAD";
[Tune measureEvent:event];
var tuneEvent = {
"name": "purchase",
"revenue": 0.99,
"currency": "CAD"
};
window.plugins.tunePlugin.measureEvent(matEvent);
var matEvent = {
eventName: "purchase",
revenue: 0.99,
currencyCode: "CAD"
};
mobileAppTracker.measureEvent(matEvent);
TuneEvent event = new TuneEvent("purchase");
event.revenue = 0.99;
event.currencyCode = "CAD";
Tune.MeasureEvent(event);
Select a preferred platform.
You may add as many applicable parameters as you like:
Tune.getInstance().measureEvent(new TuneEvent("purchase")
.withRevenue(0.99)
.withCurrencyCode("CAD")
.withAdvertiserRefId("12345")
.withLevel(5)
.withAttribute1("extra life"));
TuneEvent *event = [TuneEvent eventWithName:@"purchase"];
event.revenue = 0.99;
event.currencyCode = @"CAD";
event.refId = @"12345";
event.level = 5;
event.attribute1 = @"extra life";
[Tune measureEvent:event];
var tuneEvent = {
"name": "purchase",
"revenue": 0.99,
"currency": "CAD",
"advertiserRefId": "12345",
"level": 5,
"attribute1": "extra life"
};
window.plugins.tunePlugin.measureEvent(tuneEvent);
var matEvent = {
eventName: "purchase",
revenue: 0.99,
currencyCode: "CAD",
advertiserRefId: "12345",
level: 5,
attribute1: "extra life"
};
mobileAppTracker.measureEvent(matEvent);
TuneEvent event = new TuneEvent("purchase");
event.revenue = 0.99;
event.currencyCode = "CAD";
event.advertiserRefId = "12345";
event.level = 5;
event.attribute1 = "extra life";
Tune.MeasureEvent(event);
Select a preferred platform.
Event Items
Event Items have a similar builder helper, here we have an example of its use in conjunction with TuneEvent:
// Add TuneEventItem to a List to pass into TuneEvent
ArrayList<TuneEventItem> list = new ArrayList<>();
list.add(new TuneEventItem("apple")
.withQuantity(3));
Tune.getInstance().measureEvent(new TuneEvent("purchase")
.withEventItems(list));
TuneEventItem *item = [TuneEventItem eventItemWithName:@"apple" unitPrice:0.49 quantity:3];
TuneEvent *event = [TuneEvent eventWithName:@"purchase"];
event.eventItems = @[item];
[Tune measureEvent:event];
// Add TUNE Event Item to an Array to pass into the TuneEvent
var eventItems = new Array();
var eventItem = {
"item": "apple",
"quantity": 3
};
eventItems[0] = eventItem;
var tuneEvent = {
"name": "purchase",
"eventItems": eventItems
};
window.plugins.tunePlugin.measureEvent(tuneEvent);
// Add MAT Event Item to an Array to pass into the MATEvent
var eventItems = new Array();
var eventItem = {
"item": "apple",
"quantity": 3
};
eventItems[0] = eventItem;
var matEvent = {
eventName: "purchase",
eventItems: eventItems
};
mobileAppTracker.measureEvent(matEvent);
// Add TuneItem to an Array to pass into TuneEvent
TuneItem item = new TuneItem("apple");
item.quantity = 3;
TuneItem[] eventItems = {item};
TuneEvent tuneEvent = new TuneEvent("purchase");
tuneEvent.eventItems = eventItems;
Tune.MeasureEvent(tuneEvent);
Select a preferred platform.
Builder Methods
List of parameters that can be linked with a TuneEvent:
withAdvertiserRefId(String advertiserRefId)
withAttribute1(String attribute)
withAttribute2(String attribute)
withAttribute3(String attribute)
withAttribute4(String attribute)
withAttribute5(String attribute)
withContentId(String contentId)
withContentType(String contentType)
withCurrencyCode(String currencyCode)
withDate1(Date date1)
withDate2(Date date2)
withEventItems(List<TuneEventItem> eventItems)
withLevel(int level)
withQuantity(int quantity)
withRating(double rating)
withReceipt(String receiptData, String receiptSignature)
withRevenue(double revenue)
withSearchString(String searchString)
NSString *eventName; // readonly
NSInteger eventId;
NSArray *eventItems;
CGFloat revenue;
NSString *currencyCode;
NSString *refId;
NSData *receipt;
NSString *contentType;
NSString *contentId;
NSString *searchString;
NSInteger transactionState;
CGFloat rating;
NSInteger level;
NSUInteger quantity;
NSDate *date1;
NSDate *date2;
NSString *attribute1;
NSString *attribute2;
NSString *attribute3;
NSString *attribute4;
NSString *attribute5;
string name;
number id;
double revenue;
string currency;
string advertiserRefId;
var[] eventItems;
string receipt;
string receiptSignature;
string contentType;
string contentId;
int level;
int quantity;
string searchString;
double rating;
double date1;
double date2;
string attribute1;
string attribute2;
string attribute3;
string attribute4;
string attribute5;
string eventName;
number id;
double revenue;
string currencyCode;
string advertiserRefId;
var[] eventItems;
string receipt;
string receiptSignature;
string contentType;
string contentId;
int level;
int quantity;
string searchString;
double rating;
double date1;
double date2;
string attribute1;
string attribute2;
string attribute3;
string attribute4;
string attribute5;
string name;
int? id;
double? revenue;
string currencyCode;
string advertiserRefId;
TuneItem[] eventItems;
int transactionState;
string receipt;
string receiptSignature;
string contentType;
string contentId;
int? level;
int? quantity;
string searchString;
double? rating;
DateTime? date1;
DateTime? date2;
string attribute1;
string attribute2;
string attribute3;
string attribute4;
string attribute5;
Select a preferred platform.
For event templates and sample code, please visit Event Function Templates.