Findify Analytics Reference
Findify Analytics is a library that sets up environment variables and exposes methods you can use to track and store events required by the Feedback API and by Findify's AI algorithms. It will automatically define the best data transfer method depending on the browser version or environment.
Configuration
key
key
Your private API key, which you can get in the "integration section" of the Findify Merchant Dashboard.
events
events
Key-value object with events that you don't want to track. You can set to false
to disable automatic tracking. By default Findify Analytics tracks everything.
events: { 'view-page': false }
platform
platform
Enable specific platform-based logic. Currently extra logic is implemented only for bigcommerce
and for shopify
platforms.
platofrm: { bigcommerce: true }
Methods
sendEvent
sendEvent
Sends an event to the Feedback API with parameters defined in the second parameter. The third argument determines if this event should be saved in cookies or not, to prevent losing this event when the page reloads.
analytics.sendEvent('click-item', { rid: REQUEST_ID, id: ITEM_ID }, true)
listen
listen
Allows for listen to all events that are tracked through analytics.
var unsubsribe = analytics.listen(function (event, props) { }); // Start listening to events
unsubsribe() // Remove event listener
invalidate
invalidate
Updates analytic.store
and sends provided events to the Feedback API immediately.
analytics.invalidate({ 'click-suggestion': {...} })
Properties
user
user
Getter function, that returns the current user. This user
object is required in Agents and SDK.
console.log(analytics.user)
// > { uid: USER_ID, sid: SESSION_ID, persist: true/false }
state
state
Getter/Setter functions, that return information about previously tracked events that are not sent to the Feedback API yet.
console.log(analytics.state)
// > { 'view-page': {...} }
analytics.state = { 'add-top-cart': {...} }
console.log(analytics.state)
// > { 'view-page': {...}, 'add-top-cart': {...} }
Updated about 1 year ago