PSHMetrics Class Reference

Inherits from NSObject
Declared in PSHMetrics.h

+ sendMetricFirstName:

Use this method to send a user first name metric.

+ (void)sendMetricFirstName:(NSString *)name

Parameters

name

User’s first name.

Declared In

PSHMetrics.h

+ sendMetricLastName:

Use this method to send a user last name metric.

+ (void)sendMetricLastName:(NSString *)name

Parameters

name

User’s last name.

Declared In

PSHMetrics.h

+ sendMetricGender:

Use this method to send a user gender metric.

+ (void)sendMetricGender:(PSHGenderType)gender

Parameters

gender

Gender of user.

Declared In

PSHMetrics.h

+ sendMetricBirthday:

Use this method to send a user birthday metric.

+ (void)sendMetricBirthday:(NSDate *)birthday

Parameters

birthday

Date of birthday in the current system timezone.

Declared In

PSHMetrics.h

+ sendMetricCarrierName:

Use this method to send a carrier name metric.

+ (void)sendMetricCarrierName:(NSString *)carrier

Parameters

carrier

Carrier name.

Declared In

PSHMetrics.h

+ sendMetricCity:

Use this method to send a city name metric.

+ (void)sendMetricCity:(NSString *)city

Parameters

city

City name.

Declared In

PSHMetrics.h

+ sendMetricCountry:

Use this method to send a country metric.

+ (void)sendMetricCountry:(NSString *)country

Parameters

country

Country in ISO 3166-1 alpha-2 (two characters).

Declared In

PSHMetrics.h

+ sendMetricUnsubscribe

Use this method to Unsubscribe to Push Notification.

+ (void)sendMetricUnsubscribe

Declared In

PSHMetrics.h

+ sendMetricSubscribe

Use this method to Subscribe to Push Notification.

+ (void)sendMetricSubscribe

Declared In

PSHMetrics.h

+ sendMetricFacebookFriends:

Use this method to send a facebook friends metric.

+ (void)sendMetricFacebookFriends:(NSUInteger)number

Parameters

number

Number of facebook friends.

Declared In

PSHMetrics.h

+ sendMetricFacebookLogin

Use this method to send a facebook login metric.

+ (void)sendMetricFacebookLogin

Declared In

PSHMetrics.h

+ sendMetricGoogleLogin

Use this method to send a google login metric.

+ (void)sendMetricGoogleLogin

Declared In

PSHMetrics.h

+ sendMetricTwitterLogin

Use this method to send a twitter login metric.

+ (void)sendMetricTwitterLogin

Declared In

PSHMetrics.h

+ sendMetricEmail:

Use this method to send an email metric.

+ (void)sendMetricEmail:(NSString *)email

Parameters

email

Email address.

Declared In

PSHMetrics.h

+ sendMetricPhone:

Use this method to send a phone number metric.

+ (void)sendMetricPhone:(NSString *)phone

Parameters

phone

Phone number.

Declared In

PSHMetrics.h

+ sendMetricPurchaseProducts:

Use this method to send a product purchase metric.

+ (void)sendMetricPurchaseProducts:(NSArray<PSHProduct*> *)productArray

Parameters

productArray

Array of PSHProduct objects

Declared In

PSHMetrics.h

+ sendMetricTwitterFollowers:

Use this method to send a twitter followers metric.

+ (void)sendMetricTwitterFollowers:(NSUInteger)number

Parameters

number

Number of twitter followers.

Declared In

PSHMetrics.h

+ sendMetricViewedCampaign:

Use this method to send a campaing viewed metric.

+ (void)sendMetricViewedCampaign:(PSHCampaignDAO *)campaign

Parameters

campaign

Viewed campaign.

Declared In

PSHMetrics.h

+ sendMetricLocation:

Use this method to send a location metric.

+ (void)sendMetricLocation:(CLLocation *)location

Parameters

location

Location to send.

Declared In

PSHMetrics.h

+ sendMetricLogin

Use this method to send a generic login metric.

+ (void)sendMetricLogin

Declared In

PSHMetrics.h

+ sendMetricRegister

Use this method to send a user register metric.

+ (void)sendMetricRegister

Declared In

PSHMetrics.h

+ sendMetricLogout

Use this method to send a generic logout metric.

+ (void)sendMetricLogout

Declared In

PSHMetrics.h

+ sendMetricFacebookLogout

Use this method to send a facebook logout metric.

+ (void)sendMetricFacebookLogout

Declared In

PSHMetrics.h

+ sendMetricGoogleLogout

Use this method to send a google logout metric.

+ (void)sendMetricGoogleLogout

Declared In

PSHMetrics.h

+ sendMetricTwitterLogout

Use this method to send a twitter logout metric.

+ (void)sendMetricTwitterLogout

Declared In

PSHMetrics.h

+ sendMetricFacbookID:

Use this method to send a facebook ID metric.

