Interfaces

Interface: UseAnalytics

react-autonomy.UseAnalytics

UseAnalytics contains the tracking functions returned by useAnalytics.

Properties

chordAnalytics

chordAnalytics: AnalyticsClient

This provides low level access to Chord's analytics client.

Defined in



trackCartViewed

trackCartViewed: (options?: TrackCartViewed) => { payload: TrackCartViewed = options; type: string = TRACK_CART_VIEWED }

Type declaration

▸ (options?): Object

The trackCartViewed function sends a Cart Viewed event to Segment. You should call this function when the cart page is viewed.



JS


Parameters

Name

Type

options?

Returns

Object

Name

Type

payload

type

string

Defined in



trackCollectionClicked

trackCollectionClicked: (options: TrackCollectionClicked) => { payload: TrackCollectionClicked = options; type: string = TRACK_COLLECTION_CLICKED }

Type declaration

▸ (options): Object

The trackCollectionClicked function fires a Collection Clicked event to Segment. You should call this function when the user clicks on a link to a collection.



JS


Parameters

Name

Type

options

Returns

Object

Name

Type

payload

type

string

Defined in



trackEmailCaptured

trackEmailCaptured: (options: TrackEmailCaptured) => { payload: TrackEmailCaptured = options; type: string = TRACK_EMAIL_CAPTURED }

Type declaration

▸ (options): Object

The trackEmailCaptured function sends a Email Captured event to Segment. You should call this whenever the user enters an email. Examples of this can include newsletter signups, coupon pop-ups and/or logins. This function will also identify the user to Segment so that all subsequent tracking calls will be associated with this email.



JS


Parameters

Name

Type

options

Returns

Object

Name

Type

payload

type

string

Defined in



trackProductClicked

trackProductClicked: (options: TrackProductClicked) => { payload: TrackProductClicked = options; type: string = TRACK_PRODUCT_CLICKED }

Type declaration

▸ (options): Object

The trackProductClicked function sends a Product Clicked event to Segment. You should call this function when the user clicks on a link to a product.



JS


Parameters

Name

Type

options

Returns

Object

Name

Type

payload

type

string

Defined in



trackProductViewed

trackProductViewed: (options: TrackProductViewed) => { payload: TrackProductViewed = options; type: string = TRACK_PRODUCT_VIEWED }

Type declaration

▸ (options): Object

The trackProductViewed function fires a Product Viewed event to Segment. You should call this function when a product page is opened.



JS


Parameters

Name

Type

options

Returns

Object

Name

Type

payload

type

string

Defined in



trackVariantClicked

trackVariantClicked: (options: TrackVariantClicked) => { payload: TrackVariantClicked = options; type: string = TRACK_VARIANT_CLICKED }

Type declaration

▸ (options): Object

The trackVariantClicked function sends a Variant Clicked event to Segment. You should call this function when the user clicks on a link to

This function takes a product and not a variant.



JS


Parameters

Name

Type

options

Returns

Object

Name

Type

payload

type

string

Defined in