Skip to main content
Problem Solver I
August 3, 2022
Solved

Does `_learnq.push` support callbacks or a Promise API?

  • August 3, 2022
  • 5 replies
  • 223 views

It would be helpful if `_learnq.push` supported callbacks or a Promise API in order to chain event driven client-side calls.

 

Is this possible? How are other users handling this?

    This topic has been closed for replies.
    Best answer by cs44

    Follup for anyone that finds this through search.

    “Complete release in GA in a couple weeks” -- Klaviyo tech support.

     

    5 replies

    alex.hong
    Klaviyo Alum
    August 3, 2022

    Hi there @cs44,

    Welcome to the Community.

    Not sure if this would help but our development team suggested using a callback on the identify() call.
    Something like this:
     

    function onIdentifyCompleteCallback () {
    _learnq.track("Neat Event");
    }

    _learnq.identify(identityProperties, undefined, undefined, onIdentifyCompleteCallback);

     
    This will ensure that the identify() request has resolved and the cookie will be set before track() is called. 

    Thank you for sharing your feedback on our API and integrations. As we wait for other Community members to chime in with their thoughts, I can let our product teams know about this and put it as a request.

     

    All the best,

    Alex

    cs44Author
    Problem Solver I
    August 4, 2022

    Does `.push` have a similar signature? My use case pertains to Stripe Checkout, where I need to redirect to an external URL.

    alex.hong
    Klaviyo Alum
    August 4, 2022

    Currently we do not have any plans to implement the stripe payments api. However, I will submit your feedback to our Product and Engineering teams, so this feature can potentially be added in the future.
     

    cs44Author
    Problem Solver I
    August 4, 2022

    I’m not asking if there are plans to implement Stripe, which is very concerning. 
     

    I’m asking if `.push` has a method signature that supports callbacks. Please ask one of your developers. 

    cs44AuthorAnswer
    Problem Solver I
    August 7, 2022

    Follup for anyone that finds this through search.

    “Complete release in GA in a couple weeks” -- Klaviyo tech support.