Summary:
This document contains information regarding the BTTimer Class for the iOS SDK. Contents include:
BTTimer Introduction
BTTimer.h
Requires:
<Foundation/Foundation.h>
Introduction:
A timer instance that can be started, marked interactive, and ended.
Discussion:
Timers maintain the start, interactive, and end times in milliseconds. They also maintain a map of attributes for the timer such as page name, brand value, campaign name, AB test, etc.
Functions
@property (nonatomic, readonly, getter = isRunning) BOOL running;
Determines if this timer is currently running.
Return Value:
True if timer has started but not yet ended.
@property (nonatomic, readonly, getter = hasEnded) BOOL ended;
Determines if this timer has been ended
Return Value:
True if ended, else false
Methods
+allFields
+clearField:
+end
+interactive
+setABTestIdentifier:
+setBrandValue:
+setCampaignMedium:
+setCampaignName:
+setCampaignSource:
+setCartValue:
+setContentGroupName:
+setField:boolValue:
+setField:doubleValue:
+setField:floatValue:
+setField:integerValue:
+setField:stringValue:
+setFields:
+setOrderNumber:
+setOrderTime:
+setPageName:
+setPageValue:
+setReferrer:
+setTimeOnPage:
+setTrafficSegmentName:
+setURL:
+start
+timer
+timerWithPageName:trafficSegment:
+timerWithPageName:trafficSegment:abTestIdentifier:contentGroupName:
Method Definitions
allFields
(NSDictionary *)allFields;
Return Value:
Returns a Dictionary with all the fields currently.
Discussion:
Get all the fields currently associated with this timer.
clearField:
(void)clearField:(NSString *)fieldName;
Parameters:
fieldName - name of field to remove
Discussion:
Resets a field to the default value if there is one else removes the field completely.
end
(void)end;
Discussion:
End this timer.
interactive
(void)interactive;
Discussion:
Mark this timer interactive at current time if the timer has been started and not already marked interactive. If the timer has not been started yet, log an error. If the timer has already been marked interactive, log an error.
setABTestIdentifier:
(void)setABTestIdentifier:(nonnull NSString *)abTestIdentifier;
Parameters:
abTestIdentifier - the AB test id
Discussion:
Set this timer's AB test identifier
setBrandValue:
(void)setBrandValue:(double)brandValue;
Parameters:
brandValue - brand's value
Discussion:
Set the brand value of this timer
setCampaignMedium:
(void)setCampaignMedium:(nonnull NSString *)campaignMedium;
Parameters:
campaignMedium - medium of campaign
Discussion:
Set the medium of the campaign
setCampaignName:
(void)setCampaignName:(nonnull NSString *)campaignName;
Parameters:
campaignName - name of campaign
Discussion:
Set the name of the campaign
setCampaignSource:
(void)setCampaignSource:(nonnull NSString *)campaignSource;
Parameters:
campaignSource - source of campaign
Discussion:
Set the source of the campaign
setCartValue:
(void)setCartValue:(double)cartValue;
Parameters:
cartValue - value of cart
Discussion:
Set the value of the cart for this timer
setContentGroupName:
(void)setContentGroupName:(nonnull NSString *)contentGroupName;
Parameters:
contentGroupName - name of content group or page type
Discussion:
Set the content group name or page type for this timer
setField:boolValue:
(void)setField:(nonnull NSString *)fieldName boolValue:(BOOL)boolValue;
Parameters:
fieldName - The name of the field to set
boolValue - The value to set for the given field
Discussion:
Sets a field name with the given value
setField:doubleValue:
(void)setField:(nonnull NSString *)fieldName doubleValue:(double)doubleValue;
Parameters:
fieldName - The name of the field to set
doubleValue - The value to set for the given field
Discussion:
Sets a field name with the given value
setField:floatValue:
(void)setField:(nonnull NSString *)fieldName floatValue:(float)floatValue;
Parameters:
fieldName - The name of the field to set
floatValue - The value to set for the given field
Discussion:
Sets a field name with the given value
setField:integerValue:
(void)setField:(nonnull NSString *)fieldName integerValue:(NSInteger)integerValue;
Parameters:
fieldName - The name of the field to set
integerValue - The value to set for the given field
Discussion:
Sets a field name with the given value
setField:stringValue:
(void)setField:(nonnull NSString *)fieldName stringValue:(nonnull NSString *)stringValue;
Parameters:
fieldName - The name of the field to set
stringValue - The value to set for the given field
Discussion:
Sets a field name with the given value
setFields:
(void)setFields:(nonnull NSDictionary *)fields;
Parameters:
fields - The fields to set on this timer
Discussion:
Allows the setting of multiple fields via a Dictionary
setOrderNumber:
(void)setOrderNumber:(nonnull NSString *)orderNumber;
Parameters:
orderNumber - order number
Discussion:
Set the order number for this timer
setOrderTime:
(void)setOrderTime:(NSInteger)orderTime;
Parameters:
orderTime - epoch time of order in milliseconds
Discussion:
Set the time of the order
setPageName:
(void)setPageName:(nonnull NSString *)pageName;
Parameters:
pageName - name of the page for this timer
Discussion:
Set the timer's page name
setPageValue:
(void)setPageValue:(double)pageValue;
Parameters:
pageValue - value of page
Discussion:
Set the value of this page/timer
setReferrer:
(void)setReferrer:(nonnull NSString *)referrer;
Parameters:
referrer - the referrer URL
Discussion:
Set the referrer URL for this timer
setTimeOnPage:
(void)setTimeOnPage:(NSInteger)timeOnPage;
Parameters:
timeOnPage - time on page in milliseconds
Discussion:
Set time on page for this timer
setTrafficSegmentName:
(void)setTrafficSegmentName:(nonnull NSString *)trafficSegmentName;
Parameters:
trafficSegmentName - name of the traffic segment for this timer
Discussion:
Set the timer's traffic segment name
setURL:
(void)setURL:(nonnull NSString *)url;
Parameters:
url - the url for this timer
Discussion:
Set the URL for this timer
start
(void)start;
Discussion:
Start this timer if not already started. If already started, will log an error.
timer
(nonnull BTTimer *)timer;
Discussion:
Note: Page name or Traffic segment name will need to be set later before submitting the timer.
timerWithPageName:trafficSegment:
(nonnull BTTimer *)timerWithPageName:(nonnull NSString *)pageName
trafficSegment:(nonnull NSString *)trafficSegment;
Parameters:
pageName - The page name
trafficSegment - The traffic segment name
Discussion:
Create a timer instance with the given page name and traffic segment name
timerWithPageName:trafficSegment:abTestIdentifier:contentGroupName:
(nonnull BTTimer *)timerWithPageName:(nonnull NSString *)pageName
trafficSegment:(nonnull NSString *)trafficSegment
abTestIdentifier:(nullable NSString *)abTestIdentifier
contentGroupName:(nullable NSString *)contentGroupName;
Parameters:
pageName - The page name
trafficSegment - The traffic segment name
abTestIdentifier - The AB test id
contentGroupName - The content group name
Discussion:
Create a timer instance with the given page name, traffic segment name, optional AB test id, and optional content group name.
Comments
0 comments
Please sign in to leave a comment.