+ (void)sendMetricFacbookID:(NSString *)facebookId

Parameters

facebookId

Facebook ID.

Declared In

PSHMetrics.h

+ sendMetricTwitterID:

Use this method to send a twitter ID metric.

+ (void)sendMetricTwitterID:(NSString *)twitterId

Parameters

twitterId

Twitter ID.

Declared In

PSHMetrics.h

+ sendMetricGoogleID:

Use this method to send a google ID metric.

+ (void)sendMetricGoogleID:(NSString *)googleId

Parameters

googleId

Google ID.

Declared In

PSHMetrics.h

+ sendMetricUserID:

Use this method to send a user ID metric.

+ (void)sendMetricUserID:(NSString *)userId

Parameters

userId

User ID.

Declared In

PSHMetrics.h

+ sendMetricCartProducts:

Use this method to send a number of products in the cart metric.

+ (void)sendMetricCartProducts:(NSUInteger)number

Parameters

number

Number of products in the cart.

Declared In

PSHMetrics.h

+ sendMetricAddCartProduct:productId:price:currency:

Use this method to send a product add on the cart metric.

+ (void)sendMetricAddCartProduct:(NSString *)name productId:(NSString *)productId price:(NSNumber *)price currency:(NSString *)currency

Parameters

name

Name of product

productId

ID of product

price

Price of product

currency

Currency in ISO 4217 codification

Declared In

PSHMetrics.h

+ sendMetricDeleteCartProduct:productId:price:currency:

Use this method to send a product remove from the cart metric.

+ (void)sendMetricDeleteCartProduct:(NSString *)name productId:(NSString *)productId price:(NSNumber *)price currency:(NSString *)currency

Parameters

name

Name of product

productId

ID of product

price

Price of product

currency

Currency in ISO 4217 codification

Declared In

PSHMetrics.h

+ sendMetricContentViewName:

Use this method to send a content view name metric.

+ (void)sendMetricContentViewName:(NSString *)name

Parameters

name

Content view name.

Declared In

PSHMetrics.h

+ sendMetricFirstName:onChange:

Use this method to send a user first name metric.

+ (void)sendMetricFirstName:(NSString *)name onChange:(BOOL)state

Parameters

name

User’s first name.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricLastName:onChange:

Use this method to send a user last name metric.

+ (void)sendMetricLastName:(NSString *)name onChange:(BOOL)state

Parameters

name

User’s last name.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricGender:onChange:

Use this method to send a user gender metric.

+ (void)sendMetricGender:(PSHGenderType)gender onChange:(BOOL)state

Parameters

gender

Gender of user.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricBirthday:onChange:

Use this method to send a user birthday metric.

+ (void)sendMetricBirthday:(NSDate *)birthday onChange:(BOOL)state

Parameters

birthday

Date of birthday in the current system timezone.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricCarrierName:onChange:

Use this method to send a carrier name metric.

+ (void)sendMetricCarrierName:(NSString *)carrier onChange:(BOOL)state

Parameters

carrier

Carrier name.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricCity:onChange:

Use this method to send a city name metric.

+ (void)sendMetricCity:(NSString *)city onChange:(BOOL)state

Parameters

city

City name.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricCountry:onChange:

Use this method to send a country metric.

+ (void)sendMetricCountry:(NSString *)country onChange:(BOOL)state

Parameters

country

Country in ISO 3166-1 alpha-2 (two characters).

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricFacebookFriends:onChange:

Use this method to send a facebook friends metric.

+ (void)sendMetricFacebookFriends:(NSUInteger)number onChange:(BOOL)state

Parameters

number

Number of facebook friends.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricEmail:onChange:

Use this method to send an email metric.

+ (void)sendMetricEmail:(NSString *)email onChange:(BOOL)state

Parameters

email

Email address.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricPhone:onChange:

Use this method to send a phone number metric.

+ (void)sendMetricPhone:(NSString *)phone onChange:(BOOL)state

Parameters

phone

Phone number.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricPurchaseProducts:onChange:

Use this method to send a product purchase metric.

+ (void)sendMetricPurchaseProducts:(NSArray<PSHProduct*> *)productArray onChange:(BOOL)state

Parameters

productArray

Array of PSHProduct objects

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricTwitterFollowers:onChange:

Use this method to send a twitter followers metric.

+ (void)sendMetricTwitterFollowers:(NSUInteger)number onChange:(BOOL)state

Parameters

number

Number of twitter followers.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricViewedCampaign:onChange:

Use this method to send a campaing viewed metric.

+ (void)sendMetricViewedCampaign:(PSHCampaignDAO *)campaign onChange:(BOOL)state

Parameters

campaign

Viewed campaign.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricLocation:onChange:

Use this method to send a location metric.

+ (void)sendMetricLocation:(CLLocation *)location onChange:(BOOL)state

Parameters

