Solved

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

  • 3 August 2022
  • 5 replies
  • 111 views

Badge +1
  • Problem Solver I
  • 3 replies

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?

icon

Best answer by cs44 7 August 2022, 04:28

View original

5 replies

Userlevel 7
Badge +58

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

Badge +1

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

Userlevel 7
Badge +58

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.
 

Badge +1

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. 

Badge +1

Follup for anyone that finds this through search.

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

 

Reply