Guide
Connectors
Klaviyo : Segmentation
13min
the following guide will walk you through accessing klevu smart recommendation configurations and applying corresponding pre configured segments to web visitors via the klevu api to implement klaviyo segmentation logic with klevu smart recommendations, you need an active subscription to klaviyo and klevu smart recommendations (with personalization enabled) the intitial setup and configuration process takes place within the klevu merchant center detailed instructions on how to integrate klaviyo with klevu smart recommendations can be found here there are four key steps to consider 1\ fetch the applicable segments for the visitor 2\ apply the segments to the recommendations configuration 3\ request and display the klevu recommendations banner 4\ collect klevu analytics (impressions and interaction) 1\ fetch the applicable segments for the visitor three parameters are necessary to obtain the appropriate visitor segments 1\ klevu api key 2\ klevu session id 3\ klaviyo exchange id once the klevu session id and the klaviyo exchange id have been obtained, they can be stored locally and used in subsequent calls to klevu for recommendations retain the sessionid value for this user for use in subsequent api calls to klevu for a maximum of the ttl time at this point refresh the sessionid so as to retain continuity obtain klaviyo exchange id klaviyo holds identity and tracking information in a local browser cookie the exchange id is an encrypted identifier for a klaviyo profile id the value is commonly stored within the base64 encoded klaviyo cookie “ kla id” more information can be found on the klaviyo developer's website understanding cookies in klaviyo | klaviyo help center https //help klaviyo com/hc/en us/articles/360034666712 klaviyo developers https //developers klaviyo com/en/v1 2/reference/exchange retain the $exchange id value for this user for use in subsequent api calls to klevu obtain applicable visitor segments use the session endpoint to push the klaviyo exchangeid to klevu this will allow klevu to communicate with klaviyo directly and return the visitor's applied segmentation endpoint (post) retain the segment value for this user for use in subsequent api calls to klevu important the segments may be updated for any given visitor throughout the session to keep the segments relevant, please request an updated segment list after the ttl has expired 2\ apply the segments to the recommendations configuration please review the section on api configurations docid\ gp pf1 nmovk01kou09nd for a complete list of applicable parameters to use based on the application/placement of the recommendation banner retain spotkey , spotname , segmentkey , segmentname for reference in the following analytics collection api calls to klevu the resulting search payload json object will be the query payload used to call klevu for the recommendations corresponding result set 3\ request and display the klevu recommendations banner use the provided query structure from the search payload json within the above response to retrieve the recommendations array from klevu see the klevu smart recommendations api overview for details on query specifics 4\ collect klevu analytics after the recommendations have been displayed, collect the analytics to send to klevu please use the appropriate event value for each event type product recommendation impression event = view recs list product clicks from recommendation banner event = select recs list