Skip to main content

I’ve gotten the Notify Me When Available button to work on Shopify product pages, but I need to trigger this button programmatically when a particular URL parameter is passed in. So far, I have tried 

$('.klaviyo-bis-trigger').trigger('click');
$('.klaviyo-bis-trigger').trigger('change');
$('.klaviyo-bis-trigger').click();

To no avail. How can I programmatically click this button?

Thanks!

I wonder if the issue is the anchor link hasn’t rendered yet from the klaviyo JavaScript before your code loads.

 

You could also try directly calling the Create Client Back In Stock Subscription API: https://developers.klaviyo.com/en/reference/create_client_back_in_stock_subscription


Thank you so much for your help. Thanks to your comment, I did end up writing a custom JavaScript module that tapped into the client side of that API endpoint and pushed subscriptions manually. Job done!


Great to hear!


Reply