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)
-
Determines if this timer is currently running
- property(nonatomic, readonly, getter)
-
Determines if this timer has been ended
property(nonatomic, readonly, getter)
Determines if this timer is currently running
@property ( nonatomic, readonly, getter = isRunning) BOOL running;
Return Value
True if timer has started but not yet ended.
property(nonatomic, readonly, getter)
Determines if this timer has been ended
@property ( nonatomic, readonly, getter = hasEnded) BOOL 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:
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
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
Discussion
Set this timer's AB test identifier
setBrandValue:
- (void)setBrandValue:(double)brandValue;
Parameters
Discussion
Set the brand value of this timer
setCampaignMedium:
- (void)setCampaignMedium:(nonnull NSString *)campaignMedium;
Parameters
Discussion
Set the medium of the campaign
setCampaignName:
- (void)setCampaignName:(nonnull NSString *)campaignName;
Parameters
Discussion
Set the name of the campaign
setCampaignSource:
- (void)setCampaignSource:(nonnull NSString *)campaignSource;
Parameters
Discussion
Set the source of the campaign
setCartValue:
- (void)setCartValue:(double)cartValue;
Parameters
Discussion
Set the value of the cart for this timer
setContentGroupName:
- (void)setContentGroupName:(nonnull NSString *)contentGroupName;
Parameters
Discussion
Set the content group name or page type for this timer
setField:boolValue:
- (void)setField:(nonnull NSString *)fieldName boolValue:(BOOL)boolValue;
Parameters
Discussion
Sets a field name with the given value
setField:doubleValue:
- (void)setField:(nonnull NSString *)fieldName doubleValue:(double)doubleValue;
Parameters
Discussion
Sets a field name with the given value
setField:floatValue:
- (void)setField:(nonnull NSString *)fieldName floatValue:(float)floatValue;
Parameters
Discussion
Sets a field name with the given value
setField:integerValue:
- (void)setField:(nonnull NSString *)fieldName integerValue:(NSInteger)integerValue;
Parameters
Discussion
Sets a field name with the given value
setField:stringValue:
- (void)setField:(nonnull NSString *)fieldName stringValue:(nonnull NSString *)stringValue;
Parameters
Discussion
Sets a field name with the given value
setFields:
- (void)setFields:(nonnull NSDictionary *)fields;
Parameters
Discussion
Allows the setting of multiple fields via a Dictionary
setOrderNumber:
- (void)setOrderNumber:(nonnull NSString *)orderNumber;
Parameters
Discussion
Set the order number for this timer
setOrderTime:
- (void)setOrderTime:(NSInteger)orderTime;
Parameters
Discussion
Set the time of the order
setPageName:
- (void)setPageName:(nonnull NSString *)pageName;
Parameters
Discussion
Set the timer's page name
setPageValue:
- (void)setPageValue:(double)pageValue;
Parameters
Discussion
Set the value of this page/timer
setReferrer:
- (void)setReferrer:(nonnull NSString *)referrer;
Parameters
Discussion
Set the referrer URL for this timer
setTimeOnPage:
- (void)setTimeOnPage:(NSInteger)timeOnPage;
Parameters
Discussion
Set time on page for this timer
setTrafficSegmentName:
- (void)setTrafficSegmentName:(nonnull NSString *)trafficSegmentName;
Parameters
Discussion
Set the timer's traffic segment name
setURL:
- (void)setURL:(nonnull NSString *)url;
Parameters
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
timerWithPageName:trafficSegment:
+ (nonnull BTTimer *)timerWithPageName:(nonnull NSString *)pageName trafficSegment:(nonnull NSString *)trafficSegment;
Parameters
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
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.