location

Location to send.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricFacbookID:onChange:

Use this method to send a facebook ID metric.

+ (void)sendMetricFacbookID:(NSString *)facebookId onChange:(BOOL)state

Parameters

facebookId

Facebook ID.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricTwitterID:onChange:

Use this method to send a twitter ID metric.

+ (void)sendMetricTwitterID:(NSString *)twitterId onChange:(BOOL)state

Parameters

twitterId

Twitter ID.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricGoogleID:onChange:

Use this method to send a google ID metric.

+ (void)sendMetricGoogleID:(NSString *)googleId onChange:(BOOL)state

Parameters

googleId

Google ID.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricUserID:onChange:

Use this method to send a user ID metric.

+ (void)sendMetricUserID:(NSString *)userId onChange:(BOOL)state

Parameters

userId

User ID.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricCartProducts:onChange:

Use this method to send a number of products in the cart metric.

+ (void)sendMetricCartProducts:(NSUInteger)number onChange:(BOOL)state

Parameters

number

Number of products in the cart.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricAddCartProduct:productId:price:currency:onChange:

Use this method to send a product add on the cart metric.

+ (void)sendMetricAddCartProduct:(NSString *)name productId:(NSString *)productId price:(NSNumber *)price currency:(NSString *)currency onChange:(BOOL)state

Parameters

name

Name of product

productId

ID of product

price

Price of product

currency

Currency in ISO 4217 codification

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricDeleteCartProduct:productId:price:currency:onChange:

Use this method to send a product remove from the cart metric.

+ (void)sendMetricDeleteCartProduct:(NSString *)name productId:(NSString *)productId price:(NSNumber *)price currency:(NSString *)currency onChange:(BOOL)state

Parameters

name

Name of product

productId

ID of product

price

Price of product

currency

Currency in ISO 4217 codification

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendMetricContentViewName:onChange:

Use this method to send a content view name metric.

+ (void)sendMetricContentViewName:(NSString *)name onChange:(BOOL)state

Parameters

name

Content view name.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendCustomMetricBoolean:type:subtype:

Use this method to send your custom metrics to the manager with boolean value.

+ (void)sendCustomMetricBoolean:(BOOL)value type:(NSString *)type subtype:(NSString *)subtype

Parameters

value

Boolean value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

Declared In

PSHMetrics.h

+ sendCustomMetricString:type:subtype:

Use this method to send your custom metrics to the manager with string value.

+ (void)sendCustomMetricString:(NSString *)value type:(NSString *)type subtype:(NSString *)subtype

Parameters

value

String value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

Declared In

PSHMetrics.h

+ sendCustomMetricNumber:type:subtype:

Use this method to send your custom metrics to the manager with number value.

+ (void)sendCustomMetricNumber:(NSNumber *)value type:(NSString *)type subtype:(NSString *)subtype

Parameters

value

Number value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

Declared In

PSHMetrics.h

+ sendCustomMetricDate:type:subtype:

Use this method to send your custom metrics to the manager with date value.

+ (void)sendCustomMetricDate:(NSDate *)value type:(NSString *)type subtype:(NSString *)subtype

Parameters

value

Date value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

Declared In

PSHMetrics.h

+ sendCustomMetricBoolean:type:subtype:onChange:

Use this method to send your custom metrics to the manager with boolean value.

+ (void)sendCustomMetricBoolean:(BOOL)value type:(NSString *)type subtype:(NSString *)subtype onChange:(BOOL)state

Parameters

value

Boolean value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendCustomMetricString:type:subtype:onChange:

Use this method to send your custom metrics to the manager with string value.

+ (void)sendCustomMetricString:(NSString *)value type:(NSString *)type subtype:(NSString *)subtype onChange:(BOOL)state

Parameters

value

String value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendCustomMetricNumber:type:subtype:onChange:

Use this method to send your custom metrics to the manager with number value.

+ (void)sendCustomMetricNumber:(NSNumber *)value type:(NSString *)type subtype:(NSString *)subtype onChange:(BOOL)state

Parameters

value

Number value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ sendCustomMetricDate:type:subtype:onChange:

Use this method to send your custom metrics to the manager with date value.

+ (void)sendCustomMetricDate:(NSDate *)value type:(NSString *)type subtype:(NSString *)subtype onChange:(BOOL)state

Parameters

value

Date value.

type

An NSString defining the type of your metric.

subtype

An NSString defining the subtype of your metric.

state

Send only when value changed. Default is NO.

Declared In

PSHMetrics.h

+ forceSendMetrics

Use this method to send the metrics immediately.

+ (void)forceSendMetrics

Declared In

PSHMetrics.h

+ setMetricSendInterval:

By default the send interval is 5 minutes.

+ (void)setMetricSendInterval:(NSTimeInterval)timeInterval

Discussion

@param timeInterval

Declared In

PSHMetrics.h