Interface: UseAnalytics
react-autonomy.UseAnalytics
UseAnalytics contains the tracking functions returned by useAnalytics.
• chordAnalytics: AnalyticsClient
This provides low level access to Chord's analytics client.
• trackCartViewed: (options?: TrackCartViewed) => { payload: TrackCartViewed = options; type: string = TRACK_CART_VIEWED }
▸ (options?): Object
The trackCartViewed function sends a Cart Viewed event to Segment. You should call this function when the cart page is viewed.
Name | Type |
---|---|
options? |
Object
Name | Type |
---|---|
payload | |
type | string |
• trackCollectionClicked: (options: TrackCollectionClicked) => { payload: TrackCollectionClicked = options; type: string = TRACK_COLLECTION_CLICKED }
▸ (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.
Name | Type |
---|---|
options |
Object
Name | Type |
---|---|
payload | |
type | string |
• trackEmailCaptured: (options: TrackEmailCaptured) => { payload: TrackEmailCaptured = options; type: string = TRACK_EMAIL_CAPTURED }
▸ (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.
Name | Type |
---|---|
options |
Object
Name | Type |
---|---|
payload | |
type | string |
• trackProductClicked: (options: TrackProductClicked) => { payload: TrackProductClicked = options; type: string = TRACK_PRODUCT_CLICKED }
▸ (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.
Name | Type |
---|---|
options |
Object
Name | Type |
---|---|
payload | |
type | string |
• trackProductViewed: (options: TrackProductViewed) => { payload: TrackProductViewed = options; type: string = TRACK_PRODUCT_VIEWED }
▸ (options): Object
The trackProductViewed function fires a Product Viewed event to Segment. You should call this function when a product page is opened.
Name | Type |
---|---|
options |
Object
Name | Type |
---|---|
payload | |
type | string |
• trackVariantClicked: (options: TrackVariantClicked) => { payload: TrackVariantClicked = options; type: string = TRACK_VARIANT_CLICKED }
▸ (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.
Name | Type |
---|---|
options |
Object
Name | Type |
---|---|
payload | |
type | string |